【发布时间】:2014-12-01 13:35:22
【问题描述】:
我正在开发以下在我的机器上运行良好的 AppleScript
tell application "iPhone Simulator" to activate
tell application "System Events" to keystroke "h" using {command down, shift down}
tell application "System Events" to keystroke "h" using {command down, shift down}
tell application "System Events"
set _position to position of window 1 of process "iOS Simulator"
set _size to size of window 1 of process "iOS Simulator"
set _x to item 1 of _position
set _y to item 2 of _position
set _width to item 1 of _size
set _height to item 2 of _size
set _coord_x to (_x + _width / 2) as integer
set _coord_y to (_y + _height / 2) as integer
do shell script "cliclick c:" & _coord_x & "," & _coord_y
end tell
不幸的是,当我在另一台机器上执行该脚本时,即使启动了 iPhone 模拟器,第一行也会引发以下错误:
error "File iPhone Simulator wasn’t found." number -43 from current application
两台机器都运行相同版本的 Xcode (6.1) 和相同的模拟器 (iPhone / iOS 7.1)
知道为什么找不到应用程序 iPhone Simulator 吗?
【问题讨论】: