Skip to content

Instantly share code, notes, and snippets.

@andersu
Last active January 30, 2022 11:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andersu/7cbd560e744637e0aac71761c429141f to your computer and use it in GitHub Desktop.
Save andersu/7cbd560e744637e0aac71761c429141f to your computer and use it in GitHub Desktop.
Create emulator for snapshot testing
if [ ! -d "$ANDROID_HOME" ] ; then
echo "Cannot find \$ANDROID_HOME."
exit
fi
if [ ! -d "$ANDROID_HOME/cmdline-tools" ]; then
echo "Cannot find Android SDK Command-line Tools. Install them via SDK Manager > SDK Tools."
exit
fi
if [[ $(uname -m) == 'arm64' ]]; then
ARCHITECTURE='arm64-v8a'
else
ARCHITECTURE=$(uname -m)
fi
echo "Creating emulator with architecture: $ARCHITECTURE"
"$ANDROID_HOME/cmdline-tools/latest/bin/avdmanager" "--verbose" "create" "avd" "--force" "--name" "snappy" "--device" "pixel" "--package" "system-images;android-30;google_apis;$ARCHITECTURE" "--tag" "google_apis" "--abi" "$ARCHITECTURE" "--sdcard" "512M"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment