realm-js/tests/react-test-app/run-android.sh
Nabil Hachicha b9706b1e80 Nh/fixes 740 (#743)
* Fix Android testing CI job, we don't use the packager since we build the Release bundle
* Test run on Docker-cph-01 or Docker-cph-02
2016-12-20 19:01:45 +00:00

35 lines
815 B
Bash
Executable File

#!/bin/bash
set -o pipefail
set -e
PATH="/opt/android-sdk-linux/platform-tools:$PATH"
if [ -n "$REALM_BUILD_ANDROID" ]; then
echo "Realm is already installed" # by inoking test.sh previously for example
else
# Inform the prepublish script to build Android modules.
REALM_BUILD_ANDROID=1 npm install realm realm-tests
fi
cp ../../src/object-store/tests/query.json node_modules/realm-tests/query-tests.json
echo "Uninstalling old apk"
adb uninstall io.realm.react.testapp || true
echo "Reversing port for physical device"
adb reverse tcp:8081 tcp:8081
echo "Building Release APK"
pushd android && ./gradlew assembleRelease
echo "Installing APK"
adb install app/build/outputs/apk/app-release.apk
echo "Starting the Main Activity"
adb shell am start -n io.realm.react.testapp/.MainActivity
popd