-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy pathappcenter-pre-build.sh
48 lines (35 loc) · 1.37 KB
/
appcenter-pre-build.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/usr/bin/env bash
if [ -z "$APP_CENTER_CURRENT_PLATFORM" ]
then
echo "You need define the APP_CENTER_CURRENT_PLATFORM variable in App Center with values android or ios"
exit
fi
if [ "$APP_CENTER_CURRENT_PLATFORM" == "android" ]
then
echo "Setup Android simulator"
SIMULATOR_IMAGE="system-images;android-28;google_apis;x86"
SIMULATOR_NAME="Pixel_XL_API_28"
ANDROID_HOME=~/Library/Android/sdk
ANDROID_SDK_ROOT=~/Library/Android/sdk
ANDROID_AVD_HOME=~/.android/avd
PATH="$ANDROID_HOME/tools:$ANDROID_HOME/tools/bin:$ANDROID_HOME/platform-tools:$PATH"
echo "Accepts all sdk licences"
yes | sdkmanager --licenses
echo "Download Simulator Image"
sdkmanager --install "$SIMULATOR_IMAGE"
echo "Create Simulator '$SIMULATOR_NAME' with image '$SIMULATOR_IMAGE'"
echo "no" | avdmanager --verbose create avd --force --name "$SIMULATOR_NAME" --device "pixel" --package "$SIMULATOR_IMAGE" --tag "google_apis" --abi "x86"
DETOX_CONFIG=android.emu.release
else
echo "Install AppleSimUtils"
brew tap wix/brew
brew update
brew install applesimutils
echo "Install pods "
cd ios; pod install; cd ..
DETOX_CONFIG=ios.sim.release
fi
echo "Building the project for Detox tests..."
npx detox build --configuration "$DETOX_CONFIG"
echo "Executing Detox tests..."
npx detox test --configuration "$DETOX_CONFIG" --cleanup