Skip to content

Environment setup for ubuntu

kronn edited this page Aug 18, 2012 · 3 revisions

This is a basic environment set up from a clean build of Ubuntu (tested on 10.04 LTS and 11.04).

Preliminary Sidenote for people having a RVM-ruby enviroment setup

If you already have ruby with RVM or so installed, you can skip the parts where you install those. I successfully installed all this without sudo in a local directory. Just make sure that the PATH includes everything mentioned here. For existing Ruby-installs: you just need to give a RUBY_GEM_HOME with matches your installation of Ruby.

Basic setup from a clean Ubuntu

  • First install Java and Ant:
sudo apt-get -y install default-jdk ant
  • Then install Ruby, Rubygems, and Rake:
sudo apt-get -y install ruby rubygems rake
  • If you're running a 64bit install of Ubuntu, you'll need the 32bit libs:
sudo apt-get -y install ia32-libs
  • Determine the current Android SDK revision and install location, then install Android:
ANDROID_REVISION=20.0.3
ANDROID_LOCATION=/usr/local/lib

cd $ANDROID_LOCATION 
sudo wget http://dl.google.com/android/android-sdk_r$ANDROID_REVISION-linux.tgz
sudo tar --no-same-owner -xzvf android-sdk_r$ANDROID_REVISION-linux.tgz
sudo chmod -R a+xr android-sdk-linux
sudo rm android-sdk_r$ANDROID_REVISION-linux.tgz
sudo $ANDROID_LOCATION/android-sdk-linux/tools/android update sdk -u -t platform-tool
sudo $ANDROID_LOCATION/android-sdk-linux/tools/android update sdk -u -t platform
  • Finally, add binary locations to PATH for Android and Rubygems:
cd ~
echo -e "\n##############################################\n#\n# PATH Additions\n#\n\n"  >> .bashrc
echo "ANDROID_HOME=$ANDROID_LOCATION/android-sdk-linux" >> .bashrc
echo "RUBY_GEM_HOME=/var/lib/gems/1.8" >> .bashrc
echo -e "PATH=$""PATH:$""ANDROID_HOME/tools:$""ANDROID_HOME/platform-tools:$""RUBY_GEM_HOME/bin\n" >> .bashrc
source .bashrc
  • Note: You run the android binary for multiple reasons (generate projects, create emulators, download platforms). If you're downloading platforms, run android as root if you installed it as root as it needs to write to the installation directory.
Clone this wiki locally