Skip to content

Instantly share code, notes, and snippets.

@andreif
Last active December 27, 2015 20:49
Show Gist options
  • Select an option

  • Save andreif/7387612 to your computer and use it in GitHub Desktop.

Select an option

Save andreif/7387612 to your computer and use it in GitHub Desktop.
How to install the Android SDK onto Apple’s OS X Lion

Author: Spencer Hill

Source: http://www.theportlandcompany.com/2012/02/how-to-install-the-android-sdk-onto-apples-os-x-lion/

#How to install the Android SDK onto Apple’s OS X Lion

I had difficulty finding straightforward instructions on how to install the Google Android SDK onto Apple’s OS X Lion so I could test websites. Eventually I merged the instructions provided by this Ben Hedrington with the instructions provided on the official Google Android SDK page and was successful.

So I’ve written revised instructions below for Apple’s OS X Lion 10.7.3:

  1. Download the latest version of the Android SDK.
  2. Unzip it and deposit it into your home directory (~/).
  3. Open the Terminal app, which should start you in your home directory as well, and type “vi .bash_profile” and press return/enter
  4. Paste the following “export PATH=${PATH}:~/android-sdk-macosx/tools” and save and exit from the file by pressing “Command”, “Shift” and “z” twice (so that will be “ZZ”) in that order at the same time.
  5. Now type “android” and press return/enter.

You should now see an application called “java” appear on your dock that uses the Android icon. Additionally it will open a window that will allow you to install the additional components required so you can actually use the Android operating system as you would on a regular mobile device.

  1. Select “Tools” and whichever versions of the Android OS that you would like to install. Though I recommend only selecting the latest version and verifying it works properly before installing the others.
  2. From the “Tools” menu in the OS X toolbar select “Manage AVDs…” (Android Virtual Devices).
  3. Select “New”.
  4. You may enter the name of your choice, and then select the Android OS version you previously installed from the “Target” list.
  5. Select “Create”
  6. Then select the AVD from the list and select “Start” -> “Launch” Note: I’m running a MacBook Pro with 8GB’s of RAM and a SSD with 2.4Ghz Intel Core Duo 2 and it took over a minute for the Android 4.0.3 OS to start.

You have now successfully installed and launched the Android SDK simulator application on your Apple Lion OS X.

$ cd ~/Downloads
# 75 MB
$ curl -O http://dl.google.com/android/android-sdk_r22.3-macosx.zip

$ export ANDROID_HOME=/Users/andrei/Downloads/INSTALL/adt-bundle-mac-x86_64-20131030/sdk
$ android &
$ export PATH=$PATH:$ANDROID_HOME/tools
$ export PATH=$PATH:$ANDROID_HOME/platform-tools
$ export PATH=$PATH:$ANDROID_HOME/build-tools/android-4.4

$ rvm get latest
$ rvm jruby-1.7.6 --install
$ jruby -v
jruby 1.7.6 (1.9.3p392) 2013-10-22 6004147 on Java HotSpot(TM) 64-Bit \
Server VM 1.6.0_65-b14-462-11M4609 [darwin-x86_64]

$ rvm @android --create
$ rvm current
jruby-1.7.6@android

$ rvm current > .rvmrc && rvm rvmrc to .ruby-version
$ cd .

# gem install --pre ruboto
$ mkdir lib
$ git clone git clone git@github.com:ruboto/ruboto.git lib/ruboto
$ echo "source 'https://rubygems.org'" >> Gemfile
$ echo "gem 'ruboto', path: 'lib/ruboto'" >> Gemfile
$ echo "gem 'jruby-jars'" >> Gemfile
$ bundle
$ ruboto --version
0.16.0.dev

# remove "export DYLD_FALLBACK_LIBRARY_PATH=..." from bashrc

# change default target to 19 in
$ nano nano lis/ruboto/lib/ruboto/sdk_versions.rb
# or run ruboto setup --target android-19

$ ruboto setup
Java runtime             : Found
Java Compiler            : Found
Apache ANT               : Found
Android Package Installer: Found
Android Emulator         : Found
Android SDK Command adb  : Found
Android SDK Command dx   : Found
Platform SDK android-19  : Found

    *** Ruboto setup is OK! ***

$ ruboto gen app --package my.package.name

$ cd [project dir] && ruboto setup

$ brew install ant

$ rake
...
BUILD SUCCESSFUL
Total time: 9 seconds


FAILS $ ruboto emulator
@skull-squadron

Copy link
Copy Markdown

Thanks for this!

Just tried ruboto recently, and ruboto gen app --package my.name worked (minus package.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment