1#!/usr/bin/env bash 2 3set -e 4 5CURR_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd -P)" 6cd "${CURR_DIR}/../android" 7 8echo '' 9echo ' Installing APKs' 10adb install -r app/build/outputs/apk/release/app-release.apk 11adb install -r app/build/outputs/apk/androidTest/release/app-release-androidTest.apk 12 13echo '' 14echo ' Starting instrumentation tests' 15LOG_FILE="${CURR_DIR}/../artifacts/instrumentation.log" 16LOG_DIR=$(dirname "$LOG_FILE") 17if [[ ! -d "${LOG_DIR}" ]]; then 18 mkdir -p "${LOG_DIR}" 19fi 20adb shell am instrument -w -e debug false -e class dev.expo.payments.BareExpoTestSuite dev.expo.payments.test/androidx.test.runner.AndroidJUnitRunner 2>&1 | tee "${LOG_FILE}" 21# Propagate instrumentation result to exit code 22cat "${LOG_FILE}" | grep -e '^OK (.* tests)$' > /dev/null 23