react-native/scripts/run-android-emulator.sh
Héctor Ramos 2472d915ab Consolidate CI/local test scripts
Summary:
Update `scripts/run-android-emulator.sh` to use same settings as Circle CI when creating and launching an AVD. This helps provide a known good configuration, useful for running Android tests locally.

Run `scripts/run-android-emulator.sh` and confirm AVD is created && launched
Run `scripts/run-android-emulator.sh` again and see message about AVD already running
Run `test_android` on CI and observe AVD is launched.

Run `runXcodeTests.sh` and confirm unit tests run.
Run CI and confirm iOS unit tests run.

[GENERAL][MINOR][`scripts`] - Consolidate CI/local test scripts
Closes https://github.com/facebook/react-native/pull/19228

Differential Revision: D8019888

Pulled By: hramos

fbshipit-source-id: 28b12c2e781ee80bcc90c22e691a5acb16232369
2018-05-15 17:27:52 -07:00

26 lines
692 B
Bash
Executable File

#!/bin/bash
# Runs an Android emulator locally.
# If there already is a running emulator, this just uses that.
# The only reason to use this config is that it represents a known-good
# virtual device configuration.
# This is useful for running integration tests on a local machine.
THIS_DIR=$(dirname "$0")
STATE=`adb get-state`
if [ -n "$STATE" ]; then
echo "An emulator is already running."
exit 1
fi
echo "Installing packages"
source "${THIS_DIR}/android-setup.sh" && getAndroidPackages
echo "Creating Android virtual device..."
source "${THIS_DIR}/android-setup.sh" && createAVD
echo "Launching Android virtual device..."
source "${THIS_DIR}/android-setup.sh" && launchAVD