WebDriverAgentRunner crashes when installed on real iOS 9.3.2 iPhone 6

Created on 3 Jul 2016  Â·  9Comments  Â·  Source: facebookarchive/WebDriverAgent

After bootstrapping the project, I selected the WebDriverAgentRunner then selected Project -> Test. The app is installed on an iPhone 6 running 9.3.2, but crashes on launch. iOS console logs show the following:

Jul 2 19:51:49 iPhone6 SpringBoard[58] : Installed apps did change.
Added: {(
)}
Removed: {(
)}
Modified: {(
"com.apple.test.WebDriverAgentRunner-Runner"
)}
Jul 2 19:51:50 iPhone6 kernel[0] : AppleKeyStore:Sending lock change 0 for handle 0
Jul 2 19:51:50 iPhone6 UserEventAgent[26] : LockStateNotifier aksNotificationCallback posting notification: com.apple.mobile.keybagd.lock_status
Jul 2 19:51:50 iPhone6 UserEventAgent[26] : (Note ) PIH: Lock status changed.
Jul 2 19:51:50 iPhone6 MobileMail[388] : Ignoring lock state change from disabled to disabled
Jul 2 19:51:50 iPhone6 mobile_house_arrest[975] : vend_afc: Could not set SO_NOSIGPIPE: Bad file descriptor
Jul 2 19:51:50 iPhone6 com.apple.xpc.launchd1 : Service exited with abnormal code: 1
Jul 2 19:51:51 iPhone6 syncdefaultsd[968] : (Note ) marked "com.me.keyvalueservice" topic as "enabled" on
Jul 2 19:51:51 iPhone6 kernel[0] : AppleKeyStore:Sending lock change 0 for handle 0
Jul 2 19:51:51 iPhone6 UserEventAgent[26] : LockStateNotifier aksNotificationCallback posting notification: com.apple.mobile.keybagd.lock_status
Jul 2 19:51:51 iPhone6 UserEventAgent[26] : (Note ) PIH: Lock status changed.
Jul 2 19:51:51 iPhone6 MobileMail[388] : Ignoring lock state change from disabled to disabled
Jul 2 19:51:52 iPhone6 com.apple.debugserver-@(#)PROGRAM:debugserver PROJECT:debugserver-340.3.124
[978] : debugserver-@(#)PROGRAM:debugserver PROJECT:debugserver-340.3.124
for arm64.
Jul 2 19:51:52 iPhone6 com.apple.debugserver-@(#)PROGRAM:debugserver PROJECT:debugserver-340.3.124
[978] : Connecting to com.apple.debugserver service...
Jul 2 19:51:52 iPhone6 com.apple.debugserver-@(#)PROGRAM:debugserver PROJECT:debugserver-340.3.124
[978] : Got a connection, waiting for process information for launching or attaching.
Jul 2 19:51:52 iPhone6 com.apple.debugserver-@(#)PROGRAM:debugserver PROJECT:debugserver-340.3.124
[978] : Sending AppProxy info: sequence no: 156, GUID: 993A9B8E-650B-4F55-A075-7A03E2FE49A9.
Jul 2 19:51:52 iPhone6 com.apple.debugserver-@(#)PROGRAM:debugserver PROJECT:debugserver-340.3.124
[978] : error: Unrecognized event type: . Ignoring.
Jul 2 19:51:52 iPhone6 com.apple.debugserver-@(#)PROGRAM:debugserver PROJECT:debugserver-340.3.124
[978] : About to launch process for bundle ID: com.apple.test.WebDriverAgentRunner-Runner
Jul 2 19:51:52 iPhone6 SpringBoard[58] : SecTrustEvaluate [leaf IssuerCommonName SubjectCommonName]
Jul 2 19:51:52 iPhone6 com.apple.xpc.launchd1 : The DisableASLR key is no longer respected. Please remove it.
Jul 2 19:51:52 iPhone6 securityd[93] : secTaskDiagnoseEntitlements MISSING keychain entitlements: no stored taskRef found
Jul 2 19:51:52 iPhone6 amfid[225] : SecTrustEvaluate [leaf IssuerCommonName SubjectCommonName]
Jul 2 19:51:52 iPhone6 kernel[0] : xpcproxy[979] Container: /private/var/mobile/Containers/Data/Application/90839F27-B3FE-4BF3-AF75-EE9755B330A1 (sandbox)
Jul 2 19:51:52 iPhone6 com.apple.debugserver-@(#)PROGRAM:debugserver PROJECT:debugserver-340.3.124
[978] : In completion handler, got pid for bundle id, pid: 979.
Jul 2 19:51:52 iPhone6 com.apple.debugserver-@(#)PROGRAM:debugserver PROJECT:debugserver-340.3.124
[978] : Got a connection, launched process /private/var/containers/Bundle/Application/6A4098C5-4538-4F67-A7C2-9688D369A880/WebDriverAgentRunner-Runner.app (pid = 979).
Jul 2 19:51:52 iPhone6 SpringBoard[58] : LICreateIconForImage passed NULL CGImageRef image
Jul 2 19:51:53 iPhone6 com.apple.debugserver-@(#)PROGRAM:debugserver PROJECT:debugserver-340.3.124
[978] : 1 +0.000000 sec [03d2/0c07]: error: ::mach_vm_region_recurse ( task = 0x1a13, address => 0x636a626f62696c2f, size => 0, nesting_depth => 1024, info => 0x16fd02ccc, infoCnt => 12) addr = 0x636a626f62696c2f err = (os/kern) invalid address (0x00000001)
Jul 2 19:51:53 iPhone6 com.apple.xpc.launchd[1] : assertion failed: 13F69: launchd + 116796 [9F6284CF-8A17-36CC-9DB5-85D510A21F14]: 0x3
Jul 2 19:51:53 iPhone6 com.apple.debugserver-@(#)PROGRAM:debugserver PROJECT:debugserver-340.3.124
[978] : 2 +0.069258 sec [03d2/0c07]: error: ::mach_vm_region_recurse ( task = 0x1a13, address => 0xf098de5b00e2a45a, size => 0, nesting_depth => 1024, info => 0x16fd02ccc, infoCnt => 12) addr = 0xf098de5b00e2a45a err = (os/kern) invalid address (0x00000001)
Jul 2 19:51:54 iPhone6 XCTRunner[979] : Running tests...
Jul 2 19:51:54 iPhone6 securityd[93] : secTaskDiagnoseEntitlements MISSING keychain entitlements: no stored taskRef found
Jul 2 19:51:54 iPhone6 amfid[225] : SecTrustEvaluate [leaf IssuerCommonName SubjectCommonName]
Jul 2 19:51:54 iPhone6 kernel[0] : AMFI: XCTRunner(pid 979) - [deny-mmap] mapped file does not the same team identifier as main process: /private/var/containers/Bundle/Application/6A4098C5-4538-4F67-A7C2-9688D369A880/WebDriverAgentRunner-Runner.app/PlugIns/WebDriverAgentRunner.xctest/Frameworks/WebDriverAgentLib.framework/Frameworks/KissXML.framework/KissXML
Jul 2 19:51:54 iPhone6 kernel[0] : AMFI: XCTRunner(pid 979) - [deny-mmap] process has team identifier K3C3J3YZRH: /private/var/containers/Bundle/Application/6A4098C5-4538-4F67-A7C2-9688D369A880/WebDriverAgentRunner-Runner.app/PlugIns/WebDriverAgentRunner.xctest/Frameworks/WebDriverAgentLib.framework/Frameworks/KissXML.framework/KissXML
Jul 2 19:51:54 iPhone6 kernel[0] : AMFI: XCTRunner(pid 979) - [deny-mmap] mapped file has team identifier 8C96M9YR8S: /private/var/containers/Bundle/Application/6A4098C5-4538-4F67-A7C2-9688D369A880/WebDriverAgentRunner-Runner.app/PlugIns/WebDriverAgentRunner.xctest/Frameworks/WebDriverAgentLib.framework/Frameworks/KissXML.framework/KissXML
Jul 2 19:51:54 iPhone6 XCTRunner[979] : The bundle “WebDriverAgentRunner” couldn’t be loaded because it is damaged or missing necessary resources. Try reinstalling the bundle.
Jul 2 19:51:54 iPhone6 XCTRunner[979] : (dlopen_preflight(/var/containers/Bundle/Application/6A4098C5-4538-4F67-A7C2-9688D369A880/WebDriverAgentRunner-Runner.app/PlugIns/WebDriverAgentRunner.xctest/WebDriverAgentRunner): Library not loaded: @rpath/KissXML.framework/KissXML
Referenced from: /private/var/containers/Bundle/Application/6A4098C5-4538-4F67-A7C2-9688D369A880/WebDriverAgentRunner-Runner.app/PlugIns/WebDriverAgentRunner.xctest/Frameworks/WebDriverAgentLib.framework/WebDriverAgentLib
Reason: no suitable image found. Did find:
/private/var/containers/Bundle/Application/6A4098C5-4538-4F67-A7C2-9688D369A880/WebDriverAgentRunner-Runner.app/PlugIns/WebDriverAgentRunner.xctest/Frameworks/WebDriverAgentLib.framework/Frameworks/KissXML.framework/KissXML: mmap() errno=1 validating first page of '/private/var/containers/Bundle/Application/6A4098C5-4538-4F67-A7C2-9688D369A880/WebDriverAgentRunner-Runner.app/PlugIns/WebDriverAgentRunner.xctest/Frameworks/WebDriverAgentLib.framework/Frameworks/KissXML.framework/KissXML')
Jul 2 19:51:54 iPhone6 SpringBoard[58] : BSXPCMessage received error for message: Connection invalid
Jul 2 19:51:54 iPhone6 SpringBoard[58] : HW kbd: Failed to set (null) as keyboard focus
Jul 2 19:51:54 iPhone6 com.apple.xpc.launchd1 : Service exited with abnormal code: 82
Jul 2 19:51:54 iPhone6 com.apple.debugserver-@(#)PROGRAM:debugserver PROJECT:debugserver-340.3.124
[978] : 3 +0.235305 sec [03d2/1b0b]: error: ::read ( -1, 0x16e246a38, 1024 ) => -1 err = Bad file descriptor (0x00000009)
Jul 2 19:51:54 iPhone6 com.apple.debugserver-@(#)PROGRAM:debugserver PROJECT:debugserver-340.3.124
[978] : Exiting.
Jul 2 19:51:54 iPhone6 testmanagerd[974] : testmanagerd exiting, idle with no test activity.
Jul 2 19:51:54 iPhone6 SpringBoard[58] : Application 'UIKitApplication:com.apple.test.WebDriverAgentRunner-Runner[0xa7f3]' exited voluntarily.

Running the exact same project targeting a simulator works fine. Are there additional steps to getting this working on a real device that I'm missing?

Most helpful comment

Do whatever you need to do :). WDA does not depend on bundle id having any particular value.

All 9 comments

deny-mmap is showing that failing to mmap Frameworks due to a Code Signing issue. @marekcirkos what are your thoughts on statically linking WebDriverAgentLib and it's dependencies into the xctest target.

Can you try removing WebDriverAgentRunner-Runner.app application from device your device and cleaning the project?

No dice @marekcirkos. I tried a few things:

  1. Your recommendation above.
  2. Blowing away the project, re-cloning/bootstrapping, and rerunning.
  3. Setting the Team to my Apple Developer Account for the WebDriverAgentLib framework (just shooting in the dark here).

It is code signing issue. Make sure you have valid team / provisioning profile that can sign any bundle id. I had same issue when I was working on different machine and explicitly selecting team solved it for me. For you it might be picking wrong prov profile. Checking which one is used on code sign step might be a go idea.

Shoot, yeah found the issue. My new Apple Developer account didn't have a Wildcard App ID and Provisioning Profile created. Once I created one and explicity set Code Signing to use this account, installs on real devices started working.

Thanks for the help @marekcirkos!

@marekcirkos i have the same issue with the code signing. It seems that I can only sign apps with bundle id that start with "com.myCompanyName". Can I alternatively change all WebDriver bundle ids from "com.facebook" to this one? (for example: com.myCompanyName.WebDriverAgentRunner)

Do whatever you need to do :). WDA does not depend on bundle id having any particular value.

Hi, I've same issue.
These methods not helped me:

  • rebooting ios/mac
  • re-cloning/bootstrapping and rerunning
  • changing certificate

From another host WDA working good with these certificates.

I fixed issue by re-downloading the WWDR (Apple Worldwide Developer Relations Certification Authority) and set its trust: 'use system default'.
Download from here: http://developer.apple.com/certificationauthority/AppleWWDRCA.cer

Was this page helpful?
0 / 5 - 0 ratings