forked from fideloper/Vaprobash
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge commit '535deea3f6e9263bc31ee4e915f262b9eb39ae08' into theand1404
* commit '535deea3f6e9263bc31ee4e915f262b9eb39ae08': Add Android script
- Loading branch information
Showing
3 changed files
with
41 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |