79

It used to be that hitting the refresh arrow/loop button in preferences -> account would pull down a new provisioning profile with all ur new devices.

Now it just downloads the ones you already have. But if the one you need updated is managed by Xcode, theres's no way I can find to add a device to it!

mfaani
  • 33,269
  • 19
  • 164
  • 293
Will Larche
  • 3,119
  • 7
  • 26
  • 34

14 Answers14

124

Here's what worked for me on Xcode 8 & 9.

  1. Add your device to developer.apple.com.
  2. Go to your target's General tab and tap the (i) next to "Xcode Managed Profile", then drag the profile file icon in that popover to your desktop to get the filename of the provisioning profile. enter image description here
  3. Go to ~/Library/MobileDevice/Provisioning Profiles and delete the provisioning profile with the same filename that you got in #2.
  4. Xcode should regenerate the profile for your app with the device added in #1.

My account on developer.apple.com was not showing any Xcode managed profiles so this was the only way to make it work.

yood
  • 6,650
  • 3
  • 26
  • 24
  • 1
    This finally did it for me after adding devices for Fabric/Crashlytics Beta distribution. It's a shame their "Beta Walkthrough" documentation page still doesn't reflect this difference in Xcode 8. Thank you. – Eugene Jul 25 '17 at 16:39
  • 1. yup just added the device developer.apple.com 2. download the profile 3. re-import it in the General tab (click on the dropdown under Signing Debug and choose import profile) ...that should include the newly added device. – greaterKing Jul 28 '17 at 13:54
  • Love you @yood, I was struggling me with that hidden provisioning profile :) – Kevin Machado Sep 20 '17 at 12:50
  • That works. But how do I refresh the 7 days whenever I want? It's a pain to wait for the certificates to expire, I'd like to automate it running a script daily (it's for Kodi on Apple TV 4K). – Michele Dall'Agata Feb 04 '18 at 08:02
  • Worked for Fabric/Crashlytics/Beta on XCode 9. Thanks –  Sep 17 '18 at 21:20
  • I got this to work in Xcode 10 / Mojave by just deleting everything in ~/Library/MobileDevice/Provisioning Profiles. None of them had recognizable names. But by deleting all, Xcode fixed it and it works now. 2 hours of my day wasted. – Jackson Nov 16 '18 at 05:52
  • You can just move this file to Safari in URL field and it will open it for you in Finder – Ilya Ilin May 24 '19 at 18:09
86

Simplest way:

Remove the mobileprovision file using terminal

rm + drag the file path from xcode

enter image description here

Musa almatri
  • 5,596
  • 2
  • 34
  • 33
  • 4
    This is the fastest way to do it. After removing, just go back to Xcode and it will re-create the profile with the new devices. – Jonathan Cabrera Oct 02 '18 at 20:05
  • Somehow Xcode 10 was not creating the ~ `iOS Team Provisioning Profile: com.xyz.appname` for one of our project. Your solution worked fine! Thank you :) – balazs630 Feb 15 '19 at 17:21
  • This seems to be the only reliable way to do this even as of XCode 11, and it's just maddening that it's so hacky. Why on earth doesn't XCode give you a way to just refresh the automatic profiles? It seems like such an obvious need – Danny Jun 03 '20 at 20:15
  • Worked for me for **XCode 14**, I just had to uncheck and check again the 'Automatically manage signing' option to force XCode updating the provisioning file, that didn't work automatically in my case. – jr_gen Jul 31 '23 at 13:40
42

After adding the UDID in the member center I had the same issue. I have to say that I have a XCode managed iOS team development profile.

eventually what's worked is deleting the provisioning profile from the member center.

in xcode preferences, delete the team provisioning profile for the relevant app

go to your target, you'll see a "Fix Issue" button. click it, it will generate a new provisioning profile with the relevant devices.

Hope it helps.

Youval Vaknin
  • 611
  • 6
  • 11
  • 1
    Yeah. This does indeed work. 2 steps forward, 1 step back :) – Will Larche Sep 28 '15 at 00:29
  • 1
    Thanks! Out of all the solutions online this is the real one. – Eric Chen Sep 28 '15 at 16:35
  • 1
    an update to this answer: this could be a new thing with the latest update to XCode 7 (version 7.0.1 (7A1001) ) but there isn't an option to delete provisioning profiles anymore. If you right-click on them nothing happens. The way I finally managed to get it to add my device to a provisioning profile was by deploying a test project to it. XCode then prompted me saying the device doesn't belong to any provisioning profiles and gave me the "Fix Issue" option. By the way, it wasn't enough to just hit fix issue, I had to actually let it finish deploy the test application on it – Matheus Guimaraes Oct 08 '15 at 23:04
  • @MatheusGuimaraes - I can still send the profiles to trash on build 7A1001. maybe it's an admin account issue on you mac? – Youval Vaknin Oct 10 '15 at 08:25
15

I also had this problem. I am using Xcode 7.2. Then its worked with following steps:

  1. Add you new device UDID in the Member Center
  2. Take Xcode -> Preference...
  3. Select account and press 'View Details...'
  4. Press 'Download All' button in bottom-left corner. New set of Team Provisioning Profiles will be downloaded.
  5. Now you can delete the old Team Provisioning Profiles from the list. (Right click -> Move to Trash)
  6. Update Provisioning Profile in 'Build Settings' Tab
  7. Press 'Fix Issue' button in 'General' Tab

Now you can run the app in your new device.

Anusha Kottiyal
  • 3,855
  • 3
  • 28
  • 45
  • 3
    As an alternative to downloading all the profiles and then deleting old profiles one-at-a-time with a right click, you can right-click any old provisioning profile and select "Show in Finder", (quit Xcode), shift-select all of the profiles in Finder and drag them into Trash (or right-click and select "Move to Trash"), (restart Xcode), and then download just the profiles you want/need. (Not certain if quitting/restarting Xcode is necessary, but better safe than sorry.) – Mark A. Durham Feb 25 '16 at 15:57
  • For me, steps 1-4 were sufficient to refresh the provisioning profile to include the new device. – Mike Taverne May 24 '16 at 19:49
  • How can I achieve this when I'm only having the free developer account? In my member center I can't manage my provisioning profiles... – Gerrit Horeis May 27 '16 at 08:30
  • sorry but where is "Build Settings" tab mentioned in step 6? – Alireza Mirian Feb 18 '17 at 05:51
  • Found it. You need to know that double clicking the project name in project manager opens a very important project settings section. I hate x-code! – Alireza Mirian Feb 18 '17 at 05:57
  • This worked for me. I decided to try this answer before any other answers because it seemed like one of the least risky suggestions on this thread. My app is provisioned for APNS, for example. So the risks felt high. In fact, I only deleted the specific profile that I needed to automagically update (step. 5) so that I didn't have to touch the other profiles. @anusha-k saved my life. I've seen Xcode spiral into a freefall when you mess up provisioning, and I was really relieved this worked perfectly. – Rob Jun 21 '17 at 12:04
8

Spent a lot of time trying to fix the same issue on Xcode 7 i.e. refreshing the Xcode managed provisioning profiles.

After adding the UDID in the member center, what worked for me was just removing the account from preferences -> account and adding it back again. It updated all the provisioning profiles.

  • Thanks, it works! This way seems to be better than deleting a profile by hands. – Zapko Nov 19 '15 at 14:07
  • This is the one that worked for me, as of XCode 7.1.1! Didn't need to add a never-seen-before device (I don't have an extra one), and didn't need to deploy a new test project to the device (wanted to try other answers first). But th – Mike Lambert Dec 06 '15 at 08:47
  • In Xcode 8.1 there is an Preferences->Accounts->[Account name]->View Details button which shows Signing Identities and Provisioning Profiles for that account. A right click on a profile offers the ability to delete. Deleting the Team Provisioning profile for the account refreshed mine and the new UUID worked fine. (This was for a dev deployment via Fabric). – Tony Adams Nov 22 '16 at 17:14
4

Problem: Some time update devices in developer account, causes sometime not able reflect on our automatic management signing even update provisioning profile in xcode account.

Solution: find provisioning profile folder and delete all provisioning. ~/Library/MobileDevice/Provisioning Profiles

Automatic management signing will create new one. your devices will update in provisioning.

Ravi Kumar
  • 1,356
  • 14
  • 22
2

Update for Xcode 8

With Xcode 8 you don’t need to add the device in the “Member Center” anymore and you can skip some annoying steps.

What you still have to do are the following steps:

  1. Open “Xcode → Preferences…” (,).
  2. Select the corresponding “Apple ID” from the “Apple IDs” list in the left side of the window. Then select the corresponding “Team” from the list in the bottom right side of the window.
  3. Click on “View Details…”, then click on “Download All Profiles”.
  4. Close the “Preferences” window, select the scheme & affected devices and build your project. Eventually let Xcode automatically register the device.
Rafael Bugajewski
  • 1,702
  • 3
  • 22
  • 37
  • This does not work for refreshing an existing profile (e.g. when adding more devices). You still have to delete the profile on the disk. – marsbear Jul 21 '17 at 11:24
1

I also couldn't find a way to delete or refresh the provisioning profile in Xcode.

I managed to pull the provisioning profile with the new devices by quitting Xcode, deleting the Development provisioning profiles - the ones marked "Active (Managed by Xcode)" - on the Apple Developer site, then reopening Xcode and choosing the team in General settings for the app target. Xcode recreated the profiles (as confirmed on the developer site) and the device was included.

Chris Pointon
  • 113
  • 1
  • 6
  • Yeah, it wasn't "automagic" for me, either. I ended up deleting the profile from the developer site, re-add one (including the new device), then go to Xcode preferences Accounts page, re-download, show it in Finder, copy it to another location. go to the Devices window and install it on the new device. – Dave Nottage Nov 19 '15 at 06:58
1

I had a similiar problem and found the following - add a file called build.json in your root (same level as config.xml) with the following contents - replace the developmentTeam value with your Team Id as seen here https://developer.apple.com/account/#/membership/

{
  "ios": {
    "debug": {
      "codeSignIdentity": "iPhone Developer",
      "developmentTeam": "DP7KW42777",
      "packageType": "development"
    },
    "release": {
      "codeSignIdentity": "iPhone Developer",
      "developmentTeam": "DP7KW42777",
      "packageType": "app-store"
    }
  }
}

I also found that by adding the following in config.xml under

<platform name="ios">

there was no need anymore to set various Info settings, for example hiding the status bar

<config-file parent="NSBluetoothPeripheralUsageDescription" platform="ios" target="*-Info.plist">
  <string>${EXECUTABLE_NAME} requires bluetooth access to function properly</string>
</config-file>
<config-file parent="NSCalendarsUsageDescription" platform="ios" target="*-Info.plist">
<string>${EXECUTABLE_NAME} requires calendar access to function properly</string>
</config-file>
<config-file parent="NSCameraUsageDescription" platform="ios" target="*-Info.plist">
<string>${EXECUTABLE_NAME} requires camera access to function properly</string>
</config-file>
<config-file parent="NSContactsUsageDescription" platform="ios" target="*-Info.plist">
<string>${EXECUTABLE_NAME} requires contacts access to function properly</string>
</config-file>
<config-file parent="NSLocationAlwaysAndWhenInUseUsageDescription" platform="ios" target="*-Info.plist">
<string>${EXECUTABLE_NAME} would like to check your location when app is active or in background</string>
</config-file>
<config-file parent="NSLocationAlwaysUsageDescription" platform="ios" target="*-Info.plist">
<string>${EXECUTABLE_NAME} would like to check your location when app is active or in background</string>
</config-file>
<config-file parent="NSLocationWhenInUseUsageDescription" platform="ios" target="*-Info.plist">
<string>${EXECUTABLE_NAME} would like to check your location when app is active or in background</string>
</config-file>
<config-file parent="NSMicrophoneUsageDescription" platform="ios" target="*-Info.plist">
<string>${EXECUTABLE_NAME} requires microphone access to function properly</string>
</config-file>
<config-file parent="NSMotionUsageDescription" platform="ios" target="*-Info.plist">
<string>${EXECUTABLE_NAME} requires motion detection access to function properly</string>
</config-file>
<config-file parent="NSPhotoLibraryUsageDescription" platform="ios" target="*-Info.plist">
<string>${EXECUTABLE_NAME} requires photo library access to function properly</string>
</config-file>
<config-file parent="NSRemindersUsageDescription" platform="ios" target="*-Info.plist">
<string>${EXECUTABLE_NAME} equires reminders access to function properly</string>
</config-file>
<config-file parent="UIStatusBarHidden" platform="ios" target="*-Info.plist">
<true/>
</config-file>
<config-file parent="UIViewControllerBasedStatusBarAppearance" platform="ios" target="*-Info.plist">
<false/>
</config-file>

and finally, by adding

<icon height="1024" src="resources/ios/icon/AppIcon.png" width="1024" />

to the icons list, I no longer needed to manually add the 1024 icon. So now all I do is build, archive and upload without having to change any settings. Hope this helps.

dovk
  • 493
  • 5
  • 7
1

I just downloaded the profile from Member Center and hit fix issue in XCode.

I'm on OSX 10.15 and XCode 11.3 beta.

AGDM
  • 104
  • 1
  • 6
0
  1. Remove old team provisioning profile from site.
  2. Remove all local provisioning profiles (Xcode -> Preferences -> Accounts -> Select account -> Select team -> View details -> Right click any profile -> Show in finder -> Cmd+A -> Cmd+Backspace).
  3. Try build for device.

You will see fix button.

Alexander Danilov
  • 3,038
  • 1
  • 30
  • 35
0

In my case nothing listed above helped on Xcode 8.

Here are the steps I tried, which eventually worked to allow Xcode to fix the problem by once again showing me the Register Device button:

  • Removed apple id from Preferences > Accounts
  • Re-added apple id.
  • Restarted Xcode

Sidenote: In my case I think the problem was that my login expired (Xcode told me this in Preferences > Accounts). But even after clicking on Sign In Again nothing worked. I think maybe all I had to do to refresh it was sign in again and restart Xcode for the Register Device(s) button to show.

grego
  • 480
  • 6
  • 8
0

Add your new device id's in apple's console

Simply go to your target settings and select the General tab

Uncheck Automatically manage signing

Let Xcode complain and then re-enable the Automatically manage signing

It should have all the new devices in the provisioning profile when you make a new archive

Ciprian
  • 1,125
  • 1
  • 9
  • 14
0

Spent the last hour looking for a solution

I unplugged my iPhone and now it works.

Dazzle
  • 2,880
  • 3
  • 25
  • 52