【问题标题】:File iPhone Simulator wasn't found找不到文件 iPhone 模拟器
【发布时间】: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 吗?

【问题讨论】:

    标签: applescript ios-simulator


    【解决方案1】:

    它现在被称为“iOS 模拟器”而不是“iPhone 模拟器”。我建议你把第一行改成:

    tell application "iOS Simulator" to activate
    

    【讨论】:

    • 好的。将尝试并回复您。你知道这个变化是什么时候引入的吗?因为它在我的带有 Xcode 6.1 的 Mac 上可以正常使用 iPhone Simulator,但它会在另一台具有几乎相同设置的机器上抛出错误。
    • Xcode 6.0 中更改了名称。如果它在您的一个使用 Xcode 6.1 的系统上运行,我怀疑它在某个地方找到了旧版本。您应该检查实际运行的内容。
    猜你喜欢
    • 1970-01-01
    • 2012-04-05
    • 1970-01-01
    • 2012-02-03
    • 2012-02-22
    • 2015-01-08
    • 1970-01-01
    • 2013-01-30
    • 1970-01-01
    相关资源
    最近更新 更多