Skip to content

Commit

Permalink
Merge commit '535deea3f6e9263bc31ee4e915f262b9eb39ae08' into theand1404
Browse files Browse the repository at this point in the history
* commit '535deea3f6e9263bc31ee4e915f262b9eb39ae08':
  Add Android script
  • Loading branch information
theand committed Feb 27, 2015
2 parents 7061cf3 + 535deea commit 97cf07c
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 1 deletion.
3 changes: 3 additions & 0 deletions Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,9 @@ Vagrant.configure("2") do |config|
# Install Ansible
# config.vm.provision "shell", path: "#{github_url}/scripts/ansible.sh"

# Install Android
# config.vm.provision "shell", path: "#{github_url}/scripts/android.sh"

####
# Local Scripts
# Any local scripts you may want to run post-provisioning.
Expand Down
3 changes: 2 additions & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,8 @@ Here's a quickstart screencast!
* Symfony
* PHPUnit
* MailCatcher
* Ansible
* Ansible
* Android

## The Vagrantfile

Expand Down
36 changes: 36 additions & 0 deletions scripts/android.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/usr/bin/env bash

echo ">>> Installing android";

ANDROID_SDK_FILENAME=android-sdk_r23.0.2-linux.tgz
ANDROID_SDK=http://dl.google.com/android/$ANDROID_SDK_FILENAME

# Intall Dependencies (JDK, Ant and expect)
sudo apt-get install -y openjdk-7-jdk ant expect

# Download Android SDK
curl -O $ANDROID_SDK
tar -xzvf $ANDROID_SDK_FILENAME

# Add permissions for vagrant user and removing .tgz file
sudo chown -R vagrant android-sdk-linux/
sudo rm -rf $ANDROID_SDK_FILENAME

# Add new values of variables environment in .bashrc
echo "" >> /home/vagrant/.bashrc
echo "JAVA_HOME=/usr/lib/jvm/java-7-openjdk-i386/jre/bin/java" >> /home/vagrant/.bashrc
echo "ANDROID_HOME=~/android-sdk-linux" >> /home/vagrant/.bashrc
echo "PATH=\$PATH:~/android-sdk-linux/tools:~/android-sdk-linux/platform-tools" >> /home/vagrant/.bashrc

expect -c '
set timeout -1 ;
spawn /home/vagrant/android-sdk-linux/tools/android update sdk -u --all --filter platform-tool,android-19,build-tools-19.1.0
expect {
"Do you accept the license" { exp_send "y\r" ; exp_continue }
eof
}
'

sudo /home/vagrant/android-sdk-linux/platform-tools/adb kill-server
sudo /home/vagrant/android-sdk-linux/platform-tools/adb start-server
sudo /home/vagrant/android-sdk-linux/platform-tools/adb devices

0 comments on commit 97cf07c

Please sign in to comment.