Skip to content

Instantly share code, notes, and snippets.

@hayeshaugen
Created May 27, 2011 01:07
Show Gist options
  • Star 6 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save hayeshaugen/994453 to your computer and use it in GitHub Desktop.
Save hayeshaugen/994453 to your computer and use it in GitHub Desktop.
Android SDK headless install for Linux Jenkins CI
# sudo su -
# apt-get install openjdk-6-jdk
# apt-get install ant1.8
Source control, in this case svn:
# apt-get install subversion
Install Jenkins
# wget -q -O - http://pkg.jenkins-ci.org/debian/jenkins-ci.org.key | sudo apt-key add -
# echo "deb http://pkg.jenkins-ci.org/debian binary/" > /etc/apt/sources.list.d/jenkins.list
# aptitude update
# aptitude install jenkins
Android sdk
# mkdir /android
# cd /android
# wget http://dl.google.com/android/android-sdk_r16-linux.tgz
# tar xzvf android-sdk_r16-linux.tgz
[make sure jenkins has permissions for this directory]
[edit path in etc/bash.bashrc to include /android/android-sdk-linux/tools]
# /android/android-sdk-linux/tools/android update sdk --no-ui
[this will download all supported sdks which is probably overkill even for a build machine]
[to limit which sdks get downloaded use a filter as explained by help: android -h update]
Grab the project
# svn co http://server/path
maybe update projects
# android update project -p [path to project]
@hayeshaugen
Copy link
Author

This is a rough outline, probably not complete. Permissions and security are a little wonky too.

@jasonm23
Copy link

Having an android group and adding the jenkins user to it, is a reasonably simple way to sort out permission issues. Perhaps better to have android sdk installed to /usr/local/share/ but that's just my preference.

@smarek
Copy link

smarek commented Jun 20, 2013

I'd suggest using /opt path as it is meaningfull to do it like that, and permissions setting depends on what will be using android sdk. Using android:android for sdk folder, adding jenkins to android group and adding tools and platform-tools to PATH only in android user, not to pollute global PATH or bring security risk

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