#!/bin/sh

DEVICE_ID=(
  "6D453008-9A78-4716-B18F-E68FB2325C7A"
) # use "xcrun simctl list" to get full devices list
APP_ARCHIVE_PATH="apollogo-c26921ef-c2ae-44a8-a29c-267b216e4b1c-simulator.tar.gz"
APP_PATH="apollogo.app"
APP_IDENTIFIER="com.sonymusic.apollogo"

open /Applications/Xcode.app/Contents/Developer/Applications/Simulator.app/

tar -xvzf $APP_ARCHIVE_PATH
xattr -cr $APP_PATH

xcrun simctl shutdown all
xcrun simctl erase all

for item in ${DEVICE_ID[*]}; do
  xcrun simctl boot $item
  xcrun simctl install $item $APP_PATH
  xcrun simctl launch $item $APP_IDENTIFIER
done
