source: issm/trunk-jpl/externalpackages/android/android-sdk/install.sh@ 12097

Last change on this file since 12097 was 12097, checked in by glperez, 13 years ago

Modification to environment variables and file strucutre of Android.

  • Property svn:executable set to *
File size: 2.2 KB
Line 
1#This installs the Android SDK (Software Development Kit)
2#which is needed for the compilation of the Java project.
3
4step=3;
5
6#Different steps here.
7#1: install sdk, ant and sdk tools
8#2: install an emulator.
9#3: test the emulator
10#4: cleanup
11
12present_dir=`pwd`;
13default_droid="Android-4.0"
14
15if [[ $step == "1" ]]; then
16
17 #Cleanup the install
18 rm -rf install-sdk install-ant
19
20 # Install Android SDK and NDK.
21 unzip -o android-sdk-r16-macosx.zip
22 unzip -o apache-ant-1.8.2-bin.zip
23
24 #Move to install
25 mv android-sdk-macosx install-sdk
26 mv apache-ant-1.8.2 install-ant
27
28 #Post_install configuration:
29 #We need specific settings for specific platforms, for the SDK to
30 #function properly
31
32 #For now, we need to install:
33 #android sdk platform tools
34 #and a specific android api: API 15
35 #Note: API 15 corresponds to Android 4.0.3
36
37 cd install-sdk/tools/ && source ./android update sdk -t platform-tools,android-15,android-14,system-image --no-ui
38
39fi
40
41if [[ $step == "2" ]]; then
42
43 #Once this is done, we need to install an emulator. Location will default to ~/.android/avd,
44 #which we will move to $ISSM_TIER/externalpackages/android-emulators.
45 #For now, it's called: Android-4.0.3
46
47
48 #Here we delete the Android-4.0.3 device if it already exists.
49 cd $present_dir/install-sdk/tools
50
51 if [ -e $ANDROID_DIR/android-emulators/$default_droid ]
52 then
53 echo "Deleting previously created device: $default_droid"
54 ./android delete avd -n $default_droid
55 fi
56
57 #Android will prompt the user to specify hardware emulation options. For now, default
58 #default settings will suffice. Press 'enter' to take default settings or enter 'no'.
59
60 ./android create avd -f -n $default_droid -t 1 -p $ANDROID_DIR/android-emulators/$default_droid --abi armeabi-v7a
61fi
62
63if [[ $step == "3" ]]; then
64 #Here we will start up our default emulator to test that it is working properly.
65 #Once the device has booted we will use the Android Debug Bridge tool to gain
66 #a terminal in our device.
67
68 cd $present_dir/install-sdk/tools
69 ./emulator -avd $default_droid -sdcard $ANDROID_DIR/android-emulators/test &
70
71 cd ../platform-tools
72 ./adb wait-for-device shell
73
74fi
75
76if [[ $step == "4" ]]; then
77 rm -rf install-sdk install-ant
78fi
Note: See TracBrowser for help on using the repository browser.