

echo no | $tools/avdmanager create avd -force -name MyAVD -abi google_apis/$arch -package "$package" echo yes | $tools/sdkmanager -licensesĬreate AVD. $tools/sdkmanager "$package"Īccept the licenses. Package="system-images android-23 google_apis $arch"Įnsure Android-image's downloaded.

tools=$ANDROID_HOME/cmdline-tools/latest/bin Also you can use Script Editor to save it as a native macos app: select File on the menu, press and hold the ⌥ (Option) key, select Save As and then select File Format: Application.įor automation (CI) we did something like below steps:įrist, find SDK's tools location, and store in variable for later use. The script above can also be run from the Script Editor.app or from Automator.app (the bit between the single quotes). Print(f'SDK emulator dir: )ĭo shell script "~/Library/Android/sdk/emulator/emulator -avd " & avd & " -no-boot-anim > /dev/null 2>&1 &" #!/usr/bin/env python3Īndroid_emulator_dir: Path = Path(os.environ or os.environ) / 'emulator'Įmulator_dir = android_emulator_dir.absolute() Requires python3 ( at least v3.4) and a valid environment variable ANDROID_HOME or ANDROID_SDK pointing to the Android SDK dir. HelloWorld, and it will work too.Ī launcher script which lists existing AVDs and lets you pick the one you want. As a commenter suggested, you can also replace in the line above with just. For example: adb shell am start -a -n /. Or, as an alternative, you can use the following command: adb shell am start -a -n /. Now switch to emulator and launch your application like on any normal device, through the launcher.However, you can install the application manually using command adb install. Usually during development you just use the same Ant script you used to build the project, just select install target. Now you have to install the application to your AVD.

You can read about additional options here. Wait until the emulator fully loads, it takes some time.
