-
Notifications
You must be signed in to change notification settings - Fork 3
/
install_app.sh
50 lines (37 loc) · 1.22 KB
/
install_app.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
44
45
46
47
48
49
50
#!/bin/bash
DST_DIR='/Applications'
APP_NAME='JBCall.app'
USER='root'
PASSWD='mypass'
IP='10.231.65.56'
PROFILE_NAME='iPhone Developer: FirstName SecondName (XXXXXXXXXX)'
APP_ON_MAC="/Users/username/Library/Developer/Xcode/DerivedData/JBCall-cktasembftvbmqaaiiunvljdwocs/Build/Products/Debug-iphoneos/JBCall.app"
echo "Uploading file"
echo "FROM:" $SRC_DIR
echo "TO :" $DST_DIR
echo "====== [ Installin App ] ======"
echo "IP : " $ip
echo "Remote dir: " $DST_DIR
echo "Local dir: " $APP_NAME
echo "Mac dir: " $APP_ON_MAC
echo "============================="
# Clear temp directory
echo "Deleting local directory: $APP_NAME"
rm -fr $APP_NAME
echo "Copy..."
echo "From: $APP_ON_MAC"
echo "To : $APP_NAME"
## Copy the app file to temp directory
cp -Rf "$APP_ON_MAC" "$APP_NAME"
echo "Copy is done."
echo "Singing app..."
codesign --sign="$PROFILE_NAME" --entitlements entitlements.xml $APP_NAME
echo "Singing is done"
echo "Uploading files on device..."
sshpass -p $PASSWD scp -r $APP_NAME $USER@$IP:$DST_DIR
echo "Uploading is finished!"
echo "Refresing UI on device..."
sshpass -p $PASSWD ssh $USER@$IP su mobile -c uicache 1>/dev/null 2>&1
echo "Clean up. Deleting directory: $APP_NAME"
rm -fr $APP_NAME
echo "Done"