-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy path.setup_sim.sh
executable file
·44 lines (36 loc) · 1.57 KB
/
.setup_sim.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
#!/bin/bash
# Let's create new simulator.
if [ "$1" == "name=iPad Air 2,OS=10.2" ]
then
SIM_UUID=`xcrun simctl create assets-vc-ipad-ios10 com.apple.CoreSimulator.SimDeviceType.iPad-Air-2 com.apple.CoreSimulator.SimRuntime.iOS-10-2`
elif [ "$1" == "name=iPhone 6,OS=10.2" ]
then
SIM_UUID=`xcrun simctl create assets-vc-iphone-ios10 com.apple.CoreSimulator.SimDeviceType.iPhone-6 com.apple.CoreSimulator.SimRuntime.iOS-10-2`
elif [ "$1" == "name=iPhone 6,OS=11.0" ]
then
SIM_UUID=`xcrun simctl create assets-vc-iphone-ios11 com.apple.CoreSimulator.SimDeviceType.iPhone-6 com.apple.CoreSimulator.SimRuntime.iOS-11-0`
elif [ "$1" == "name=iPhone 6,OS=9.3" ]
then
SIM_UUID=`xcrun simctl create assets-vc-iphone-ios9 com.apple.CoreSimulator.SimDeviceType.iPhone-6 com.apple.CoreSimulator.SimRuntime.iOS-9-3`
else
SIM_UUID=`xcrun simctl create assets-vc-iphone-ios8 com.apple.CoreSimulator.SimDeviceType.iPhone-6 com.apple.CoreSimulator.SimRuntime.iOS-8-4`
fi
sleep 5
# To add a photo you need to load the simulator
xcrun simctl boot $SIM_UUID
sleep 5
# Let's add some assets to a newly created simulator.
xcrun simctl addmedia booted ./Media/a.JPG
sleep 2
xcrun simctl addmedia booted ./Media/a.JPG
sleep 2
xcrun simctl addmedia booted ./Media/a.JPG
sleep 2
xcrun simctl addmedia booted ./Media/a.JPG
sleep 2
xcrun simctl addmedia booted ./Media/a.JPG
# I had trouble running tests if simulator was previously booted,
# so let's make Xcode happy and shutdown the sim.
xcrun simctl shutdown $SIM_UUID
# Let's return UUID of just created sim so it can be used outside of the script.
echo $SIM_UUID