129

I have added some new devices. How can I refresh the provisioning profile, as Xcode 8 automatically manages signing assets?

I have found this question: Refresh devices in team provisioning profile managed by Xcode 7? – but we can't do that in Xcode 8.3.

I don't have the device with me so I manually added it in the portal and also edited the provisioning profile but Xcode is not re-downloading it.

Cœur
  • 37,241
  • 25
  • 195
  • 267
Bilal
  • 18,478
  • 8
  • 57
  • 72

5 Answers5

310

This is what you need to do:

  1. Go to ~/Library/MobileDevice/Provisioning\ Profiles/ and delete all the provisioning profiles from there.
  2. Go to Xcode > Preferences > Accounts and select the Apple ID.
  3. Click Download Manual Profiles or Download All Profiles. And it will download all the provisioning profiles again.

Download Profiles button

pkamb
  • 33,281
  • 23
  • 160
  • 191
Bilal
  • 18,478
  • 8
  • 57
  • 72
  • 28
    What a hassle for such an easy task. Every new xcode version the shortcut to refreshing the prov profiles seems to be removed. Thanks for this – Oritm Aug 03 '17 at 01:16
  • 7
    I can't find any `MobileDevice` folder in `Library` – Ionut Necula Aug 30 '17 at 12:20
  • 8
    @Ionut use terminal to open this folder: `open ~/Library/MobileDevice` – Miroslav Hrivik Sep 26 '17 at 08:38
  • If the app is open in Xcode, and you can match the date of the provisioning profile in ~/Library, you can delete one profile and by the time you've returned to Xcode, the profile has already being used. – David Feb 07 '18 at 20:34
  • 5
    omg what the hell apple, always put us in embarrassing situations with clients. – fullmoon Apr 18 '18 at 08:06
  • is this the right way to go also with Xcode 9? c'mon Apple?! – MatterGoal May 08 '18 at 09:31
  • @MatterGoal yes it is! – Rene Pot May 08 '18 at 12:26
  • @RenePot well... this is sad. They should provide a better way. – MatterGoal May 15 '18 at 10:16
  • been struggling with this for hours, absurd. updated to iOS 12 and Xcode 10 and now my Profile is always None. tried everything, removed provisioning profiles and downloaded them again from Xcode. even revoked certs and created new ones. nothing works. older packages validate just fine, I need to release a new version and I'm stuck. what the hell do I do. – Nexus Sep 21 '18 at 13:50
  • btw, for all non-mac users like me - Library is a hidden folder, you can open it via terminal by using: `open ~/Library/MobileDevice/"Provisioning Profiles"` – Sergey Nikitin Mar 13 '19 at 11:29
95

Remove the .mobileprovision file for the app this way :

The command in the terminal is : rm

enter image description here

Musa almatri
  • 5,596
  • 2
  • 34
  • 33
27

Step 1. Click on desktop then from top menu Go > Go to Folders...

enter image description here

Step 2. Write/Paste following path and enter:

~/Library/MobileDevice/Provisioning\Profiles

enter image description here

Step 3. Select Provisioning Profiles folder and delete all provisions profiles in it

enter image description here

Step 4. Go to xCode Preference > Accounts > Apple ID and then click on Download Manual Profiles button

enter image description here

AiOsN
  • 2,305
  • 2
  • 23
  • 29
  • The first image solved my search. I didn't know where to find 'MobileDevice' folder . I tried with finder for path `~/Library/MobileDevice/Provisioning\ Profiles/` but no luck, this ended my search. – Annu Jan 18 '19 at 07:18
  • I had to restart Xcode after doing this to get this to work. (Possibly I could have just restarted Xcode) – prewett Jun 29 '19 at 02:01
  • Thanks. I needed to do this after upgrading to Xcode Version 13.0. – Peter F. Sep 29 '21 at 05:04
8

First delete the provisioning profile from ~/Library/MobileDevice/Provisioning\Profiles/ , then edit provisioning profile from developer portal and select all devices while editing Provisioning profile. Then download this profile and open in your Xcode.

Ved Rauniyar
  • 1,539
  • 14
  • 21
5

To add devices to your provisioning profile in Xcode 8 with automatic code signing, you simply need to build to the device in Xcode. Xcode will add the device's UDID and regenerate the provisioning profile automatically. If you don't have physical access to the device, I don't think there is a way to add it to your provisioning profile without going back to manually managing your devices and profiles.

wottle
  • 13,095
  • 4
  • 27
  • 68
  • This won't work for phones you don't have access to though – tommybananas Sep 01 '17 at 18:43
  • That is true, My answer was to the original question, which made no mention of not having the device and manually managing the provisioning profile. The original question stated just that they were using Automatic Code Signing (they apparently aren't). – wottle Sep 01 '17 at 19:28