How to Remove/Disable Provisioning Profile Expiration Warning - iphone

I have a few provisioning profiles on my iPhone/iPad device.
Every day it annoys me with the following messagebox:
"Provisioning Profile Expiration: The provisioning profile X will expire in Y days"
With two buttons: "Show Me" and "Remind Me"... regardless what I pick it'll pop up within another day or so.
Is there a way to disable these warnings? I don't want to see them at all!
Thanks

iPCU no longer works for me and from what I can tell is deprecated. For XCode 6.1 I was able to delete specific provision profiles from devices under Window > Devices:

On your iphone Go to Settings, then General, then scroll down until you see the name of the offending provision, the click it and chose delete. :)

I have run into this problem as well. The best way to remove them, without XCode installed, is to use the iphone configuration utility. You can download this for Mac or PC. Your device must be plugged in in order to do this.
Here is a picture of using the iphone configuration utility to delete provisioning profiles:
Note that this is not the only way.
If you have XCode installed, I would recommend using organizer to delete the provisioning profiles. In Organizer, select the "Devices" list. Then choose your device (must be plugged in). Then choose "Provisioning Profiles" under your device. From here you can make multiple selections (hold shift key) and then hit delete key to remove them.

Remove that profiles.
Ask the developer of that apps to renew that profiles, ask to send them to you and update them on your device
If you choose first variant then you won't be able to launch apps that are bound to that profiles.

Either delete them if you aren't using them, or renew them. I don't think there is a way to supress this message.

Revoke, then create a new Provisioning Profile from the iOS Dev Center. This should extend the expiration date to a year or so from the day you make a new profile.
Check to make sure you dont have duplicate certs/private keys in all keychains.

Related

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)

The entitlements specified...profile. (0xE8008016). Error iOS 4.2

I am getting the 'dreaded' error The entitlements specified in your application’s Code Signing Entitlements file do not match those specified in your provisioning profile.
(0xE8008016). when trying to deploy my first app to an un-jailbroken device on iOS 4.2.6 (Verizon). The thing is, I do not have a Entitlements file in my project, as I am not distributing it at all, only putting it on one device. I have gone through all the hoops and loops apple puts you through (certificate, device, provisioning) down to the letter, and I cannot figure out what is going wrong.
Can anyone please help me with this problem?
Just came across this issue myself, the problem was that I had a Entitlements.plist file in the project as part of an ad hoc distribution, and its get-task-allow (ie. 'can be debugged') property was set to NO - setting this to YES fixed the issue and allowed the app to run from Xcode4 on the device in development.
Naturally need to set it back to NO for ad hoc distributions, but just thought I'd mention it in case anyone else comes across the same problem.
I had this issue with Xcode 4.2.1.
For me it was nothing to do with Entitlements file, or Ad-hoc...
I was returning to and old project, and I'd forgotten to add my new iPhone to the provision.
Silly mistake, but also a silly corresponding error message... :-/
If you're using react-native, make sure that the Test target has the same provisioning profile as the main one.
I've had this issue with the iCloud entitlements. My problem was that I forgot to enable iCloud for my App ID in the Provisioning Portal.
After enabling iCloud for your App ID, you will need to recreate the provisioning profiles.
Keep your entitlements file in Target> Build Settings > Code Signing > Code Signing Entitlements.
Go to Target > Capabilities.
Toggle On/Off or Off/On one of the capabilities.
Run.
What worked for me was to completely delete the entitlements file, from the groups list, and from the Build Settings in both Project and Target. Then I recreated the entitlements from the Summary tab in the target, and it loaded fine without any error messages.
Just putting in my 5 cents here. For me none of the above worked, so I was forced to stress down and actually look at every part of the process with fresh eyes.
In rushing this I forgot that I was trying to install my app on a totally new device.
So my error was that I hadn't updated my provisioning profile by ticking off my new device int the "Devices" section of the provisioning profile setup in the Provisioning Portal.
Apparently not including your device in the provisioning profile also generates this error message.
None of the many answers fixed the 0xE8008016 Error for me.
But when I chose "Automatic Device Provisioning" in Xcode 4 > Organizer > Devices > Provisioning Profiles, it finally worked.
In my case it was a stupid mistake. I incorrectly set the "Run" scheme to use the "Distribution" build configuration instead of the "Debug" or "Release" one.
Stupid mistake, but it took a while to debug it, so I'm going to add my answer to improve the knowledge base inside stack overflow!
Delete your provisioning profiles, do a 'Clean All', make sure that your provisioning setting are correct, redownload, and try to run again.
Open 'iOS Provisioning Portal' in Safari.
Tap 'Devices' in the sidebar.
Register your device's UDID
Tap 'Provisioning Profiles'
Edit your apps profile.
Select the device your have just added.
Download the .mobileprovision file.
Install it.
Build again.
I had the same problem in my app, after a few month this specific app worked fine.
The problem was that the Capabilities configured in my Xcode project (under Targets -> {ProjectName} -> Capabilities) were not the same as the Capabilities configured in the provisioning profile (you can check that in the Apple member centre under Identifier -> App Ids -> {your app ID}. In the member centre I saw that Game Center is enabled and so in my project I also enabled Game Center. Then the app was able to launch.
I don't know how it worked until now. That's still a mystery :)
For me check the "Automatically manage signing" option in Target solve the problem!
Upgrading to XCode 4 fixed the issue.
Deleting the xcuserdata folder solved my issue. More on that here: https://stackoverflow.com/a/9968884/300694
If you didn't change anything related to certificates (didn't replace or update them) just do a Product -> Clean. It helped me several times. (Xcode 6.2)
I ran into this problem today and I was pulling my hair out trying to figure it out. Like many people here, it would work if I removed the iCloud options in my entitlement file. When I would go to debug the app with the iCloud options enabled then I would get the 0xe8008016 error. This was right after revoking and regenerating new certificates.
So what solved it for me was to turn on iCloud support for the automatically generated Xcode team profile. Log onto the online provisioning tool, go to App IDs, click on Xcode iOS Wildcard App ID, click on edit, enable iCloud by checking the checkbox, and finally clicking Done. Refresh your profiles in Xcode and then it will start to work.
This makes some sense - when you're debugging it defaults to the team profile and the team profile needs to have iCloud turned on.
Happened to me when I was trying to use an app store distribution provisioning profile for local test by mistake. When I used the proper development profile it worked just fine. Maybe this helps somebody too.
This worked for me...
I deleted the Entitlements file from the target.
Deleted the app off all my devices
Cleaned the build in Xcode
*optional delete the provisioning profile and re-add it
Hope it works for you guys too :)
This is what solved my problem: Deleting the path in the Code Signing Entitlements section of the Targets build settings.
My provisioning profile from Apple developer matched my Xcode capabilities but it still wouldn't build onto my device until I did the following:
Remove/Delete the entitlements file from your Xcode project.
Go back to the Xcode capabilities tab
Hit "Fix Issue" button to get Xcode to re-add the entitlements file.
Worked for me, hope it helps someone.
Happened to me on Xcode 8, it was partially caused by the new Provisioning Profile build setting, as in this Xcode version there are two entries for provisioning profile:
Provisioning Profile
Provisioning Profile (Deprecated)
My fault was that I updated only the first one, and the deprecated entry was still pointing to an invalid provisioning profile. Changing both to the same value solved the issue (clearing the deprecated entry should also have the same effect).
In my case, it looks like Xcode (secretly) reset the Scheme.
I found that the build configuration for Archive was set to Release instead of distribution one, and after I changed it to the correct one, it worked.
I think it is better to check the Schemes as well as the build settings.
I had old project and same problem and I solved .
1.Go to summary
2.Summary have keychain groups and delete keychanin
groups's object.
I hope it's will work for you .
Regards.
i'm using xcode 6 and encounter this issue for one particular iphone 4
finally , i go to device => provision profile =>
and then add the profile manually and problem is fixed .
For me in Xcode 5.1 I was getting The entitlements specified in your application’s Code Signing Entitlements file do not match those specified in your provisioning profile. when trying to test the app on my device. Device Development Certificate has to expire Feb 2015.
Issue was resolved:
Selected Target->Capabilities, under GameCenter, here I was getting error on GameCenter entitlement as it was not added to project, although first version of application was released via same XCode 5.1 but there were no errors like this before.
Below, a button was given with title Fix Issue. When clicked it added the GameCenter entitlement and issue was resolved.
After wards the screen looks like:
For me, there was nothing to do with certificate. App now runs successfully on the device.
One more potential problem that will throw this error message: If you're using a perfectly valid provisioning profile for you main app, but have an expired or otherwise invalid provisioning profile for your Today widget extension. I imagine it'd be the same for an Apple watch extension as well.
Check all the profiles!
Check KeyChain Access!
In my case I was using the wrong distribution certificate associated with the provisioning profile.
The code I was working on had a different bundleid in the Info-plist than in the Product Bundle Identifier build setting.
I found this because I noticed this message in the device console in the devices view:
MIS: entitlement 'application-identifier' has value not permitted by provisioning profile 'iOS Team Provisioning Profile: com.xxx.yyy'
If you are trying to activate iCloud syncing, you will need to enable iCloud for the AppID that is used to create the development provisioning profile (which Xcode does automatically). You'll also need to enable this for distribution profiles as well.
The tricky part is that when you refresh profiles in Xcode, this does not trigger a renewal of the profiles; they are simply re-downloaded. So in your iOS Provisioning Portal under Provisioning/Development, you'll need to check the profile that is labeled (Managed by Xcode) and delete it (Remove Selected button). Do this for ALL profiles, development & distribution, that you need to regenerate.
Now, in Xcode in the Organizer, delete provisioning profiles that you are about to replace.
Now to get new ones. If you develop for more than one team and only want to refresh a particular one, select the appropriate Team in the left pane under TEAMS, otherwise select Provisioning Profiles under LIBRARY, then select Refresh.
Finally, remove any old provisioning profiles on your device that could conflict with the new ones since profiles are never deleted automatically; newer profiles are simply added to the list.

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.

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!