Debug on real Apple Watch: Application Verification Failed

后端 未结 5 1299
野性不改
野性不改 2020-12-01 04:14

I tried to debug my WatchKit app on a real Apple Watch today. After hitting the Debug button in Xcode, the main iPhone app was installed properly, but the Apple Watch only d

5条回答
  •  不知归路
    2020-12-01 04:42

    The UDID issue as described above can be the culprit, but in my case, that was handled automatically by Xcode. Looking at the device log (menu Window>Devices) showed:

    companionappd[350] : failed to install WatchKit application, error: (Error Domain=LaunchServicesError Code=0 "The operation couldn’t be completed. (LaunchServicesError error 0.)" UserInfo=0x14e2f690 {Error=ApplicationVerificationFailed, ErrorDetail=-402620394, ErrorDescription=Failed to verify code signature of : 0xe8008016 (Entitlements found that are not permitted by provisioning profile)})

    ... a problem which didn't get caught in the build process, nor was explicitly shared with me in the on-screen errors.

    So, I looked at the entitlements:

    enter image description here

    Yes, I did have to manually add that beta-reports-active in order to submit to TestFlight.

    It seems that you needs the flag if you're using TestFlight (and anything other than the default Entitlements), but you need to not have the flag if you're debugging locally.

    My solution to this contradiction therefore is to have two entitlements files, like so:

    enter image description here

    So far, so good. App and Watch Extension are running as expected.

提交回复
热议问题