Skip to content

Instantly share code, notes, and snippets.

@wangyung
Last active April 4, 2017 03:28
Show Gist options
  • Save wangyung/c3b6626c7f8568195843c47ae8dfa06c to your computer and use it in GitHub Desktop.
Save wangyung/c3b6626c7f8568195843c47ae8dfa06c to your computer and use it in GitHub Desktop.
Start android emulator
#!/bin/bash
#stop emulator
process=`ps -ef | awk '/[e]mulator/{print $2}'`
for i in $process; do
kill -9 $i;
done
#launch emulator
$ANDROID_SDK_PATH/tools/emulator -avd hudson_ja-JP_240_480x640_android-21_armeabi-v7a_creators-market -no-window &
#wait for emulator bootup
booted=`$ANDROID_SDK_PATH/platform-tools/adb shell getprop sys.boot_completed | tr -d '\r'`
while [ "$booted" != 1 ]; do
echo "emulator is not booted, waiting 3 sec"
sleep 3
booted=`$ANDROID_SDK_PATH/platform-tools/adb shell getprop sys.boot_completed | tr -d '\r'`
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment