Skip to content

Commit ab6b4ae

Browse files
committed
chore(scripts): add Android emulator launcher
1 parent 54878c0 commit ab6b4ae

1 file changed

Lines changed: 21 additions & 0 deletions

File tree

scripts/start-android-emulator.sh

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/usr/bin/env bash
2+
# Start the local Android emulator used for testing pythonnative apps.
3+
#
4+
# Usage:
5+
# ./scripts/start-android-emulator.sh [avd-name]
6+
#
7+
# Defaults to the "Medium_Phone" AVD. List available AVDs with:
8+
# ~/Library/Android/sdk/emulator/emulator -list-avds
9+
10+
set -euo pipefail
11+
12+
AVD_NAME="${1:-Medium_Phone}"
13+
EMULATOR_BIN="${ANDROID_SDK_ROOT:-$HOME/Library/Android/sdk}/emulator/emulator"
14+
15+
if [[ ! -x "$EMULATOR_BIN" ]]; then
16+
echo "Error: emulator binary not found at $EMULATOR_BIN" >&2
17+
echo "Set ANDROID_SDK_ROOT or install the Android SDK emulator." >&2
18+
exit 1
19+
fi
20+
21+
exec "$EMULATOR_BIN" -avd "$AVD_NAME"

0 commit comments

Comments
 (0)