它实际上比我想象的要简单。这AppleScript
让一些痛苦Xcode
:
tell application "Xcode"
activate
end tell
tell application "System Events"
tell application process "Xcode"
click menu item "1st iDevice Name" of menu 1 of menu item "Destination" of menu 1 of menu bar item "Product" of menu bar 1
click menu item "Run" of menu 1 of menu bar item "Product" of menu bar 1
delay 5
click menu item "2nd iDevice Name" of menu 1 of menu item "Destination" of menu 1 of menu bar item "Product" of menu bar 1
click menu item "Run" of menu 1 of menu bar item "Product" of menu bar 1
delay 5
click menu item "iPhone 6.1 Simulator" of menu 1 of menu item "Destination" of menu 1 of menu bar item "Product" of menu bar 1
click menu item "Run" of menu 1 of menu bar item "Product" of menu bar 1
end tell
end tell
- 将以上内容另存
AppleScript
为.app
. (delay
根据您的机器自定义 s。)
- 创建一个新
Service
的Automator
:从上一步中选择Launch Application
并选择。.app
- 从上一步保存
Service
并给它一个键盘快捷键。提示:避免使用快捷键^,因为它会弹出这个对话框:
诚然,这并不是严格意义上的同时“构建和运行”,但它确实胜过在目的地之间手动进行琐事。