Files
ImageViewer/run.sh

25 lines
691 B
Bash
Executable File

#!/bin/sh
APP_NAME='ImageViewer'
SIM_DEVICE='iPad Air 11-inch (M3)'
SCHEME='ImageViewer'
DERIVED_DATA="./build"
SIMULATOR='iOS Simulator'
COMPANY='ImageViewer'
sudo bash -c "echo '127.0.0.1 developerservices2.apple.com' >>/etc/hosts"
# Boot and launch simulator
xcrun simctl boot "$SIM_DEVICE"
open -a Simulator
# Build app
xcodebuild -scheme "$SCHEME" -derivedDataPath "$DERIVED_DATA" -destination "platform=$SIMULATOR,name=$SIM_DEVICE"
# Install and launch
APP_PATH="$DERIVED_DATA/Build/Products/Debug-iphonesimulator/$APP_NAME.app"
xcrun simctl install booted "$APP_PATH"
xcrun simctl launch booted "$COMPANY.$APP_NAME"
sudo sed -i '' '/developerservices2\.apple\.com/d' /etc/hosts