Reinstalling provisioning profiles in XCode5 - iphone

I recently was forced to reinstall XCode5 to correct a problem in with Interface Builder. The reinstall corrected the issue but erased my provisioning profiles and now I am unable to test apps on a physical device.
From others' suggestions, I went to Preferences > Accounts > View Details... and clicked the Refresh button at the bottom left of the resulting window.
When I plug in a physical device, XCode does not list it in the available devices. In Organizer, each device that I use (an iPad and iPhone) shows a valid profile when connected. Each valid profile shows the correction expiration date.
What steps am I missing to get these devices recognized by XCode?
Thanks!

Try setting the provisioning profile of your app.
As shown in the image below, it needs to be set from 2 places (1 and 2)
Hope this helps!

Related

App cannot run on real iOS device but can run on the simulator

Previously, my app works fine on my iPad, However, yesterday Xcode started giving me this error as shown in the screenshot.
Does anyone know how to fix this? Please help me, thanks.
you need to create a provisioning profile in developer.apple.com if you dont have one yet.
then add the device to this provisioning profile by:
Login to your developer portal through developer.apple.com
Add the UDID in devices (you can retrieve it from Itunes from your
mac)
Go back to XCode, open up the Organizer and select
"Provisioning Profiles", ensure that "Automatic Device Provisioning"
is checked on the top right pane, then click on the "Refresh"
button, and magically all your devices set in the provisioning
portal will be automatically added.
After doing these steps try again run your app it should work

I dont see any Provisioning Profile on my code sign part of configuration XCODE 4.3.1

I Have a strange problem in my xCode, im the par of code signing i dont see any profile and even more i dont get the small arrows
in keychain i have my things you can see it in the picture
In my Organizer i see my profile but in xcode in the code signing section i got stacked with an old profile and dont see any other, and dont have the little arrows that allow to choose profile
i have draged and import my profile to my device and restarted xCode and no luck i m adding the picture
Have you imported the new profile using organizer. You need to import the Profile to your project also. you can do it from
Organizers > Devices > Library section > Provisioning Profiles >
Import (at the bottom)
Now they will appear in your project code signing.
The last image you provide are the provisioning profiles for the device you have plugged in. Select "Provisioning Profiles" under the "Library" section and drag the profile into the main window there. Should solve your problem.

cannot get app onto iphone to test

Im trying to test my first iphone app on a device. ive been through the walkthrough in the apple development portal that takes you through creating certificates, installing them and creating provisioner profile for the phone and installing it onto the phone. all was going well until i got to the end when it told me to select my device (that is connected to the mac) from the drop down menu in the top left of xcode then build and run the app. My device wasnt listed, i had two simulators and one that just said IOS device, i tried building to the 'IOS device' one and it built successfully but nothing was showing on the phone. So i tried googling the problem where someone suggested restarting, after i restarted i tried building again but got this error:
Code Sign error: The identity 'iPhone Distribution' doesn't match any valid certificate/private key pair in the default keychain
now i generated the everything from the same mac so i dont understand how the key pair doesnt match up. Help!?
I was getting the samething. Have a look on iOS provisioning portal page under provisioning profiles. You might have an out of date profile? If not open xcode and go to the organizer window under the window menu and look at your profiles. It could even be that you havn't added the device to the provisioning profile. sorry if im not making sense there are just alot of things to check.
iOS Provisioning Page

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.

Adding devices to team provisioning profile

I need to add a device to my team provisioning profile, however I do not physically have the device so I can't hook it up to my computer so Xcode can't add the UDID to my devices and to the team provisioning profile. Is there a way to add it manually to the team provisioning profile, I can't figure out how to edit it. Also when I add the device in my provisioning portal it doesn't get added to my team provisioning profile automatically.
This worked for me:
Login to your iPhone provisioning portal through https://developer.apple.com
Add the UDID in devices
Go back to Xcode, open up the Organizer and select "Provisioning Profiles", ensure that "Automatic Device Provisioning" is checked on the top right pane, then click on the "Refresh" button, and magically all your devices set in the provisioning portal will be automatically added.
right click on the device, then select 'add device to provisioning profile'
For Xcode 6 it is a little different.
After adding the device UDID in the developer site (https://developer.apple.com/account/ios/device/deviceList.action), go back to Xcode.
Xcode -> Preferences -> Accounts
Select the Apple ID you added the device under and in the bottom right, click "View Details..."
Hit the refresh icon on the bottom left and then try to run the app again.
Per May 16th 2013, using XCode 4.6.2, I had to do the following to add a device (which I do not have physical access to) to the team provisioning profile:
Login to the provisioning portal through developer.apple.com
Add the UDID in Devices
Select the Team Provisioning profile in Provisioning Profiles
Click the Edit button
And under devices for that provisioning profile, click Select All, or just the devices you want included.
Click Generate
Then go back to XCode and click refresh icon (bottom right) under Organizer -> Devices -> Provisioning Profiles
Sometimes it takes a while before the certificate is updated and fetched from XCode.
Hope this helps new readers.
I faced multiple time the same issue that I add device info to portal so I can publish build to fabric testing but device is still missing due to how Xcode is not updating team provisioning profile.
So based on other answers and my own experience, the best and quickest way is to remove all Provisioning profiles manually by command line while automatic signing will download them again with updated devices.
If this can lead to some unknown issues I don't know and highly doubt, but it works for me just fine.
So just:
cd ~/Library/MobileDevice/Provisioning\ Profiles/
rm *
And try again...
Workaround for adding a device to an existing (automatically or manually created) provisioning profile (tested in Xcode 8.2.1):
Add the device in the developer portal.
Only when using a manually created profile: add the device to the profile.
In Xcode, go to Xcode > Preferences > "Accounts" tab > select your Apple ID (left pane) > double click on your Team Name.
Locate the existing provisioning profile. (automatically created profiles will begin with 'iOS Team Provisioning Profile' or 'XC iOS' or similar.
Right click on the profile.
Choose 'Move to Trash'.
The profile will disappear. A new profile with the same name might appear again, that is OK.
Xcode should now be aware of the newly added device.
Get the UDID from iTunes:
http://www.innerfence.com/howto/find-iphone-unique-device-identifier-udid
Once you have that:
Login to your iphone provisioning portal through developer.apple.com
Add the UDID in devices.
Add the device to the provisioning profile.
Download the profile again and enjoy.
There are two types of provisioning profiles.
development and
distribution
When app is live on app store then distribution profiles works and do not need any devices to be added.
Only development profiles need to add devices.In order to do so these are the steps-
Login to developer.apple.com member centre.
Go to Certificates, Identifiers & Profiles.
Get UDID of your device and add it in the devices.
Select a developer provisioning profile and edit it.
Click on check box next to the device you just added.
Generate and download the profile.
Double click on it to install it.
Connect your device and retry.
This worked for me hope it works for you.
Note that testers are no longer added via UUID in the new Apple TestFlight.
Test Flight builds now require an App Store Distribution Provisioning Profile. The portal does not allow UUIDs to be added to this type of provisioning profile.
Instead, add "Internal Testers" via iTunes Connect:
Internal testers are iTunes Connect users with the Admin or Technical role. They can be added in Users and Roles.
After adding a user, be sure to click on their name and flip the "Internal Tester" switch.
Then, go to App > Prerelease > Internal Testers and invite them to the build.
Login to your iPhone provisioning portal through developer.apple.com
Add the UDID in devices
Go to Provisioning Profile sections. Click on your provisioning profile, click on Edit.
In Device section select your added device and generate provisioning certificate again.
Download it and double click. It will automatically added in your Xcode.
To check UDID present in .ipa file or not. Generate .ipa file and upload on diawi.com, get diawi link and hit on Safari browser. You can check their how many UDID are integrated in generated .ipa.
After you've added the UDID to the devices in Provisioning Portal manually, you should trick Xcode into generating a new Team Provisioning Profile (with the newly added device included). Follow these steps:
Open Organizer > Devices > Library > Provisioning Profiles. Find the existing (old) profile (that does not include the newly added device). Delete it.
Connect one of your own devices. Right-click on it in Organizer > Devices > Devices. Choose 'Add Device to Provisioning Portal'.
This will trick Xcode into generating a new Team Provisioning Profile, which automatically includes devices you've added in Provisioning Portal.
If you have recently created new provisioning profiles, you will have to disconnect your phone, close XCode. Then open XCode, refresh your accounts then build and deploy at least once to your phone.
After adding UDID in developer.apple.com, do the following steps:
1, Go to Xcode, open Preferences (cmd + ,) -> Accounts -> Click your Apple ID -> View Details
2, In the new window, click on "Refresh", then "Request"
3, Now try to run your app on the new device, if you get an error saying "unfound provisioning profile", keep reading
4, Click on your project
6, Find "Fix It" button in Identity section, click it
7, Now try to run again, it should work
Update for Xcode (Version 9.1). Please follow below steps for refreshing Provisioning profiles
Using Xcode Organizer
Select Export
Select desired distribution facility
Now Select Automatically Manage Signing Identity
In next Screen Please click on Profile tag detail discloser button which will navigate you to Provisioning profile Folder
Select all profiles and trash them. Now in Xcode click on the Previous button and click again on Automatically Manage Signing, Now Xcode will create new signing identity for you with latest features (including new device id's)
In short, you can navigate to MobileDevice/Provisioning Profiles/ folder path and delete all profiles and then Archive. Now you can see there are new profiles for you. Cheers :)
#JasonH hope it will help you.
Now for Xcode 12.5
You need to create a new Apple Distribution Certificates
Go to Xcode Preference
Click Account, choose your Team you want to update
Click Manage Certificates
Click + Apple Distribution Certificates
Go to Keychain and delete the old certificate
This is what worked for me in XCode 7.3
Login to developer.apple.com
Add the device.
Head straight back to XCode (DO NOTHING) and create the .ipa
Install the build on the device, it will work.
I have no idea how this worked since I didn't download a new provisioning profile which included the newly added device, neither did I touch anything in XCode after adding the new device. That's Apple magic for you.
I will try to add an explanation to this if I find one.
As of Sept 2018, Apple seems to (or a bug) block the normal way to get your XS and XS Max's UDID. Even XCode could not properly register new phones for you.
After a couple hours of digging, I figure it out:
Connect your iPhone to your Mac.
Navigate to  -> About This Mac.
Click on System Report and select USB.
Click on iPhone, and copy the value next to the Serial Number label.
Copy and paste the value. You then need to add a – after the 8th digit.
This is the UDID for the iPhone XS and iPhone XS Max.
Source
All answers I've seen above assumed that the developer owns an iPhone. No one knows the right answer. As far as I know, you need:
a physical iPhone that you own
or UDID of someone else's iPhone.
But it is a must to have an iPhone before you publish your app. Correct me if I am wrong.
login to developer account of apple and open the provision profile that you have selected in settings and add the device . The device will automatically displayed if connected to PC.
Xcode 10.3
In finder navigate to: MobileDevice/Provisioning Profiles/
and delete all files there.
Then Archive and Automatically manage singing.
You are done!