【问题标题】:Appium [iOS] Instruments crashed on startupAppium [iOS] 仪器在启动时崩溃
【发布时间】:2016-02-06 10:20:06
【问题描述】:

也许有人可以帮助我。

当 appium 尝试运行应用程序时,屏幕会闪烁应用程序启动画面,就像 appium 尝试多次启动应用程序一样。这种行为在模拟器和真实设备上都会发生。

我在我的 iOS 设备 UI 自动化上设置了启用,但是当我尝试启动检查器时,我遇到了这个问题:

info: [debug] [INST STDERR] 2015-11-05 15:11:05.082 instruments[1495:39489] WebKit Threading Violation - initial use of WebKit from a secondary thread.
info: [debug] [INST STDERR] 2015-11-05 15:11:06.049 instruments[1495:39460] Attempting to change event horizon while disengage

error: Failed to start an Appium session, err was: Error: Instruments crashed on startup

info: [debug] [INST STDERR] 2015-11-05 15:11:06.049 instruments[1495:39462] Attempting to change event horizon while disengage
Instruments Trace Error : Target failed to run: Permission to debug com.myapp.iphone was denied. The app must be signed with a development identity (e.g. iOS Developer).
info: [IOS_SYSLOG_ROW ] Nov  5 15:11:04 tests-iPod com.apple.xpc.launchd[1] (UIKitApplication:com.myapp.iphone[0xe163][607]) <Notice>: Service exited due to signal: Killed: 9
info: [debug] [INSTSERVER] Instruments exited with code 253
info: [debug] Killall instruments
info: [debug] Instruments crashed on startup
info: [debug] We exceeded the number of retries allowed for instruments to successfully start; failing launch
info: [debug] Stopping iOS log capture
info: [debug] Reset not set, not ending sim or cleaning up app state
info: [debug] Cleaning up appium session
info: [debug] Error: Instruments crashed on startup
    at [object Object].Instruments.onInstrumentsExit (/Applications/Appium.app/Contents/Resources/node_modules/appium/submodules/appium-instruments/lib/instruments.js:440:31)
    at [object Object].<anonymous> (/Applications/Appium.app/Contents/Resources/node_modules/appium/submodules/appium-instruments/lib/instruments.js:353:12)
    at ChildProcess.emit (events.js:110:17)
    at Process.ChildProcess._handle.onexit (child_process.js:1074:12)
info: [debug] Responding to client with error: {"status":33,"value":{"message":"A new session could not be created. (Original error: Instruments crashed on startup)","origValue":"Instruments crashed on startup"},"sessionId":null
info: <-- POST /wd/hub/session 500 33841.937 ms - 182}

应用程序的格式为 .ipa

谢谢, 最好的问候。

【问题讨论】:

  • 能否请您添加您的测试脚本、json 配置和 testNG.xml(或您正在使用的任何内容)。谢谢
  • 现在它在没有脚本的情况下发生。当我尝试启动 UI 检查器时会发生这种情况。

标签: ios automation appium qa


【解决方案1】:
Target failed to run: Permission to debug com.myapp.iphone was denied. 
The app must be signed with a development identity (e.g. iOS Developer).

您的应用程序应使用开发人员密钥进行签名。 Click here for documentation

【讨论】:

【解决方案2】:

如果您使用的是 iOS 模拟器,请执行以下操作...

在Appium中,进入Developer Settings,勾选Custome Server Flags并写入--native-instruments-lib 在文本框中。

现在启动 Appium 服务器。

希望这会有所帮助!

【讨论】:

    【解决方案3】:

    BlockquoteTarget 运行失败:调试 com.myapp.iphone 的权限被拒绝。 该应用程序必须使用开发身份(例如 iOS 开发人员)进行签名。 块引用

    您应该在创建 .ipa 时提供您的开发者身份...

    如果你是通过终端创建 ipa 文件,你可以点击给定的链接 [博客]:Xcode "Build and Archive" from command line

    【讨论】:

      【解决方案4】:

      我也遇到过这个问题,发现你需要在你的iDevice的开发者选项中启用UI自动化

      如何启用 UI 自动化 1.关闭iDevice, 2.然后连接到运行Xcode的Mac 3.在将其重新打开以显示开发人员选项之前。 4. 点击开发者选项并启用 UI 自动化

      【讨论】:

        【解决方案5】:

        在我的例子中,以下命令让我的生活陷入困境:

        rm -rf $HOME/Library/Developer/Xcode/iOS\ DeviceSupport/*
        

        所以不要将它添加到构建步骤中。

        要解决此问题: 重启设备 > 运行 Xcode > 连接设备 > 构建并运行应用程序 > 停止并退出 Xcode

        现在验证启动应用程序不会导致仪器崩溃。

        【讨论】:

          猜你喜欢
          • 2015-03-07
          • 2016-06-08
          • 2016-12-09
          • 1970-01-01
          • 2016-04-08
          • 2015-08-02
          • 2018-03-07
          • 1970-01-01
          相关资源
          最近更新 更多