Vagrant to build and develop Android AOSP
Install Vagrant and VirtualBox.
Install with Homebrew or manually.
brew update
brew cask install virtualbox
brew cask install virtualbox-extension-pack
brew cask install vagrant
To build the VM do
vagrant up
Use the VM GUI or ssh in with
vagrant ssh
See the Vagrant Command-Line Interface docs for more information.
Guest Additions are needed to have a good experience using the VM GUI. There are multiple ways to install Guest Additions.
If you use the Vagrant plugin then Guest Additions will be installed and updated automatically, even when you upgrade VirtualBox.
vagrant plugin install vagrant-vbguest
This is the preferred approach but isn't currently working with VirtualBox 5.2.0 and the bento/ubuntu-16.04 base box we are using. See the VirtualBox download page for any Guest Additions updates.
If you copy VBoxGuestAdditions.iso from your VirtualBox installation into shared/VBoxGuestAdditions.iso then it will be installed automatically during provisioning.
cp /Applications/VirtualBox.app/Contents/MacOS/VBoxGuestAdditions.iso shared/
# or
wget https://www.virtualbox.org/download/testcase/VBoxGuestAdditions_5.2.1-118918.iso -O share/VBoxGuestAdditions.iso
In your VM menu choose Devices -> Insert Guest Additions CD image
The Android NDK contains all the tools needs to build the Android Linux kernel and native code. It is installed in /opt/android/ndk.