IOS – Error when remotely controlling iOS device over VNC

iosremote desktopwindows

I'm using Quamotion xcuitrunner to remotely control an iOS device over VNC. I'm launching xcuitrunner on Windows, using the command line.

When I connect to localhost:5900 using TightVNC, I see a black screen with the following text:

Could not connect to the device. The installation of application Quamotion Agent on device iPhone failed.
The installation proxy returned the error ApplicationVerificationFailed.

The following syslog messages may contain more information:
0x16f577000 -[MIClientConnection _doInstallationForUrl:withOptions:completion:]: Install of "/var/mobile/Media/PublicStaging/com.apple.test.WebDriverAgentRunner-Runner" type Customer (LSInstallType = (null)) requested by lsd (pid 81)
Acquired termination assertion for event <BKSTerminationAssertionCreateEvent: 0x14de894c0; Identifier: 45-1B4BE7A4-CCC7-458A-A2DD-B7B0E2176EFE; Name: FBSApplicationTerminationAssertion; Target BundleID: com.apple.test.WebDriverAgentRunner-Runner; Efficacy: Unconditional>
0x16f577000 -[MIINstaller performInstallationWithError:]: Installing <MIInstallableBundle ID=com.apple.test.WebDriverAgentRunner-Runner; Version=1, ShortVersion=1.0>
com.apple.test.WebDriverAgentRunner-Runner:7:5:1:1:Start : Install (New)
Trust evaluate failure: [leaf IssuerCommonName LeafMarkerOid Revocation1 SubjectCommonName]
Trust evaluate failure: [leaf IssuerCommonName LeafMarkerOid Revocation1 SubjectCommonName]
Trust evaluate failure: [leaf IssuerCommonName LeafMarkerOid Revocation1 SubjectCommonName]
Trust evaluate failure: [leaf Revocation1]
0x16f577000 +[MICodeSigningVerifier _validateSignatureAppAndCopyInfoForURL:withOptions:error:]: 199:

Failed to verify code signature of [...]/Library/Caches/com.apple.mobile.installd.staging/temp.nV5S17/extracted/Payload/WebDriverAgentRunner-Runner:
0xe8008018 (The identity used to sign the executable is no longer valid.)
0x16f577000 -[MIInstaller performInstallationWithError:]: Verification stage failed
com.apple.test.WebDriverAgentRunner-Runner:7:5:2:0:Fail (End) : Install (New)

Can you please help me with this error?

Best Answer

The underlying error is a bit hidden in the output, but the crux of it is:

Failed to verify code signature [...] The identity used to sign the executable is no longer valid.

This means the developer profile you have used contains a developer certificate which has been revoked. This can happen, for example, when you request a new certificate in Xcode.

Can you please:

  • Make sure your developer profile contains no revoked certificates. You can use xcuitrunner developerProfile -d [path to your developer profile] -p [password] to list the certificates embedded in your developer profile, and see their status (expired, revoked,...)
  • Remove the WebDriverAgent app from your iOS device
  • Delete all .ipa files in the folder where xcuitrunner.exe is located

Then:

  • Open a command prompt, and navigate to the folder where xcuitrunner.exe is located
  • Type ideviceinfo.exe > deviceinfo.txt
  • Type idevicesyslog.exe > syslog.txt. The application will remain running until you stop it by typing CTRL+C. Don't stop it yet.
  • Open a second command prompt, and navigate to the folder where xcuitrunner.exe is located
  • Launch xcuitrunner.exe, and wait for the error to occur
  • In the first command prompt window, type CTRL+C to stop idevicesyslog
  • Share a copy of deviceinfo.txt and syslog.txt via a Gist.