Automated provisioning and configuration of an Ubuntu VM containing the Android development environment, including Android ADT Bundle with SDK, Eclipse and QEO SDK using the Vagrant DevOps tool with Chef and shell-scripts.
This automated VM installation and configuration uses the excellent DevOps tool, Vagrant which works with both VirtualBox (free) and VMware Fusion & Workstation (paid plug-in) in addition to several Community Chef Cookbooks.
Please feel free to contribute improvements and enhancements to the provisioning code & reporting issues or questions. The goal is to improve this Android VM project with community support.
Currently, it will provision an Android VM for development with the following specifications,
- Ubuntu Trusty 64 VM
- Memory size: 2048 MB
- 2 vCPU
- Ubuntu Unity Desktop as the UI launched at startup (see the provision.sh section "Install a desktop for the Android graphical tooling" for other options)
- Android ADT Bundle 20140702 (including Eclipse)
- Qeo SDK 1.1.0
-
Create a working directory to use for the Android VM project in, e.g. ~/qeo-vm
-
Download or clone the project repository into the newly created directory on your local machine from one of the following sources,
Visit the Qeo-VM repository on GitHub,
https://github.com/elendrim/qeo-vm
Clone the Qeo-VM repository directly from GitHub,
https://github.com/elendrim/qeo-vm.git
Download the Qeo-VM repository as a zip file,
https://github.com/elendrim/qeo-vm/archive/master.zip
VirtualBox (Free) You need to install the "extension pack" depending on your version of VirtualBox, to be able to use USB devices.
-
Download and install the latest version of Vagrant for your OS from https://www.vagrantup.com/downloads.html
-
Install vagrant plugins :
$ vagrant plugin install vagrant-berkshelf $ vagrant plugin install vagrant-omnibus
Note: All the software needed is automatically downloaded as it is needed. Several of the downloads are somewhat large. Patience is a virtue while the automated installation is running.
-
From the newly created working directory, e.g.
$ cd ~/qeo-vm
-
Run the following to start Vagrant and kick-off the process to build an Android VM,
For VirtualBox,
$ vagrant up
Note: As the Android VM build runs you will see various types of screen output from Vagrant, Chef and Shell scripts -- some of the dependency downloads and compilations require a bit of time. Again, Patience is a virtue.
-
Once the Android VM build provisioning process is complete, run the following to login via SSH, and configure your keyboard.
$ vagrant ssh $ sudo dpkg-reconfigure keyboard-configuration
-
The Ubuntu Unity desktop UI is set to automatically launch on
vagrant up
, login using the credentials,- Username: vagrant
- Password: vagrant
-
The Android development environment directories with eclipse, sdk are located in the directory
/usr/local/android/
. -
The QEO development environment directories is located in the directory
/usr/local/QeoSDK/
. -
The VM has an internal
/vagrant
directory which maps to the directory created previously (i.e. the one from which you are running the Android VM on your local machine), e.g.~/qeo-vm
maps to the internal VM directory/vagrant
.The net effect is that anything you drop in your local working directory, e.g. ~/qeo-vm, can be accessed from within the VM by opening the directory "/vagrant" and vice-versa
To connect an Android device you must manually setup a USB connection mapping for your Android device to the new VM
For example, if using VirtualBox perform the following steps,
-
Plug your android device hardware into the computers USB port
-
Open the 'Oracle VM VirtualBox'
-
Run the QeoSdkVM
-
Click on the USB devices (on the bottom of the window) and select your device.
-
Verify that it appears when you run
lsusb
from the command line -
Your device should appear when running
lsusb
enabling you to use Androidadb
, e.g.$ adb devices ... List of devices attached 007jbmi6 device $ adb shell i.e. to log into the device (be sure to enable USB debugging on the device)
Note: Additionally you may want to change various settings in the Virtualization Provider to size memory and vCPUs allocated to the Android VM _Note: To open the terminal from desktop, use ctrl-alt-T for PC or control-option-T for Mac
$ vagrant up # start the QeoVM
$ vagrant provision # Download and reinstall all ( Eclipse + Java + Android + Qeo .. )
$ vagrant ssh # connect to the QeoVM in command line
$ vagrant status # status of QeoVM
$ vagrant halt # To shutdown the VM
$ vagrant reload # stop and restart the QeoVM
$ vagrant --help