【问题标题】:Detox - The request was denied by service delegate (PBProcessManager) for reason: Security排毒 - 请求被服务委托 (PBProcessManager) 拒绝,原因是:安全
【发布时间】:2019-01-06 17:58:46
【问题描述】:

尝试从 Detox 7.3.4 升级到 8.1.1

它似乎是从苹果电视而不是我提供的手机加载的,即使提供--configuration

package.json:

  "detox": {
    "configurations": {
      "ios.sim.debug": {
        "binaryPath": "member/ios/build/Build/Products/Debug-iphonesimulator/MyApp.app",
        "build": "xcodebuild -workspace member/ios/MyApp.xcworkspace -scheme MyApp -configuration Debug  -sdk iphonesimulator -derivedDataPath member/ios/build",
        "type": "ios.simulator",
        "name": "iPhone 8"
      }
    }
  },

etai$npm run detox

app@0.0.1 排毒 /Users/etai/Code/data/mobile NODE_PATH=。排毒测试 -- --artifacts-location='e2e/screenshots' --record-logs all

node_modules/.bin/mocha e2e --opts e2e/mocha.opts --configuration ios.sim.debug --grep :android: --invert --record-logs all --artifacts-location "e2e/screenshots /ios.sim.debug.2018-07-30 12-55-09Z"

detox INFO: [DetoxServer.js] 服务器正在监听 localhost:49455...

排毒错误:[exec.js/EXEC_FAIL,#6]“/usr/bin/xcrun simctl io 368E25FE-3641-48F6-A47C-EA403E68EB85 screenshot“/dev/null””失败,代码 = 2,标准输出和标准错误:

排毒错误:[exec.js/EXEC_FAIL,#6]

detox ERROR: [exec.js/EXEC_FAIL, #6] 处理命令时遇到错误(domain=SimulatorKit.SimDisplayScreenshotWriter.ScreenshotError,code=2):

创建图像时出错

排毒错误:[exec.js/EXEC_FAIL, #10] "/bin/cat /dev/null

/Users/etai/Library/Developer/CoreSimulator/Devices/368E25FE-3641-48F6-A47C-EA403E68EB85/data/tmp/detox.last_launch_app_log.out 2>/Users/etai/Library/Developer/CoreSimulator/Devices/ 368E25FE-3641-48F6-A47C-EA403E68EB85 /数据/ TMP / detox.last_launch_app_log.err && SIMCTL_CHILD_DYLD_INSERT_LIBRARIES = “/用户/逸泰/库/排毒/ IOS / d01d632fc9620831ab762e463575a0528084a3af / Detox.framework /排毒” 的/ usr /斌/ xcrun simctl发射--stdout=/tmp/detox.last_launch_app_log.out --stderr=/tmp/detox.last_launch_app_log.err 368E25FE-3641-48F6-A47C-EA403E68EB85 com.myapp.MyAppDebug --args -detoxServer ws://localhost:49455 -detoxSessionId 7a268b8c-8ece-f34d-a5d3-13ed361a4b57" 失败,代码 = 1,标准输出和标准错误:

排毒错误:[exec.js/EXEC_FAIL,#10] com.myapp.MyAppDebug:-1

detox ERROR: [exec.js/EXEC_FAIL, #10] 处理命令时遇到错误(域=FBSOpenApplicationServiceErrorDomain,代码=1): 打开“com.myapp.MyAppDebug”的请求失败。 请求被服务委托 (PBProcessManager) 拒绝,原因是:安全性(“PBD] 拒绝打开应用程序请求,原因是:安全性(应用程序 'com.myapp.MyAppDebug' 在 Internet 上使用看起来不安全;”)。 基础错误(域=FBSOpenApplicationErrorDomain,代码=3): 操作无法完成。 [PBD] 拒绝开放应用程序请求的原因:安全性(App 'com.myapp.MyAppDebug' 在互联网上使用看起来不安全;) [PBD] 拒绝开放应用程序请求的原因:安全性(App 'com.myapp.MyAppDebug' 在互联网上使用看起来不安全;)

  1. 我尝试过的事情:
    • 重启我的电脑 (v10.13.6) / xcode (v9.4.1) / etc.
    • 使用不同的签名证书
    • 使用不同的模拟器
    • --configuration标志

--loglevel trace 的完整日志

detox INFO:  [DetoxServer.js] server listening on localhost:49586...
detox DEBUG: [AsyncWebSocket.js/WEBSOCKET_OPEN] opened web socket to: ws://localhost:49586
detox TRACE: [AsyncWebSocket.js/WEBSOCKET_SEND] {"type":"login","params":{"sessionId":"67bd086e-af49-fd61-1de8-242636d659fe","role":"tester"},"messageId":0}
detox DEBUG: [DetoxServer.js/LOGIN] role=tester, sessionId=67bd086e-af49-fd61-1de8-242636d659fe
detox DEBUG: [DetoxServer.js/LOGIN_SUCCESS] role=tester, sessionId=67bd086e-af49-fd61-1de8-242636d659fe
detox TRACE: [AsyncWebSocket.js/WEBSOCKET_MESSAGE] {"type":"loginSuccess","params":{"sessionId":"67bd086e-af49-fd61-1de8-242636d659fe","role":"tester"},"messageId":0}

detox DEBUG: [exec.js/EXEC_CMD, #0] /usr/bin/xcrun simctl list -j
detox TRACE: [exec.js/EXEC_SUCCESS, #0] {
  "devicetypes" : [...,
  {
    "state" : "Shutdown",
    "availability" : "(available)",
    "name" : "iPhone 8",
    "udid" : "87D92BC6-686E-4EB3-9F09-E8865A0BE0ED"
  }, ...],
  "runtimes" : [...,     {
  "buildversion" : "15F79",
  "availability" : "(available)",
  "name" : "iOS 11.4",
  "identifier" : "com.apple.CoreSimulator.SimRuntime.iOS-11-4",
  "version" : "11.4"
}, ...],
detox DEBUG: [exec.js/EXEC_CMD, #1] applesimutils --list --byType "iPhone 8" --byOS "11.4"
detox DEBUG: [exec.js/EXEC_TRY, #1] Searching for device matching iPhone 8...
detox TRACE: [exec.js/EXEC_SUCCESS, #1] [...]
    detox TRACE: [exec.js/EXEC_SUCCESS, #2] Unknown command line option --byId, try --help!

detox DEBUG: [exec.js/EXEC_CMD, #3] xcodebuild -version
detox TRACE: [exec.js/EXEC_SUCCESS, #3] Xcode 9.4.1
Build version 9F2000

detox DEBUG: [exec.js/EXEC_CMD, #4] /usr/bin/xcrun simctl boot 368E25FE-3641-48F6-A47C-EA403E68EB85
detox DEBUG: [exec.js/EXEC_TRY, #4] Booting device 368E25FE-3641-48F6-A47C-EA403E68EB85
detox TRACE: [exec.js/EXEC_SUCCESS, #4] 
detox DEBUG: [exec.js/EXEC_CMD, #5] /usr/bin/xcrun simctl bootstatus 368E25FE-3641-48F6-A47C-EA403E68EB85
detox TRACE: [exec.js/EXEC_SUCCESS, #5] Monitoring boot status for Apple TV (368E25FE-3641-48F6-A47C-EA403E68EB85).
[2018-07-30 13:14:38 +0000] Status=3, isTerminal=YES, Elapsed=00:02.
    Data Migration Failed


detox DEBUG: [exec.js/EXEC_CMD, #6] /usr/bin/xcrun simctl io 368E25FE-3641-48F6-A47C-EA403E68EB85 screenshot "/dev/null"
detox ERROR: [exec.js/EXEC_FAIL, #6] "/usr/bin/xcrun simctl io 368E25FE-3641-48F6-A47C-EA403E68EB85 screenshot "/dev/null"" failed with code = 2, stdout and stderr:

detox ERROR: [exec.js/EXEC_FAIL, #6] 
detox ERROR: [exec.js/EXEC_FAIL, #6] An error was encountered processing the command (domain=SimulatorKit.SimDisplayScreenshotWriter.ScreenshotError, code=2):
Error creating the image

detox DEBUG: [exec.js/EXEC_CMD, #7] /usr/bin/xcrun simctl uninstall 368E25FE-3641-48F6-A47C-EA403E68EB85 com.myapp.MyAppDebug
detox DEBUG: [exec.js/EXEC_TRY, #7] Uninstalling com.myapp.MyAppDebug...
detox TRACE: [exec.js/EXEC_SUCCESS, #7] 
detox DEBUG: [exec.js/EXEC_SUCCESS, #7] com.myapp.MyAppDebug uninstalled
detox DEBUG: [exec.js/EXEC_CMD, #8] /usr/bin/xcrun simctl install 368E25FE-3641-48F6-A47C-EA403E68EB85 "/Users/etai/Code/data/mobile/member/ios/build/Build/Products/Debug-iphonesimulator/ApparMember.app"
detox DEBUG: [exec.js/EXEC_TRY, #8] Installing /Users/etai/Code/data/mobile/member/ios/build/Build/Products/Debug-iphonesimulator/ApparMember.app...
detox TRACE: [exec.js/EXEC_SUCCESS, #8] 
detox DEBUG: [exec.js/EXEC_SUCCESS, #8] /Users/etai/Code/data/mobile/member/ios/build/Build/Products/Debug-iphonesimulator/ApparMember.app installed
detox DEBUG: [exec.js/EXEC_CMD, #9] /usr/bin/xcrun simctl terminate 368E25FE-3641-48F6-A47C-EA403E68EB85 com.myapp.MyAppDebug
detox DEBUG: [exec.js/EXEC_TRY, #9] Terminating com.myapp.MyAppDebug...
detox TRACE: [exec.js/EXEC_SUCCESS, #9] 
detox DEBUG: [exec.js/EXEC_SUCCESS, #9] com.myapp.MyAppDebug terminated
detox TRACE: [ArtifactsManager.js/LIFECYCLE] onBeforeLaunchApp { deviceId: '368E25FE-3641-48F6-A47C-EA403E68EB85',
  bundleId: 'com.myapp.MyAppDebug' }
detox DEBUG: [exec.js/EXEC_CMD, #10] /bin/cat /dev/null >/Users/etai/Library/Developer/CoreSimulator/Devices/368E25FE-3641-48F6-A47C-EA403E68EB85/data/tmp/detox.last_launch_app_log.out 2>/Users/etai/Library/Developer/CoreSimulator/Devices/368E25FE-3641-48F6-A47C-EA403E68EB85/data/tmp/detox.last_launch_app_log.err && SIMCTL_CHILD_DYLD_INSERT_LIBRARIES="/Users/etai/Library/Detox/ios/d01d632fc9620831ab762e463575a0528084a3af/Detox.framework/Detox" /usr/bin/xcrun simctl launch --stdout=/tmp/detox.last_launch_app_log.out --stderr=/tmp/detox.last_launch_app_log.err 368E25FE-3641-48F6-A47C-EA403E68EB85 com.myapp.MyAppDebug --args -detoxServer ws://localhost:49586 -detoxSessionId 67bd086e-af49-fd61-1de8-242636d659fe
detox DEBUG: [exec.js/EXEC_TRY, #10] Launching com.myapp.MyAppDebug...
detox ERROR: [exec.js/EXEC_FAIL, #10] "/bin/cat /dev/null >/Users/etai/Library/Developer/CoreSimulator/Devices/368E25FE-3641-48F6-A47C-EA403E68EB85/data/tmp/detox.last_launch_app_log.out 2>/Users/etai/Library/Developer/CoreSimulator/Devices/368E25FE-3641-48F6-A47C-EA403E68EB85/data/tmp/detox.last_launch_app_log.err && SIMCTL_CHILD_DYLD_INSERT_LIBRARIES="/Users/etai/Library/Detox/ios/d01d632fc9620831ab762e463575a0528084a3af/Detox.framework/Detox" /usr/bin/xcrun simctl launch --stdout=/tmp/detox.last_launch_app_log.out --stderr=/tmp/detox.last_launch_app_log.err 368E25FE-3641-48F6-A47C-EA403E68EB85 com.myapp.MyAppDebug --args -detoxServer ws://localhost:49586 -detoxSessionId 67bd086e-af49-fd61-1de8-242636d659fe" failed with code = 1, stdout and stderr:

detox ERROR: [exec.js/EXEC_FAIL, #10] com.myapp.MyAppDebug: -1

detox ERROR: [exec.js/EXEC_FAIL, #10] An error was encountered processing the command (domain=FBSOpenApplicationServiceErrorDomain, code=1):
The request to open "com.myapp.MyAppDebug" failed.
The request was denied by service delegate (PBProcessManager) for reason: Security ("PBD] Denying open-application request for reason: Security (App 'com.myapp.MyAppDebug' looks unsafe for use on the internet; <PBApplicationInfo: 0x7fc86e00b1b0; com.myapp.MyAppDebug (App-Debug); sdk: 11.4>").
Underlying error (domain=FBSOpenApplicationErrorDomain, code=3):
    The operation couldn’t be completed. [PBD] Denying open-application request for reason: Security (App 'com.myapp.MyAppDebug' looks unsafe for use on the internet; <PBApplicationInfo: 0x7fc86e00b1b0; com.myapp.MyAppDebug (App-Debug); sdk: 11.4>)
    [PBD] Denying open-application request for reason: Security (App 'com.myapp.MyAppDebug' looks unsafe for use on the internet; <PBApplicationInfo: 0x7fc86e00b1b0; com.myapp.MyAppDebug (App-Debug); sdk: 11.4>)

detox TRACE: [ArtifactsManager.js/LIFECYCLE] onAfterAll
detox DEBUG: [DetoxServer.js/DISCONNECT] role=tester, sessionId=67bd086e-af49-fd61-1de8-242636d659fe

【问题讨论】:

    标签: ios xcode security react-native detox


    【解决方案1】:

    这似乎与https://github.com/wix/detox/issues/853#issuecomment-407375505 有关。

    在 7.3.3 中 name 字段对应于 AppleSimUtils --byName 标志,现在它只对应于嵌套的 deviceType.name 字段,它实际上是一个 deviceType,而不是一个名称。

    【讨论】:

    • 这是一个问题,很快就会解决。
    • 太棒了!同时,作为一个快速破解,我暂时禁用了所有其他设备模拟器。
    猜你喜欢
    • 2017-02-19
    • 2017-01-31
    • 1970-01-01
    • 2018-10-05
    • 2012-12-14
    • 1970-01-01
    • 2017-07-08
    • 2017-01-22
    • 2021-05-15
    相关资源
    最近更新 更多