場景 :ssh 連接服務器要求輸入密碼
然后切換文件夾继谚,使用命令ios-ipa-server
吏恭,開啟下載ipa的服務
tell application "Terminal"
-- 終端執(zhí)行命令
do script "ssh devops@我們的CentOS服務器IP地址"
delay 0.8
tell application "System Events"
tell process "Terminal"
--活躍窗口愁茁,靠前來
set frontmost to true
keystroke "ssh連接CentOS服務器時需要的密碼"
keystroke return
-- 這里我們切換到所有文件夾
keystroke "cd 一個文件夾名字而已/"
keystroke return
-- 真實的場景是我還得切換一下课蔬,這個文件夾下面有我們已經(jīng)打好的ipa
keystroke "cd 一個文件夾名字而已/"
keystroke return
-- screen ssh斷開后執(zhí)行后臺任務的工具 得安裝一下
-- 殺掉所有screen的后臺進程贬循,以便重新更新ios-ipa-server
keystroke "pkill screen"
keystroke return
delay 1
--開啟虛擬終端,這樣我們電腦關了terminal凛驮,服務器也能在后臺繼續(xù)執(zhí)行ios-ipa-server
keystroke "screen -S lammps"
keystroke return
delay 1
-- 用ios-ipa-server設置一下ip,因為不設置使用默認的打不開黔夭,當然在OSX上自動設置是可以的
keystroke "ios-ipa-server --ip 我們的CentOS服務器IP地址"
keystroke return
delay 1
--調(diào)起谷歌
tell application "Google Chrome"
--如果沒有運行本姥,就運行
if it is not running then
activate
end if
set activeIndex to get active tab index of window 1
tell window 1
-- 新開tab 打開下載頁面查看是否開啟ios-ipa-server成功婚惫,也好方便把地址復制給測試人員下載
set newTab to make new tab with properties {URL:"https://我們的CentOS服務器IP地址:1234/download"}
end tell
end tell
end tell
end tell
end tell