How to add a device to provisioning profile automatically? - ios

I want to allow my users to install my iOS app with ad-hoc distribution. I want to get their UDIDs and add them to the provisioning profile automatically. I know how to do it manually in the developer portal but what I need is an api to do this process automatically not manually.
Does apple provide any api or other means to add devices to provisioning profile automatically?
(Note that I do not have any device available. I just have their UDIDs)

Xcode will automatically add your devices into your provisioning profile. You will see a warning about that on xcode. You can click "Register" button on it.

Try the below steps
Login to your iphone provisioning portal through 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.

Related

Distributing to client via IPA with UDIDs?

A client is asking me to send an IPA file to them.
"You can send the file via email and it can be installed as a developer device"
I tested creating an IPA file for the project and archived it allowing XCode to automatically manage signing. This, as expected, only has my one device's UDID stored in the IPA.
I've gone into the apple developer portal and created an Ad-Hoc provisioning profile for this app. I am not seeing how to add in devices to the profile. When I go to edit the profile, the devices only show the option to select iPhone, Mac, or both.
I'm using Testflight, but the client also wants the IPA.
How can I correctly create an IPA file of my project with the provided device UDIDs?
Log into your apple account and go inside "Certificates, IDs and Profiles" section. There you'll see a section named "Devices", select the option "All" under it. Now you'll see + button top right corner, press it and add the udid of your client and name that device whatever you want and press continue.
Now open your xcode,
press the small i button in front of provisioning profile and drag and drop your provisioning profile (circled in black) anywhere on your desktop. Check the name of your provisioning profile and now go to Library / MobileDevice / ProvisioningProfiles. There you'll see all your provisioning profiles. Now just delete the one that has same name as the one that you just dropped on the desktop. After that Xcode will automatically generate the new provisioning profile for you with all the newly added udids inside it. Now you can archieve your project and generate the ipa file. It will now run on your client's device.
P.S. instead of doing all this you can also generate a new provisioning profile from your apple account and double click on it to insert it into xcode.

Add new device to provisioning profile automatically managed by Xcode

I've gt a question regarding Xcode automatically manage signing. Lets say my client wanted to add new device UDID so that device can be used for testing the app. I then added the device UDID in developer.apple.com. Now how do I confirm that the new device is already added to the provisioning profile that is automatically managed by Xcode?
I'm not in possession of the physical device, only the UDID. I'm using Xcode 8.3
Once you added the UDID to Devices, you can go to your project's Provisioning Profile, then you can see the devices amount, if it is not correct, you can click Edit to select the device.
If you're distributing your project via adhoc, then as you already know, UDIDs of the devices that will need to install your project will need to be registered to the distribution provisioning profile on developer.apple.com.
Now how do I confirm that the new device is already added to the provisioning profile that is automatically managed by Xcode?
Go to your Xcode and to your Project's General settings. Check the Signing section and click on the Provisioning Profile i button. You will see the devices included in that provisioning profile.

Automatically refresh IOS devices in a team provisioning profile by Xcode

I have some IOS devices week by week to which I must send my apps for testing purposes during development. These devices can't be pluuged to my computer, because they are far away from me and just for this case they won't be taken to my local machine. If plugging would be available, my life would be much easier. But it is not the case.
Now I have to do a lot of annoying things by hand: add it, regenereate it, delete it from local machine, add to new one etc etc.
After adding a device to my devices in Apple developer portal I'd like to have it in XCode without regenerating certificate, delete, download to my local machine. There should be some automatic refresh process.
Before XCode 4.5 there was an option in organizer to refresh it automatically by Xcode.
What about in the current XCode version?
In Xcode 4.5 same option to refresh is available.
Steps To create Ad hoc Profile which is to be followed before the above process is done.
Check this.
Steps to refresh profile.
1.In developer portal Add device.
2.Update Developer provisioning profile by adding the device to the profile.
3.Open Xcode> Organiser >Devices
4.Delete the old profile
You will find a refresh button at the button click refresh.
Clean the project and Archive it.
Send it to user, It will work on the new Device.
#TechFanatic's solution didn't work for me.
What did work was for me was:
From XCode, select XCode > Preferences.
Click the "Accounts" tab.
Select your account.
Click the "View Details..." button.
Click the refresh button in the lower left corner.
This comes from the section "Refreshing Provisioning Profiles in Xcode" in Apple's documentation.
EDIT: This no longer works in XCode 7. There is no "refresh" button that I have found anywhere in XCode 7. If you find one, please provide that answer. In the meanwhile, there is a solution of sorts - you delete and recreate the managed profile.
Specifically, if you are doing an Ad Hoc build:
In the member center, delete the "iOS Team Provisioning Profile" for your app. Do not delete the "XC Ad Hoc" provisioning profile.
In XCode, in the XCode > Preferences menu, in the "Accounts" tab, under "View Details..." for your account, delete the "iOS Team Provisioning Profile" for your app by right-clicking and selecting "Move to Trash".
In the "General" tab for your Target, there will be a "Fix Issue" button. Click it.
Don't worry that the member center now says that your XC Ad Hoc provisioning profile is now invalid. That will fix itself in a later step.
Build your app.
Archive your app.
Export your app from the "Organizer".
Select "Save for Ad Hoc Deployment".
XCode will complain that your provisioning profile doesn't match or some such. Click the "Reset" button and then click "Try Again".
XCode should continue and create an .ipa file.
In the member center, your XC Ad Hoc provisioning profile will show up as active again.
Simple, right?

How to add a new device to a team provisioning profile

I have a new device for our app to be tested on, so I added it to the provisioning portal.
There are currently two development provisioning profiles - however the provisioning portal will not let me edit the team provisioning profile in order to add the new device.
- But I'm sure this something I've done before as I've previously added new devices as they arrived to enable testing with them.
How can I add the new device if the profile isn't editable? (
(The limit has not been reached, there's only several devices in the portal in total).
For Xcode 5 :
From the Xcode menu select preferences>>Accounts, Select your Apple ID then select Details...
You will get a popup with your Signing Identities and Provisioning Profiles.
Click the Refresh button in the bottom left and the iOS Team Provisioning Profiles get re-generated and downloaded.
You don't have to edit it, click Refresh in Xcode Organizer to make it generate a new one for you automatically.
For new XCode 5 & Xcode 6
Adding Device UDID to Provisioning Profile on developer.apple.com
Login to iOS dev center and go to Device section under 'Certificates, Identifiers & Profiles'
Add new Device using UDID
Update Provisioning profile with newly added Device
Once you have added the device and need to update your developer provision profile
Select newly added device in provisioning profile and click Generate
Update XCode with Updated Provisioning Profile
Finally goto XCode --> Preferences --> Accounts --> ViewDetails -->Refresh -->Done
That's All Go for Clean and Build now.
Cheers!!
On XCode 7 the answers here are inapplicable. https://stackoverflow.com/a/32725552/1449799 should work (delete the profiles in xcode, and tell it to download them again), BUT unlike the instructions at the link, for XCode Version 7.2.1 (7C1002), you (or at least I) cannot select multiple profiles at once.
Open the Organizer window in Xcode. With your device plugged in to the computer, select your device in the Organizer.
In the area detailing your device's specs, click the button titled "Use for Development". You may need to log in to your Apple Developer profile. Once that's done, your device should be listed as part of the provisioning profile and have the profile installed.

ios: How do I add a new UDID to provisioning profile without a tethered device?

I know how to add from the web portal, but this particular provisioning profile is marked as "Managed by Xcode", therefore, I need to either stop managing from xcode or add a UDID into the profile from Xcode.
I cannot find any way to "stop managing" in Xcode.
In Xcode, I know how to add the device by tethering to my laptop and refreshing, but I don't see any option to add a UDID.
Here is what worked (multiple times now) ...
(Web) Login to Apple Developer > Member Center > iOS Provisioning > Add Devices
Add UDID with a meaningful name
Create a Provisioning Profile that includes all of your registered devices
(Xcode) Go back to the Organizer
Select the Provisioning Profiles section and select the specific profile
Check the box "Automatic Device Provisioning"
Press the Refresh button
Voila!
If you simply add the device's UDID to the developer portal, it will be automatically be added to ALL provisioning profiles. You can confirm this by downloading the profile and inspecting it (in plain text editor).
Go to: https://developer.apple.com/account/ios/profile/edit
Click All
Pick profile
Click edit
Select missing device
Click generate
Go to Xcode -> Preferences -> Accounts
Select your account and click View Details
Click Download All
Connect the phone to your mac and open XCode. Then click under Window->Organizer under Devices you must see your connected phone. There is an Button named "use for Development". Click this and after a few seconds the UDID must be in your team profile and you can install the app.
IMO you cant add devices to your team-provisioning-profile without connected to your mac, if this profile is managed by xcode. Alternative make an ad-hoc-provisioning-profile.
Hope that helps?

Resources