xenep
xenep

Reputation: 3385

A valid provisioning profile for this executable was not found for debug mode

I am getting this error while I am trying to debug my app on device.

I created development provisioning profile as it is mentioned at the developer portal. My development device is selected in the profile and I am selecting the correct profile from Target's code signing identity menu. I recreated provisioning profile for several times and also removed and reinstalled it and recreated the project but I am getting that whenever I try to debug on device.

Btw, the adhoc distribution provision profile works.

I spent my whole day to find out a solution but nothing. Anyone have a solution?

Upvotes: 241

Views: 297670

Answers (30)

samdeV
samdeV

Reputation: 2158

It could be because your iphone is not recognized by the provisioning portal.

Solution:

  1. In Xcode, Goto --> Build --> clean all targets.

  2. In "Groups & Files" -->Target --> expand it --> right click your app and select Clean "your app"

  3. Goto->Window-->Organizer

  4. In the Devices tab on the left, select your iphone

  5. In the Provisioning section of the selected iphone delete all the current profiles (if any)

  6. Unplug your iPhone and replug it in.

  7. Goto->Window-->Organizer-->right click your iPhone -->Add device to provisioning portal

  8. Now make sure you have selected the appropriate code signing identity in edit project settings -> build --> code signing

Build and run.

Upvotes: 187

JerryZhou
JerryZhou

Reputation: 5206

After select auto manager signing

You may still need to check the selection in settings. Sometime, it's not correct there.

enter image description here

Upvotes: 1

KTang
KTang

Reputation: 350

In my case, I was setting "Embed Without Signing" on some frameworks in "Project -> General -> Frameworks, Libraries, and Embedded Content" tab, which causes unknown conflicts in the project.

It finally works when I set "Embed and Sign" to those frameworks which needed to be embedded.

Upvotes: 0

Feng Liu
Feng Liu

Reputation: 1022

Add a correct signing for myProjectTests as well.

Upvotes: 0

che
che

Reputation: 633

In Xcode 10, I solved this by switching the project's build system from "new build system" to "legacy build system" (File -> project Settings).

Upvotes: 44

Simion Agavriloaei
Simion Agavriloaei

Reputation: 3707

This worked for me:
from xcode, Window -> Devices & Simulators, right click on your phone(s), Unpair.
Then re-connect everything, build, done.

Upvotes: 0

Xcodian Solangi
Xcodian Solangi

Reputation: 2408

In my case, it was the problem when I setup my time manually two month earlier on my iPhone. But when I changed to set time automatically, it worked fine.

Setting -> General -> Date & Time -> set time automatically

If it does not work set time automatically of both mac & iPhone, will work fine.

Upvotes: 2

karolszafranski
karolszafranski

Reputation: 720

I had the same issue with Xcode 10.0 beta 5 (10L221o) and a device running iOS 12.0 (16A5345f) - that's also beta.

After installing the app alert titled "App installation failed" showed up, "A valid provisioning profile for this executable was not found.".

I got rid of it by going to: ~/Library/MobileDevice/Provisioning Profiles and finding the certificate Xcode was trying to use. Then in the "Devices and Simulators" window in Xcode, I right clicked on my device, choose "Show Provisioning Profiles" and with a plus button added the provisioning profile to the device there.

I don't remember when I've done it last time, it's been years. I guess that Xcode normally does it for us but for some reason, it fails when we see that message.

Upvotes: 14

Halt
Halt

Reputation: 1135

One of the cause could be your "project => Build Settings => Signing => Development Team" is different from your "target => Build Settings => Signing => Development Team", just make them same

Upvotes: 1

Vinayak Parmar
Vinayak Parmar

Reputation: 618

Your developer account sessions might have expired. Check accounts section from preference. You can see red colored text regarding sessions expired if that is the case

Upvotes: 0

Sahil Dhawan
Sahil Dhawan

Reputation: 1

In my case the device date and time was changed manually .To solve the problem set the date and time to automatic .

Upvotes: 0

leMale
leMale

Reputation: 179

In my case this problem occurred because another provisioning profile was selected for the unit tests. Just took me hours to find this ...

Upvotes: 13

Max Mumford
Max Mumford

Reputation: 2642

I got this error while following a guide to create a separate target for development mode and production mode.

The mistake I made was creating a Distribution provisioning profile, and assigning that to the production mode target. Distribution profiles are not associated with debug devices, so of course the error appeared.

The solution was to create a second development provisioning profile and using that instead.

Upvotes: 0

wei
wei

Reputation: 4727

I fixed this problem by ticking "Automatically manage signing" in XCode 8.2 Target->Signing->Automatically manage signing

Upvotes: 0

Whitney Foster
Whitney Foster

Reputation: 721

For me, all of my devices in the developer portal needed to be reregistered. there was a yellow notifier that took you through the steps. Then, I had to validate all of my provisioning profiles and download again.

Upvotes: 0

Seoras
Seoras

Reputation: 1277

This looks like a bug (I'm using XCode 7.3.1).

Trying to use XCode->Product->Profile spat out the "no valid provision profile" error.

By sheer dumb luck I got it working simply by running the app on my attached device using a normal compile, then going to the "Debug Navigator" and clicking on "Profile in Instruments" in the top right corner.

enter image description here

Upvotes: 0

Amit Ajmera
Amit Ajmera

Reputation: 1467

One of the solution can be,Your provisioning profile does not include your iPhone's UDID. For that You need to register UDID first and then regenerate provisioning profile from developer account.

Upvotes: 0

Dmitriy Kalachniuk
Dmitriy Kalachniuk

Reputation: 372

Had the same problem. My solution was very easy. I checked If I have my device's UDID in developer.apple.com and it was absent. After I added it, it starts working. It is very annoying that Apple developers give error "A valid provisioning profile for this executable was not found" instead of "UDID is not found". Actually I mentioned it first in XCode 6...

Upvotes: 3

Epic Byte
Epic Byte

Reputation: 33968

Changing the provisioning profile to automatic then running prompted Xcode to "fix" the issue. I then changed back to my original provisioning profile and everything worked fine.

Upvotes: 4

zeiteisen
zeiteisen

Reputation: 7168

With Xcode 6 and a new device:

  1. Press cmd + shift + 2 to open devices. add device in xcode
  2. Press the "register device" button. If there is no such button (like in the screenshot) go to developer.apple.com and add it manually. Copy the Identifier into the field. add device on portal
  3. Go to Xcode -> Preferences -> Accounts -> Doubleclick on your account -> Press the little refresh button on bottom left to refresh the profiles refresh profiles
  4. Go to Code Signing and set the new profiles. set profiles

Upvotes: 10

S E
S E

Reputation: 435

This solution worked for me

  1. Go to Xcode --> Preferences --> Account.
  2. In the provisioning profiles section, right click and open with finder.
  3. Delete all provisioning profiles from the provisioning profile folder.
  4. Finally, go back to Xcode and click the refresh button.

I hope that helps!

Upvotes: 6

Konstantin.Efimenko
Konstantin.Efimenko

Reputation: 1478

First of all you should 1.add your device identifier to Member center -> devices. 2.Generate developer provision profile 3.Run app on device with this provision profile.

Upvotes: 0

Manab Kumar Mal
Manab Kumar Mal

Reputation: 21398

That was my mistake, I have forgot to add my device in the Provisioning profile. When I have added my device on the development and adhoc provision and downloaded again, then Restarting the Xcode, then again selected the desired Provision on the target of the Project, It worked smoothly.

Upvotes: 0

Badr Bujbara
Badr Bujbara

Reputation: 8691

  • Xcode->Click your app -> TARGETS -> click the app-> Build Setting-> Code Signing : Make sure that both Debug and Any iOS SDK are set to iPhone Development

  • Xcode -> Product -> Scheme -> Edit Scheme: Make sure Build Configuration is set to Debug.

Upvotes: 15

Dodgson86
Dodgson86

Reputation: 333

In my experience this problem happens if you try to build on a device that is not registered in your developer center or is not enabled inside provisioning profile that you are using.

1) Add the device to the developer center. In XCode 5 you'll still find a button "add to member center" inside the Organizer window. In XCode 6 i suggest to copy the device ID and manually add it to the device section of your member center.

2) Edit the provisioning profile you're using to include the device you have just added. Save and synchronize provisioning profiles from XCode.

Clean, and it is on.

Upvotes: 1

BabyPanda
BabyPanda

Reputation: 1592

In my case a valid provisioning file is because I didn't add the device to the very provisioning file.

Upvotes: 3

Vinod Joshi
Vinod Joshi

Reputation: 7862

We can try this: This has solved my problem . You need to reset the profile for which your device id has been added into your member area of Apple.com . . enter image description here

Upvotes: 7

I had this problem too with Xcode 5.0.1. One fine day the application simply did not want to be installed on the device to which it was installed five minutes ago without any problems.

I tried to clean settings, delete derived data, recreate provisioning profiles, sign with another certificates/profiles, remove the device from the organizer, etc.

Finally, I reset my device's content and settings and successfully built my project with old profiles, certificates and bundle ID.

Upvotes: 0

coolcool1994
coolcool1994

Reputation: 3812

Click Your app from Xcode Under Targets. (Under project.) Here you see Summary info, build settings, Build phases, build rules.

Okay go to Build Settings. Go down to Code Signing.

You see you have two fields Debug and Release. You have two profiles to choose from in each of those fields, Distributing and developing.

Let distributing be the one from the Release field. Let Developing be the one from the Debug field.

Doing this solved this problem, and let that error message go away. Now I can run my application fine.

Upvotes: 0

Adam
Adam

Reputation: 33146

Another cause (verified):

  1. Apple has a major bug in Xcode going back to version 3.x, where it magically overwrites the OS X keychain with a fake keychain from inside Xcode, re-installing certs (and private keys!) that you already deleted

  2. ...so, if you have "new cert" installed, and nothing else, Xcode will sometimes get into an infinite loop where it will keep ALSO installing "old cert" (that doesn't exist anywhere except inside XCode!).

  3. ...and because of ANOTHER bug in Xcode (unfixed for 3+ years now...), Xcode sometimes automatically selects the "oldest cert I can find" (whcih, by definition, is incorrect - I think someone at Apple got mixed up between "oldest" and "newest" :( )

  4. ...and EVEN THOUGH you've selected the correct provisioning profile, Xcode sends the "old" provisioning profile to the device, then signs with the "new" profile, causing this error

Solution: you have to un-FUBAR Xcode's FUBAR of your Keychain.

This is harder than it sounds (there are multiple SO posts on this topic) - it involves multiple reboots of your machine, deleting the key every time.

Eventually, Xcode gives up on corrupting your OS, and accepts the reality you present it with :).

Upvotes: 4

Related Questions