HowTo (Mac) - Install
build environment relies on a number of other components.
For best results, these should be installed in layers, e.g:
- Mac OS X - operating system
- Xcode - development tools
- Homebrew - package management
- Erlang - programming language, VM
- Elixir - programming language
- fwup - firmware uploader
- miscellany -
- Nerves - build environment
- your Nerves application(s)
For best results, be sure that you have at least the following versions installed:
- Elixir 1.3.2
- Erlang 19.0.2
- Xcode 7.2.1
Much of this material is adapted
from the Nerves Project
Xcode provides a GUI
which has no particular relevance to Nerves.
However, it also provides assorted command-line utilities
and libraries which you will need.
If you are running a current version of OSX,
you should probably install Xcode from the Mac App Store
If not, things get a bit trickier.
I haven't used the xcode-install
but it looks quite promising.
Alternatively, after becoming a member
in the Apple Developer Program
(the free level is fine),
you can get Xcode from the Downloads / More
For example, I'm using Xcode 7.2.1 on Yosemite (OSX 10.10.5).
What Does Homebrew Do?
Homebrew installs the stuff you need that Apple didn’t.
Homebrew (aka brew) is a package management tool for Mac OS X.
We'll be using it to install most of the basic infrastructure
that Nerves requires (e.g., Erlang, Elixir).
First, we need to make sure that we have the latest version of Homebrew
and its database of package version information:
$ brew update
Updated Homebrew from bd4e24a to b512834.
Install the latest versions of Erlang and Elixir,
create symbolic links to the executables, etc:
$ brew unlink erlang elixir
$ brew install erlang elixir
$ brew link erlang elixir
Confirm that the current versions are found and executed.
$ elixir --version
Erlang/OTP 19 [erts-8.0.1] ...
utility is a configurable, image-based,
firmware update utility for embedded Linux-based systems.
When finalizing firmware and creating a root filesystem for your target,
Nerves utilizes scripts and utilities which have dependencies
$ brew unlink fwup coreutils squashfs
$ brew install fwup coreutils squashfs
$ brew link fwup coreutils squashfs
archive to your Mix
This allows Nerves
to bootstrap the environment,
ensuring that your code uses the right cross-compiler for the target.
$ mix archive.install $nb_ez
* creating /Users/rdm/.mix/archives/nerves_bootstrap
We have now installed everything we need to build a Nerves system image.
So, let's move on to the Build
This wiki page is maintained by Rich Morin
an independent consultant specializing in software design, development, and documentation.
Please feel free to email
comments, inquiries, suggestions, etc!