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
You just need to change your Team. In my case that worked
Encountered same issue, we've had multiple configurations in Xcode project, let's say Debug-Staging
, Debug-Production
. We then unified those and used only one configuration Debug
. But the old one (no longer existing) was stuck in scheme for run phase, so once you tried to run, Xcode showed you this message. Which makes sense as provisioning profiles are set up in build settings based on configuration.
So run scheme looked like this:
While project configurations were setup like this.
Changing scheme to use configuration that is still available in project is what fixed this issue for me.
I had the case where my app would deploy to my iPhone but not my watch. Deploying to the watch would give the "A valid provisioning profile for this executable was not found." error. This is with XCode Version 11.2.1 and using the free developer account.
Here is what I did to get it deployed to my watch:
1) I deleted my provisioning profile in XCode. I did this by going to Window -> Devices And Simulators. Then right Click on the iPhone name and choose "Show Provisioning Profiles". From there I could delete the file
2) In The Devices and Simulators screen I also deleted my app from the "Installed Apps" section.
3) Did a "clean build folder" (Product -> Clean Build Folder)
4) In the "Build Settings" -> "Signing section" I made sure each target (iPhone, Tests and Watch) had the same settings (development team, code signing style, provisioning profile was set to automatic etc).
5) Ensured the ~/Library/MobileDevice/Provisioning Profiles directory was empty.
6) Unplugged phone from computer
7) Rebooted computer, phone and watch
8) Plugged phone back into computer, and went through the "trust this machine" prompts on phone and watch.
9) Ran app. It worked!
I did the following :
This is very weird but it worked for me, might work for others and save the frustration.
For our team, nothing helped. We have spend a couple of days and tried out every step that was mentioned here above in answers and comments. We tried with XCode 10 and even XCode 9.2 on an App, that is on the App store since many years.
The issue began after upgrading to MacOS Mojave. Unfortunately, going back to HighSierra didn't help then.
At least we was able again to ship into App store after we've created new certificate and provisioning profile. But we still are not able any more to test our App in release mode on real device, which is necessary to test InApp-purchases.
In short: Archiving and submission works well, running on real device not!
Several developers, several devices, macbooks, XCode versions....
At the end we had to change the AppID for being able again to test on real device.
Therefor we run two different projects now: one for shipping to TestFlight/AppStore with the real AppID and one for development purposes with another AppID.
Although this only happens on ONE particular App of our company and not all the others, we expect to run into similar issues in the future as things get more worse with Apple's development tools...
I had this issue occurring in Xcode 10.3 after I switched over to my XCTest unit test target then back to the project run time target.
Turns out I had a different Teams selected in my provisioning profile for each target.
To fix it :
Clean Build Folder
Make sure all may targets are using the same Team. See Profile Signing under the general tab.
If not using same Team for all targets, clean before switching to a build target with
different team selected.