Skip to content

Instantly share code, notes, and snippets.

@songxing10000
Created September 14, 2017 15:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save songxing10000/47c9f8436fea8674623e184892d3e1aa to your computer and use it in GitHub Desktop.
Save songxing10000/47c9f8436fea8674623e184892d3e1aa to your computer and use it in GitHub Desktop.
uploadIpaToServerUseSSH
set appName to "Terminal"
set appID to bundle identifier of (info for (path to application appName))
set theFolder to choose folder
tell application "Finder"
set fileList to every file of theFolder --whose name extension is "ipa"
if (count of fileList) > 0 then
repeat with theFile in fileList
set fileName to name of theFile
tell application "Terminal"
if it is not running then
activate
end if
end tell
tell application "System Events"
tell application process "Terminal"
tell application "System Events"
set visible of process appName to true
set frontmost of process appName to true
end tell
keystroke "1" using command down
delay 1
keystroke fileName
keystroke return
end tell
end tell
end repeat
else
set alertTitle to "当前目录没有找到ipa文件"
set okBtnName to "好的,我再找找"
display dialog alertTitle buttons {okBtnName} default button okBtnName
end if
end tell
--tell application "Terminal"
--activate
--do script "ssh user@server.com"
-- // write user's password
-- // write some linux commands to remote server
--end tell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment