Adding devices to team provisioning profile - iphone

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!

Related

No Identity with Provisioning Profile in XCode

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.

Do you have to re-archive your project after adding devices to the provisioning profile?

Say you have an existing provisioning profile with some devices and you archive a target with that provisioning profile. Then, you go into Member Center and add some more devices to the profile. Do you have to re-download/re-archive the project in order for those devices to install the target app?
No, as long as the name of the profile is the same, you can now distribute apps that include it to the new devices, as long as the new devices get the provisioning profile that includes their device ID.
Edit: A note of further explanation. Your archived app does not store the provisioning profile in its archive. You merely tell it what provisioning profile to look for in order to determine if it can run on a certain device. Therefore you can change your provisioning profiles all you want, and as long as it is the same profile the app is told to look for, you never have to recompile the app to recognize new devices.
Yes, if not - how can the previous profile know that you have added more devices to it ?
You have to delete the old profile in organizer and then you need to download freshly the same profile which is configured with new devices.
Note: don't forget to check the code signing in your project settings after installing the new profile.
(OR)
If you have already configured your iOS Developer Network profile in your system,
Just press the refresh button at the bottom right of your organizer
Yes the new profile will have to be built into your app for it to work with the devices added.
You have to download again the profile (or let XCode do the work for you).
You do not have to re-archive. Just share existing archive BUT sign-again with the new/updated profile.

iOS - What is the procedure for updating a provisioning profile in Xcode

It seems like every time I update my provisioning profile, my xcode project still ends up pointing at the previous profile (I get "Code Sign Error: Provisioning Profile (long string) can't be found.") This means I have to manually do a search and replace on my profile codes in the project as described here: Codesign error: Provisioning profile cannot be found after deleting expired profile
I have to think I'm doing something wrong as this happens every time... what is the procedure for adding in a device to a profile, exporting the profile, and getting my project updated with the new profile?
thanks
In XCode 5 you have to go to Preferences -> Apple ID -> View Details and then press the small refresh button to the bottom left. This will update all of your current provisioning profiles.
(optional) Delete old profile in Organizer/Provisioning Profiles(if not used anymore, e.g only new device added)
Add New Profile in Organizer/Provisioning Profiles (Drag&Drop)
If you run Xcode 4, be sure to change profiles for project AND targets
... Sometimes you have to re-open project or even re-start XCode (don't know when or why).
UPDATE:
It turns out, it's better to download the new/changed provisioning profile from developer portal and double click it in Finder. Mac will install it in the right place and you don't have to do the acrobatic stuff in the bottom.
ORIGINAL:
For Xcode 7.1, you have to do the following:
Open Preferences > Accounts
Remove the dev account in question.
Add the account again.
Click "View Details" on the account.
Click "Download All" at the bottom.
This will remove all local cache, then fetch the profiles from the server.
I just had a blast with this when I tried adding a device to a provisioning profile for testing. Thanks for making it so hard, Apple!
I just delete the previous provisions from my organizer before adding in the new one with the additional devices just added.

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.