Xcode 10: A valid provisioning profile for this executable was not found

前端 未结 30 1584
名媛妹妹
名媛妹妹 2020-11-29 15:12

Since yesterday I\'ve been getting the following error when trying run an app on my device: \"A valid provisioning profile for this executable was not found.\". This is afte

30条回答
  •  [愿得一人]
    2020-11-29 15:44

    So this won't be the case for everyone but I thought I'd post it here anyway as there doesn't seem be any answers relating to it.

    In my case I was working on an app that was being developed in ReactNative, my issue was that although my signing was correct on the main app target the test target did not have any signing applied to it.
    For some reason React Native requires that both your app target and your test target are signed in order to install the app on a device.
    It does specify this in the official documentation on building for device however its the only instance I have ever seen where the test target is built alongside the app for anything other than testing.

    In order to sign your test target, go to your project settings by opening the project navigator (⌘1) and select your project at the top.

    Inside the main editor select your main app target under Targets (should have the same name as your project) and ensure the signing is correct, then select the test target (likely just under your main app target, it should be the same name with Tests appended) and make sure its signed in the same way.

    Rebuild your app and it should now install successfully.

    Credit for this goes to Leo Lei, his answer here saved me a lot of headache: https://stackoverflow.com/a/48657358/732844

    As an aside, if anyone knows why react native requires your test target be built alongside your app target could they let me know? The only reason I can think of is to streamline the interface so react can build a single app and do both running and testing without needing to rebuild but i'm just guessing with that one.

提交回复
热议问题