-
Notifications
You must be signed in to change notification settings - Fork 27
/
Copy pathapp_to_test.sh
executable file
·41 lines (29 loc) · 1.21 KB
/
app_to_test.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
#!/bin/sh -e
set -e
set -x
a=123
BUILD_DIR="/tmp/xcreds"
DERIVED_DATA_DIR="${BUILD_DIR}/DerivedData"
if [ "${1}" ]; then
REMOTE_MAC=$1
else
REMOTE_MAC="test.local"
fi
agvtool bump
xcodebuild -scheme "XCreds" -configuration "Release" -derivedDataPath "${DERIVED_DATA_DIR}"
ssh root@"${REMOTE_MAC}" 'bash -c "if [ -e "/Applications/XCreds.app" ] ; then echo removing; rm -rf "/Applications/XCreds.app"; fi"'
if [ -e /tmp/xcreds/xcreds.zip ]; then
rm /tmp/xcreds/xcreds.zip
fi
pushd /tmp/xcreds/DerivedData/Build/Products/Release/
zip -r /tmp/xcreds/xcreds.zip XCreds.app
popd
ssh root@"${REMOTE_MAC}" 'bash -c "if [ -e "/tmp/xcreds.zip" ] ; then echo removing; rm -rf "/tmp/xcreds.zip"; fi"'
scp -Cr /tmp/xcreds/xcreds.zip root@"${REMOTE_MAC}":/tmp/xcreds.zip
ssh root@"${REMOTE_MAC}" unzip /tmp/xcreds.zip -d /Applications
#scp -r /tmp/xcreds/DerivedData/Build/Products/Release/XCreds.app root@"${REMOTE_MAC}":/Applications
ssh root@"${REMOTE_MAC}" /Applications/XCreds.app/Contents/Resources/xcreds_login.sh -r
ssh root@"${REMOTE_MAC}" /Applications/XCreds.app/Contents/Resources/xcreds_login.sh -i
#ssh root@"${REMOTE_MAC}" killall -9 SecurityAgent || echo "unable to kill"
ssh root@"${REMOTE_MAC}" reboot
exit 0