Last active
May 19, 2022 06:59
-
-
Save GrayedFox/7b079c54e416d8f7ea82c66ea0ce8d9d to your computer and use it in GitHub Desktop.
AppCenter Post Build Script for running XCUI Tests
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# this script assumes you have added an API token via AppCenter and stored it | |
# as an environment variable in your build configuration settings | |
# see https://docs.microsoft.com/en-us/appcenter/test-cloud/frameworks/xcuitest/#build-for-testing | |
# for a better understanding of what's going on | |
SCHEME="schemeOfApplicationUnderTest" | |
APP="appleUserName/appName" | |
DEVICES="appCenterTestDevices" | |
TEST_SERIES="appCenterTestSeriesName" | |
LOCALE="en_US" | |
# Post Build Script run by AppCenter which launches XCUI Tests | |
if [ "$AGENT_JOBSTATUS" == "Succeeded" ]; then | |
# build the AUT scheme, removing any old DerivedData first | |
rm -rf DerivedData | |
xcrun xcodebuild -allowProvisioningUpdates build-for-testing \ | |
-configuration Debug \ | |
-sdk iphoneos \ | |
-scheme $SCHEME \ | |
-derivedDataPath DerivedData | |
# submit the test command to AppCenter | |
appcenter test run xcuitest \ | |
--app $APP \ | |
--devices $DEVICES \ | |
--test-series $TEST_SERIES \ | |
--locale $LOCALE \ | |
--build-dir "$APPCENTER_SOURCE_DIRECTORY/DerivedData/Build/Products/Debug-iphoneos/" \ | |
--token $APPCENTER_TOKEN \ | |
--async | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment