forked from randr0id/android-docker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstart-test-emulator.sh
executable file
·30 lines (24 loc) · 1.08 KB
/
start-test-emulator.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/usr/bin/env bash
android=26
abi='x86'
avd_name='android_ci_test'
usage="$(basename "$0") [-h] [-a android] [-b abi] [-n name] -- Create and start an Android emulator.
where:
-h: Show this help text
-a: Specify the emulator Android API (default: ${android})
-b: Specify the emulator ABI (default: ${abi})
-n: Specify the emulator name (default: ${avd_name})"
while getopts ':ha:b:n:' option; do
case "${option}" in
h) echo "${usage}"
exit ;;
a) android=${OPTARG} ;;
b) abi=${OPTARG} ;;
n) avd_name=${OPTARG} ;;
esac
done
echo "Starting Android emulator ${avd_name} with API ${android} and ABI ${abi}"
${ANDROID_HOME}/tools/bin/sdkmanager "system-images;android-${android};google_apis;${abi}"
${ANDROID_HOME}/tools/bin/avdmanager delete avd -n ${avd_name}
echo "no" | ${ANDROID_HOME}/tools/bin/avdmanager create avd -f -n ${avd_name} -b "google_apis/${abi}" -k "system-images;android-${android};google_apis;${abi}"
echo "no" | ${ANDROID_HOME}/tools/emulator @${avd_name} -wipe-data -no-audio -no-window -verbose & ${BASH_SOURCE%/*}/wait-for-emulator.sh