Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100755 114 lines (78 sloc) 6.258 kb
0283827b »
2011-11-04 Adding android sdk setup script
1 #! /bin/bash
2
3
4 echo "Enter android-sdk version or hit enter for r15"
5 read version
6 if [ "$version" == "" ]
7 then
8 version="r15"
9 fi
10
11 dl="android-sdk_$version-linux.tgz"
12 url="http://dl.google.com/android/$dl"
13
14 echo "Get 64 bit dependencies? [Y/N] Y:"
15 read get64BitDep
16 if [ "$get64BitDep" != "N" ]
17 then
18 echo "Getting (64 bit) dependencies"
19 sudo apt-get install ia32-libs
20 fi
21
22 echo "Setting up android sdk $version from $url"
23 sudo mkdir /opt/android
24 sudo mkdir "/opt/android/sdk-$version"
25 cd /opt/android
26 sudo wget "$url"
27 sudo tar xzf "$dl" -C "/opt/android/sdk-$version"
28 sudo rm "$dl"
29 sudo ln -s "/opt/android/sdk-$version/android-sdk-linux" /opt/android/latest
30
31 sudo chown -R $USER "/opt/android/sdk-$version"
32
33 sudo update-alternatives --install /usr/bin/android android "/opt/android/latest/tools/android" 1
34 sudo update-alternatives --install /usr/bin/android android "/opt/android/sdk-$version/android-sdk-linux/tools/android" 2
35
36 sudo update-alternatives --install /usr/bin/apkbuilder apkbuilder "/opt/android/latest/tools/apkbuilder" 1
37 sudo update-alternatives --install /usr/bin/apkbuilder apkbuilder "/opt/android/sdk-$version/android-sdk-linux/tools/apkbuilder" 2
38
39 sudo update-alternatives --install /usr/bin/ddms ddms "/opt/android/latest/tools/ddms" 1
40 sudo update-alternatives --install /usr/bin/ddms ddms "/opt/android/sdk-$version/android-sdk-linux/tools/ddms" 2
41
42 sudo update-alternatives --install /usr/bin/dmtracedump dmtracedump "/opt/android/latest/tools/dmtracedump" 1
43 sudo update-alternatives --install /usr/bin/dmtracedump dmtracedump "/opt/android/sdk-$version/android-sdk-linux/tools/dmtracedump" 2
44
45 sudo update-alternatives --install /usr/bin/draw9patch draw9patch "/opt/android/latest/tools/draw9patch" 1
46 sudo update-alternatives --install /usr/bin/draw9patch draw9patch "/opt/android/sdk-$version/android-sdk-linux/tools/draw9patch" 2
47
48 sudo update-alternatives --install /usr/bin/emulator emulator "/opt/android/latest/tools/emulator" 1
49 sudo update-alternatives --install /usr/bin/emulator emulator "/opt/android/sdk-$version/android-sdk-linux/tools/emulator" 2
50
51 sudo update-alternatives --install /usr/bin/emulator-arm emulator-arm "/opt/android/latest/tools/emulator-arm" 1
52 sudo update-alternatives --install /usr/bin/emulator-arm emulator-arm "/opt/android/sdk-$version/android-sdk-linux/tools/emulator-arm" 2
53
54 sudo update-alternatives --install /usr/bin/emulator-x86 emulator-x86 "/opt/android/latest/tools/emulator-x86" 1
55 sudo update-alternatives --install /usr/bin/emulator-x86 emulator-x86 "/opt/android/sdk-$version/android-sdk-linux/tools/emulator-x86" 2
56
57 sudo update-alternatives --install /usr/bin/etc1tool etc1tool "/opt/android/latest/tools/etc1tool" 1
58 sudo update-alternatives --install /usr/bin/etc1tool etc1tool "/opt/android/sdk-$version/android-sdk-linux/tools/etc1tool" 2
59
60 sudo update-alternatives --install /usr/bin/hierarchyviewer hierarchyviewer "/opt/android/latest/tools/hierarchyviewer" 1
61 sudo update-alternatives --install /usr/bin/hierarchyviewer hierarchyviewer "/opt/android/sdk-$version/android-sdk-linux/tools/hierarchyviewer" 2
62
63 sudo update-alternatives --install /usr/bin/hprof-conv hprof-conv "/opt/android/latest/tools/hprof-conv" 1
64 sudo update-alternatives --install /usr/bin/hprof-conv hprof-conv "/opt/android/sdk-$version/android-sdk-linux/tools/hprof-conv" 2
65
66 sudo update-alternatives --install /usr/bin/layoutopt layoutopt "/opt/android/latest/tools/layoutopt" 1
67 sudo update-alternatives --install /usr/bin/layoutopt layoutopt "/opt/android/sdk-$version/android-sdk-linux/tools/layoutopt" 2
68
69 sudo update-alternatives --install /usr/bin/mksdcard mksdcard "/opt/android/latest/tools/mksdcard" 1
70 sudo update-alternatives --install /usr/bin/mksdcard mksdcard "/opt/android/sdk-$version/android-sdk-linux/tools/mksdcard" 2
71
72 sudo update-alternatives --install /usr/bin/monkeyrunner monkeyrunner "/opt/android/latest/tools/monkeyrunner" 1
73 sudo update-alternatives --install /usr/bin/monkeyrunner monkeyrunner "/opt/android/sdk-$version/android-sdk-linux/tools/monkeyrunner" 2
74
75 sudo update-alternatives --install /usr/bin/sqlite3 sqlite3 "/opt/android/latest/tools/sqlite3" 1
76 sudo update-alternatives --install /usr/bin/sqlite3 sqlite3 "/opt/android/sdk-$version/android-sdk-linux/tools/sqlite3" 2
77
78 sudo update-alternatives --install /usr/bin/traceview traceview "/opt/android/latest/tools/traceview" 1
79 sudo update-alternatives --install /usr/bin/traceview traceview "/opt/android/sdk-$version/android-sdk-linux/tools/traceview" 2
80
81 sudo update-alternatives --install /usr/bin/zipalign zipalign "/opt/android/latest/tools/zipalign" 1
82 sudo update-alternatives --install /usr/bin/zipalign zipalign "/opt/android/sdk-$version/android-sdk-linux/tools/zipalign" 2
83
84
d8c14736 »
2011-11-04 adding sbt
85 echo "Update sdk? (this takes a while) [Y/N] Y:"
0283827b »
2011-11-04 Adding android sdk setup script
86 read updateSdk
87 if [ "$updateSdk" != "N" ]
88 then
89 android update sdk -u
90 echo "Android sdk updated"
91
92 sudo update-alternatives --install /usr/bin/adb adb "/opt/android/latest/platform-tools/adb" 1
93 sudo update-alternatives --install /usr/bin/adb adb "/opt/android/sdk-$version/android-sdk-linux/platform-tools/adb" 2
94
95 sudo update-alternatives --install /usr/bin/aapt aapt "/opt/android/latest/platform-tools/aapt" 1
96 sudo update-alternatives --install /usr/bin/aapt aapt "/opt/android/sdk-$version/android-sdk-linux/platform-tools/aapt" 2
97
98 sudo update-alternatives --install /usr/bin/aidl aidl "/opt/android/latest/platform-tools/aidl" 1
99 sudo update-alternatives --install /usr/bin/aidl aidl "/opt/android/sdk-$version/android-sdk-linux/platform-tools/aidl" 2
100
101 sudo update-alternatives --install /usr/bin/dexdump dexdump "/opt/android/latest/platform-tools/dexdump" 1
102 sudo update-alternatives --install /usr/bin/dexdump dexdump "/opt/android/sdk-$version/android-sdk-linux/platform-tools/dexdump" 2
103
104 sudo update-alternatives --install /usr/bin/dx dx "/opt/android/latest/platform-tools/dx" 1
105 sudo update-alternatives --install /usr/bin/dx dx "/opt/android/sdk-$version/android-sdk-linux/platform-tools/dx" 2
106
107 sudo update-alternatives --install /usr/bin/llvm-rs-cc llvm-rs-cc "/opt/android/latest/platform-tools/llvm-rs-cc" 1
108 sudo update-alternatives --install /usr/bin/llvm-rs-cc llvm-rs-cc "/opt/android/sdk-$version/android-sdk-linux/platform-tools/llvm-rs-cc" 2
109
110
111 fi
112
113
Something went wrong with that request. Please try again.