No Identity with Provisioning Profile in XCode - iphone

I'm trying to get my XCode to run apps on my iPhone.
A while ago I tried to do that just from within XCode (knowing nothing), and it complained about how my Apple ID wasn't set up with a developer account. Fair enough.
Now I do have a developer account (I'm a member of an organization). As soon as I got the enrollment email I followed their instructions about setting up the certificates and adding it to my keychain and whatnot.
Then I followed these instructions to try to get XCode set up. When I got to the part about using my device for development, that button wasn't there. But as the instructions say:
If the device was used for development in the past, the “Use for Development” button may not appear. If this happens, click “Add to Portal” at the bottom of the screen instead.
So I clicked "Add to Portal", a provisioning profile appeared in the list, and everything seemed good. I then proceeded to the "Code Sign Your App" section. This is what I see:
I expected there to be a section for iOS Team Provisioning Profile: * or something. And, of course, this means that when I try to run my app it fails with a code signing error.
I've poked around with deleting and re-adding stuff, but this is where I always get stuck. I can provide more information, I just...don't know what you want. How do I proceed?
Thanks.

You can try CMD Shift 2, going to the Devices tab, and refresh the provisioning profiles and/or the team. It should ask you to log in - and hopefully will update your profile for you.
If it doesn't, it's the same every time. Your device needs to be added to the devices on the portal by a team admin. You said you have a certificate. If not using the team provisioning profile, you have to add your certificate to the profile you are using. Then make sure to quit xcode and reopen it after the changes.

Download the certificate and mobile provisioning profile from the developer site. Then double click them to add to your keychain / organizer.

Related

Developing for iOS on multiple computers, testing on a single device, advice?

I was looking for some advice on provisioning profiles / certificates etc... I use an iMac at work to develop on, and I also sometimes find myself checking out my code from git onto my MacBook Pro at home but I always run into issues when I want to test on my iPhone from another computer.
Obviously my provisioning profiles on the device match the certificate issued to my iMac from work, so from my laptop, I can't test on the device because the provisioning profile doesn't match a certificate. so I get a code sign error.
What can I do to bypass this ?
Thanks in advance.
Apple provides an easy solution to working on multiple machines.
You can export your developer profile from your work iMac and move it onto your Macbook Pro.
In Xcode 4, bring up the Organizer. Click on "Devices"/
Now, click on "Developer Profiles" in the sidebar.
Then, on the bottom of the screen you will see a button called "Export" and a button called "Import". On the computer with the original certificates click "export" and save the profile. You may be prompted to enter a password.
On the second computer, use "import" to install the certificates.
You should be able to develop and test seamlessly between the two machines now.
Edit:
According to Topher Fangio in the comments below, you may need to:
open Keychain Access, then find [your] iPhone Developer Certificate on my desktop, and export it. Then import it on your [second machine]. If you see the dropdown and associated private key on one machine, but not the other, then you need to export it apparently.
Hopefully Topher's insight will help anyone who has trouble with using Xcode to do this.
If you're using Xcode 6.x - 8.x, there is a very easy way to do this:
See the section titled Exporting and Importing Certificates and Profiles in the app distribution guide.
To sum it up:
go to Xcode's preferences
click on accounts
click on the gear icon at the bottom left
select 'export accounts' and enter the desired filename and password
open the newly created file on your new machine
Done! this will import the profiles from the previous machine.
You need to keep the original private key file and certificate file you create as the absolute first step in the process on the portal. Then you need to import not just the certificate but the private key file too on your laptop. Once that is done, you should be able to sign with your developer cert and provisioning profile on both laptops.
I've gotten in this situation too. You can start it all over on the provisioning portal if needed with no real negative effects.
I have Xcode 4.6.1 and in the organizer there is now a refresh button at the bottom right. Hit that, sign in to your Apple account and it should pull all the relevant profile info.
-Cheers
This answer does not seem to apply to Xcode 4.6.3 where the Organizer does not have a "Developer Profile" section.
In Xcode 5 and 6 (which most will be using at the time of posting) there is a different procedure which is discussed here.

The executable was signed with invalid entitlements

So here we are yet again. I already have an app on the app store, that took me 2 days to get past all the errors and just get the thing on there.
Right now, I'm trying to put the 1.1 update on my brother's iPod Touch for testing. I pressed 'Use for development'. That's fine, works. Then i build and go, and it says 'The iPod “Dans Ipod touch” doesn’t have the provisioning profile with which the application was signed.' so i press Install And Run to install the provisioning profile, and then get 'The executable was signed with invalid entitlements'.
I'll be clear - all i want to do right now is to test the app on an iPod Touch, which is plugged into the computer. How do I get past this error and do that? I have what i thought was a valid provisioning profile selected in active target and active executable, but apparently that isn't enough. Any ideas?
Couple of easy things to try:
Do a Clean before building again.
Go to Xcode's Organizer and click on all the Profiles, checking they are valid. Xcode'll throw up warning text if say, something is missing in Keychain.
Make sure your profile contains your iPod device UDID. Make sure that the certificate with which the profile is signed is installed in your keychain. Also make sure the bundle id in your profile and app info.plist match.
Outdated provisioning profiles can often be a problem. Click on your Project and your Target and then individually check the provisioning profile for each code signing identity (Ad Hoc, Debug, Release etc.) by actually clicking on it. Note that it might look like the right profile, but when you click on it, it appears at the bottom of the list in 'others'. This usually means XCode is referring to an older profile. Make sure you now select the current, up-to-date profile from the list above. It is best to check ever Code Signing Identity individually just to make sure.
Once done, I recommend cleaning the project and deleting the app from your device before running it again.
Also, check your profile in Organiser and make sure it has a Green Tick (Valid Profile) and in the Provisioning Portal to ensure the required device is included in the profile.
Go to Window -> Organizer -> Devices
and then go to the connected device's Provisioning Profiles tab.
Note the name of the currently valid profile (must have a green tick icon).
Click the project then go to Project -> Build Settings -> Code Signing
Then copy the appropriate profile name into the Code Signing Identity field.
Clean the project
Then run the program on the device
In one case, to solve this issue, I also had to add the provisioning profile on the iphone's provisioning profiles, available only on this phone, from Organizer>Devices. It is strange, because this device is the only one that require that action. (Anyway I'm Newbie)

iPhone application provisioning profile

I am working on my iphone application and it was working on the device. I don't know what I did but now it says "App cannot be installed on the device. Please install the provisioning profile abc_pop". When I say install and run then it says failed to run on device. what should i do. How can I reset everything. I know it was working before.
You should make sure you have the correct provisioning profile selected in your project settings. In XCode, go to Project->Edit Active Target, and then scroll down to "Code Signing Identity". Make sure that field has "abc_pop" selected, or, if not, then click on this field and select "abc_pop" from the list. Then try building again and see if it works.
Another possibility is that your provisioning profile may have expired. If this is the case, you'll need to renew it on http://developer.apple.com/iphone
Just from above, restarting Xcode often works. It's happened to me a number of times, doesn't always work though

iPhone -- renew team provisioning profile

In the provisioning portal, the "renew" button for my team provisioning profile is grayed out. And said profile is expired.
How can I renew it?
EDIT: I found the "automatic device provisioning" checkbox and "refresh" button in the organizer in Xcode. But when I select the team profile, check the checkbox, and push the refresh button, I get this message:
An unexpected error occurred. Please try again. If the problem persists, please contact Apple Developer Support (http://developer.apple.com/support).
I suppose I can go to support, but it would still be better to figure out what the problem is without involving them.
I had the same "unexpected error" issue with the Team Provisioning Profile when it expired. I fixed it by deleting it in the Xcode Organizer AND in the ADC Provisioning Portal, then hitting renew in Organizer.
Posting this again here..
OK, I had the same problem with the disabled 'Renew' button against my Team Provisioning Profile.
This worked for me.
1) Deleted the expired Team Provisioning Profile from the Xcode Organizer.
2) Deleted the same thing from the developer provisioning portal.
3) Again from Xcode organizer check marked the auto provision and clicked 'Refresh'. it asked for the credentials and in a few seconds added the renewed Team Provisioning Profile.
4) It also added the new profile in the developer provisioning portal.
Refresh and removing the iOS devices did not help on my installation.
But I found that the error messages was misleading. I am also member of the Mac developer program and after choosing "My Mac" under DEVICES and pressing the (+) Add to Portal button, the error message "Your team has no devices for which to generate a provisioning profile." did no longer appear.
So it looks like the error message covers the Mac and not iOS devices even that the URL at the end of the error message links to the iOS development center.
I had the issue that Xcode didn't refresh or renew it's managed Team Provisioning Profile and tried a very long time. I always hit refresh in the Library->Provisioning Profiles - section. Then I tried out the Teams section and after hitting the refrsh button there my Team Provisioning Profile which was managed by Xcode was renewed successfully. Hope this helps some of you.
One more thing: I used the same Apple-ID in three teams. So maybe Xcode failed to separate them while refreshing.
Do these things if you want to really solve the problem:
(1) Are you using the certificate for which you made provisional profile from your mac? Or you are using the certificate from other mac machine. If that is the thing then please get .p12 file from there and install in your keychain.
(2) If your certificate in the keychain is the same for which you made the provisional profile then it's fine. Otherwise you have to create new provisional profile for the certificate.
(3) Please make sure that you have set the app id in the target > properties > identifier. If no then please set and choose the provisional profile from the target > build > code signing identity.
(4) Then clean and build your project.
If you find any problem then please let me know. I would like to solve this problem.
I fixed it by signing into my Apple ID in XCode->Preferences->Accounts tab
Is the certificate it is based on expired? Did you delete the device it was for?
Try deleting the profile and click Refresh so Xcode re-adds it. Just a guess. I don't know why this would work, but it's worth a try.
Are you pressing the renew button from within Organizer in the latest Xcode version, 3.2.5 beta 3?
Here's the answer to compiling question, however, if anyone else has the answer to the team provisioning profile please post.
You can still compile apps for your device/simulator by creating a developer profile and downloading it to your device.
The key to getting it to work is to make sure the profile is selected in both the Edit Project and Edit Target Settings from the Project Menu. The Target Setting is more specific and usually screws people up. Making sure they are both in sync will help you get things up and running.
From these two menus, check the Build tab and make sure the developer profile is displayed. The default is iPhone Developer and should point to your downloaded profile.
Is there a problem using a different mobileprovision file? I believe you are getting the error on using a different provision file because your Target might be using the older one.
Try this
Get the new mobileprovision file and
in Project's Build properties, set
the mobileprovision to this one
Select the active target and in the
target's Build properties, ensure
that the same mobileprovision is
being used
Compile the app.
See if that helps.
As far as the Team Provisioning profile goes:
Does your console say anything? Are you using Xcode 3.2.5? I'd file a radar at http://bugreport.apple.com. Do you see the Team Provisioning file in the iOS Provisioning Portal? Does it have a green light?
You might try revoking it and letting Xcode create a new one.
As far as getting your app to work
You can always create an app-specific development profile. Choose your certificate and the app you are working on. Also make sure to select your device in the checkbox list.
Then download the profile (once it is ready) and double click on it to import it into Xcode.
If you look at the Xcode organizer, you should see your development profile in the list.
If it's red, that means your certificate has expired
If it's yellow, that means you don't have the private key present to sign using the selected certificate
In the project's Get Info window, under code signing, choose iPhone Developer for both pickers. Take a look at see which one is automatically selected (sometimes you have to manually choose the right one).
Then do a Clean & Build and you should be good to go.
I made the mistake of looking in Wrong place in Organizer.
On the left is LIBRARY then below that DEVICES
I had clicked on my Iphone under DEVICES > Prov profile.
No refresh button there.
Correct place is
On the left in ORGANIZER is Library > Provisioning Profiles
then Team provision Profile is here
Click on it and hit refresh if expired
As always.... "grep -ir profile ." and the cmd line are always your best friend when you want to fix an Apple frustrating, inconvenience and pain in the ass.... Spent almost an hour poking around xcode trying to find that option to enter the new provisioning profile number, and none to be found... Only when I grep'd for it, was I able to fix, yet another apple pain in the ass.... I can't tell you how many times I've spend hours going through xcode, stuck, because it won't compile because of some stupid invalid setting, profile or argument, only to fix it when I fell back on grep & ssed...
This worked for me:
start xcode.
Window->Organizer from menu
Choose "Provisioning Profiles" from DEVELOPMENT menu.
click refresh button
exit organizer
return to xcode main window.
Build->Clean from menu
build and run.
I fixed this by going to the portal and clicking "modify" on all expired profiles. Then click "select all" for devices and submit.

Code Sign Error When Building iPhone Application

I am new to iPhone development. I just registered with Apple for the iPhone Developer Program. When I try to build, I am receiving an error:
Code Sign error: a valid provisioning profile matching the application’s identifier could not be found
I'm not sure what is wrong. I tried browsing the Internet but I get confused. Can anyone help me with what I should do?
At first it seems a complex process, but it's pretty straightforward when you've been through it a few times.
In a nutshell the process is this:
(I'm assuming you've set up your iPhone/iPod touch as a test device)
Via the iPhone Developer Portal
Create an App ID
(give your application a name, this is just for reference on the website and nothing to do with your own build of your application)
enter a string to identify it, like com.yourcompany.appname
(this is important and should be the same as in your .plist file inside Xcode)
Click and Save this
Go to Provisioning
There are 2 provisioning profiles you'll need
a) development - so you can install your application on a test device (i.e. your iPhone / iPod touch)
b) distribution - if you want to sell the application via the App Store
You can create the profiles by selecting your App ID, created in the previous step, from the drop down list and clicking Save
In a few moments (usually, though it can be longer) the certificate is available for download. Download this to your Mac and drop it onto the Xcode icon. Sometimes the development profile doesn't work for me like this and I drop it directly into the Organiser window in Xcode that shows my connected device.
Besides, if you are in a team account, team admin need to edit Development Provisioning Profiles, and add modify your certificates privilege.
In Xcode inside 'Edit Project Settings' you can select the certificate you wish to code sign with. Usually for debug I sign with the development certificate. Follow the instructions on the apple site and clone the release profile and call it something like release and sign this with your distribution profile. (You won't be able to load the app onto your phone with the distribution profile selected)
Make sure you select the target device as Device and not Simulator when building for the App Store!
Hope that helps, it's from memory so apologies if I've skipped some small steps.
xcode top left corner make sure you're running as "similator" "iphone"
Did you set up an iPhone provisioning profile for either development, ad hoc distribution, or app store distribution?
If not go to the iPhone developer program portal, which is linked from the developer.apple.com/iphone. Apple has provided a great series of video tutorials.
Just make sure you install the certificates or the profile won't be selectable in the project configuration. When you download the certificates double-click on them to install.
Possibly more use for others seeing this issue on a previously configured dev environment.
This error is also shown if your provisioning profile has expired, in this case you can go through the steps in Neosionnach's answer or you can go to Organizer, click on the profile and click Refresh.
This was the winner for me when I had this issue.
As of July 2012, you can go here:
https://developer.apple.com/ios/manage/overview/index.action
Then launch the "Development Provisioning Assistant." It walks through all the steps outlined by FiddleMeRagged.
You can use this process to create a Wildcard ID, if you're just looking to test your app on your iOS device and don't need to deploy to the App Store right away.