-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathsetup
executable file
·39 lines (32 loc) · 1.21 KB
/
setup
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
#!/bin/bash
# obtain the developer team id
if [ -z "$XCODE_DEVELOPMENT_TEAM" ]; then
echo "Enter your Development Team ID (you can find it on your Apple Developer page)"
echo "This will be used to sign the executable to run on your M4 iPad"
read -p "> " DEVELOPMENT_TEAM
fi
# obtain the list of paired iPad devices
DEVICES=$(
xcrun devicectl list devices \
--filter "hardwareProperties.deviceType == 'iPad'" \
--columns "Name" \
--hide-default-columns \
--hide-headers \
| tail -n +2
)
if [ -z "$DEVICES" ]; then
>&2 echo "Error: No iPad paired with this machine. Connect an M4 or later iPad and enable the developer mode."
exit 1
fi
# Prompt the user to select an option
IFS=$'\n'
DEVICES=($DEVICES)
echo "Select a paired device to run the tests on"
select DEVICE in "${DEVICES[@]}"; do break; done
echo -e "\033[0;32mUpdating configuration in make.config\033[0m"
echo "DEVICE=$DEVICE"
echo "DEVICE=$DEVICE" > make.config
if [ -n "$DEVELOPMENT_TEAM" ]; then
echo "XCODE_DEVELOPMENT_TEAM=$DEVELOPMENT_TEAM"
echo "XCODE_DEVELOPMENT_TEAM=$DEVELOPMENT_TEAM" >> make.config
fi