OLD | NEW |
1 #!/bin/sh | 1 #!/bin/sh |
2 | 2 |
3 set -e | 3 set -e |
4 | 4 |
5 SDK_PATH=/home/vagrant/android-sdk-linux | 5 SDK_PATH=/home/vagrant/android-sdk-linux |
6 ADB=$SDK_PATH/platform-tools/adb | 6 ADB=$SDK_PATH/platform-tools/adb |
7 EMULATOR=$SDK_PATH/tools/emulator | 7 EMULATOR=$SDK_PATH/tools/emulator |
8 AVD_ID="android-arm" | 8 AVD_ID="$2" |
9 | 9 |
10 stop_emulator () { | 10 stop_emulator () { |
11 # Check for running emulator an kill it safely | 11 # Check for running emulator an kill it safely |
12 EPID=`pgrep emulator || true` | 12 EPID=`pgrep emulator || true` |
13 if [ ! -z "$EPID" ]; then | 13 if [ ! -z "$EPID" ]; then |
14 echo "Stopping emulator..." | 14 echo "Stopping emulator..." |
15 kill $EPID | 15 kill $EPID |
16 wait $EPID || true | 16 wait $EPID || true |
17 echo "Done." | 17 echo "Done." |
18 else | 18 else |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 echo "1" | 51 echo "1" |
52 else | 52 else |
53 echo "0" | 53 echo "0" |
54 fi | 54 fi |
55 ;; | 55 ;; |
56 *) | 56 *) |
57 echo "Usage: $0 {start|stop|restart|status}" | 57 echo "Usage: $0 {start|stop|restart|status}" |
58 exit 1 | 58 exit 1 |
59 ;; | 59 ;; |
60 esac | 60 esac |
OLD | NEW |