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

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

SDK Install script now pushes issm.exe to the device, changes permissions and runs the executable.

  • Property svn:executable set to *
File size: 2.9 KB
RevLine 
[11673]1#This installs the Android SDK (Software Development Kit)
2#which is needed for the compilation of the Java project.
3
[12227]4step=3;
[11673]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`;
[11989]13default_droid="Android-4.0"
[12227]14sd_card="issm-sdcard"
[11673]15
16if [[ $step == "1" ]]; then
17
18 #Cleanup the install
19 rm -rf install-sdk install-ant
20
[12189]21 #Download from ISSM server
22 $ISSM_DIR/scripts/DownloadExternalPackage.py 'http://issm.jpl.nasa.gov/files/externalpackages/android-sdk-r16-macosx.zip' 'android-sdk-r16-macosx.zip'
23 $ISSM_DIR/scripts/DownloadExternalPackage.py 'http://issm.jpl.nasa.gov/files/externalpackages/apache-ant-1.8.2-bin.zip' 'apache-ant-1.8.2-bin.zip'
24
[11673]25 # Install Android SDK and NDK.
26 unzip -o android-sdk-r16-macosx.zip
27 unzip -o apache-ant-1.8.2-bin.zip
28
29 #Move to install
30 mv android-sdk-macosx install-sdk
31 mv apache-ant-1.8.2 install-ant
32
33 #Post_install configuration:
34 #We need specific settings for specific platforms, for the SDK to
35 #function properly
36
37 #For now, we need to install:
38 #android sdk platform tools
[11718]39 #and a specific android api: API 15
40 #Note: API 15 corresponds to Android 4.0.3
[11673]41
[11925]42 cd install-sdk/tools/ && source ./android update sdk -t platform-tools,android-15,android-14,system-image --no-ui
[11718]43
[11673]44fi
45
46if [[ $step == "2" ]]; then
47
48 #Once this is done, we need to install an emulator. Location will default to ~/.android/avd,
[12156]49 #which we will move to $ISSM_DIR/externalpackages/android-emulators.
[11673]50 #For now, it's called: Android-4.0.3
51
[11718]52 #Here we delete the Android-4.0.3 device if it already exists.
[11673]53 cd $present_dir/install-sdk/tools
54
[12097]55 if [ -e $ANDROID_DIR/android-emulators/$default_droid ]
[11826]56 then
57 echo "Deleting previously created device: $default_droid"
58 ./android delete avd -n $default_droid
59 fi
60
[11718]61 #Android will prompt the user to specify hardware emulation options. For now, default
62 #default settings will suffice. Press 'enter' to take default settings or enter 'no'.
63
[12097]64 ./android create avd -f -n $default_droid -t 1 -p $ANDROID_DIR/android-emulators/$default_droid --abi armeabi-v7a
[12227]65 echo "Creating an SD Card"
66 ./mksdcard -l $sd_card 2G $ANDROID_DIR/android-emulators/$sd_card.img
[11673]67fi
68
69if [[ $step == "3" ]]; then
[11968]70 #Here we will start up our default emulator to test that it is working properly.
[11925]71 #Once the device has booted we will use the Android Debug Bridge tool to gain
72 #a terminal in our device.
73
[11718]74 cd $present_dir/install-sdk/tools
[12227]75 ./emulator -avd $default_droid -sdcard $ANDROID_DIR/android-emulators/$sd_card.img &
[11968]76
[11925]77 cd ../platform-tools
[12227]78 ./adb wait-for-device shell mount -o rw,remount -t yaffs2 /dev/block/mtdblock1 /system
79 #./adb wait-for-device shell
80 ./adb push $ISSM_TIER/src/c/issm.exe /data/issm.exe
81 ./adb shell chmod 777 /data/issm.exe
82 ./adb shell /data/issm.exe
[11673]83fi
84
85if [[ $step == "4" ]]; then
86 rm -rf install-sdk install-ant
87fi
Note: See TracBrowser for help on using the repository browser.