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

Last change on this file since 23417 was 23417, checked in by jdquinn, 6 years ago

CHG: Converted Python download script to bash script and updated calls to it (NOTE: Still need to add certificate checking support for HTTPS connections via wget)

  • Property svn:executable set to *
File size: 2.6 KB
RevLine 
[12738]1#!/bin/bash
[11673]2
[12738]3# This installs the Android SDK (Software Development Kit)
4# which is needed for the compilation of the Java project.
[11673]5
[12738]6source $ANDROID_DIR/android_aux.sh
[11673]7
[12738]8# Different steps here.
9# 0: do all
10# 1: install sdk, ant and sdk tools
11# 2: install an emulator.
12# 3: test the emulator
13# 4: cleanup
14
[11673]15present_dir=`pwd`;
[12227]16sd_card="issm-sdcard"
[11673]17
[12738]18if [[ $step == "1" || $step == "0" ]]; then
[12579]19
[12738]20 # Cleanup the install
[14320]21 rm -rf install
[11673]22
[12738]23 # Download from ISSM server
[23417]24 $ISSM_DIR/scripts/download_external_package.bash 'https://issm.ess.uci.edu/files/externalpackages/android-sdk_r'$sdk_rev'-macosx.zip' 'android-sdk_r'${sdk_rev}'-macosx.zip'
[12189]25
[11673]26 # Install Android SDK and NDK.
[12579]27 unzip -o android-sdk_r${sdk_rev}-macosx.zip
[11673]28
[12738]29 # Move to install
[14320]30 mv -f android-sdk-macosx install
[11673]31
[12738]32 # Post_install configuration:
33 # We need specific settings for specific platforms, for the SDK to
34 # function properly
[11673]35
[12738]36 # For now, we need to install:
37 # android sdk platform tools
38 # and a specific android api: API 16, API 15 and API 14
39 # Note: API 16, API 15 and 14 correspond to Android 4.1, 4.0.3 and 4.0 respectively.
[11673]40
[14320]41 cd install/tools/ && source ./android update sdk -t platform-tool,${api_levels},system-image --no-ui
[11718]42
[11673]43fi
44
[12738]45if [[ $step == "2" || $step == "0" ]]; then
[11673]46
[12738]47 # Once this is done, we need to install an emulator. Location will default to ~/.android/avd,
48 # which we will move to $ISSM_DIR/externalpackages/android-emulators.
49 # For now, it's called: Android-4.0.3
[11673]50
[12738]51 # Here we delete the Android-4.0.3 device if it already exists.
[14320]52 cd $present_dir/install/tools
[11673]53
[12097]54 if [ -e $ANDROID_DIR/android-emulators/$default_droid ]
[11826]55 then
56 echo "Deleting previously created device: $default_droid"
57 ./android delete avd -n $default_droid
58 fi
59
[12738]60 # Android will prompt the user to specify hardware emulation options. For now, default
61 # default settings will suffice. Press 'enter' to take default settings or enter 'no'.
[11718]62
[12097]63 ./android create avd -f -n $default_droid -t 1 -p $ANDROID_DIR/android-emulators/$default_droid --abi armeabi-v7a
[12227]64 echo "Creating an SD Card"
65 ./mksdcard -l $sd_card 2G $ANDROID_DIR/android-emulators/$sd_card.img
[11673]66fi
67
[12738]68if [[ $step == "3" || $step == "0" ]]; then
69 # Here we will start up our default emulator to test that it is working properly.
70 # Once the device has booted we will use the Android Debug Bridge tool to gain
71 # a terminal in our device.
[11925]72
[14320]73 cd $present_dir/install/tools
[12227]74 ./emulator -avd $default_droid -sdcard $ANDROID_DIR/android-emulators/$sd_card.img &
[11968]75
[11925]76 cd ../platform-tools
[12607]77 ./adb wait-for-device shell
[11673]78fi
79
[12738]80if [[ $step == "4" || $step == "0" ]]; then
[14320]81 rm -rf install
[11673]82fi
Note: See TracBrowser for help on using the repository browser.