-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbootstrap.sh
More file actions
executable file
·84 lines (50 loc) · 1.41 KB
/
bootstrap.sh
File metadata and controls
executable file
·84 lines (50 loc) · 1.41 KB
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
# Author mxl
# 异常情况退出shell
set -e
export PATH=$PATH:/usr/local/bin
if [[ -n $1 ]]; then
#statements
echo -e "\033[31m-----请加上电脑密码作为参数运行(ex:./autoJumpStep1 password)----\033[0m"
exit 1
fi
auto_jump_root_path="/Users/${USER}/Desktop/autoscripts"
LOGS_DIR=${auto_jump_root_path}/logs
if [ ! -d $LOGS_DIR ]; then
mkdir $LOGS_DIR
fi
STDOUT_FILE=$LOGS_DIR/bootstrap.log
echo "${auto_jump_root_path}"
auto_jump_path="${auto_jump_root_path}/xl_jump_root_path"
if [[ ! -d "${auto_jump_path}" ]]; then
mkdir "${auto_jump_path}"
fi
cd ${auto_jump_path}
#
wda_path="${auto_jump_path}/WebDriverAgent"
if [[ ! -d "${wda_path}" ]]; then
# git clone https://github.com/facebook/WebDriverAgen
echo -e "\033[32m-----${wda_path}-----\033[0m"
echo -e "\033[32m-----wda下载完成-----\033[0m"
fi
if [[ ! -d "${wda_path}" ]]; then
echo -e "\033[31m-----wda下载失败-----\033[0m"
exit 1
fi
cd ${wda_path}
# ./Scripts/bootstrap.sh
# echo -n "输入电脑密码:?"
# read answer
# if echo "$answer" | grep -iq "^" ;then
# echo Yes
# else
# echo No
# fi
# echo -n "输入电脑密码:"
# read name
PASSWORD="$1"
security unlock-keychain -p $PASSWORD ~/Library/Keychains/login.keychain
# 获取设备的UDID
UDID=$(idevice_id -l | head -n1)
# ideviceinfo -s
# 运行测试
xcodebuild -project WebDriverAgent.xcodeproj -scheme WebDriverAgentRunner -destination "id=$UDID" test