675

I have been archiving for ad hoc distribution fine for many months and suddenly today I cannot do so as the Archive menu item is disabled. I have not changed anything. I went through the provisioning setup for the project and it looks ok.

My Ad Hoc profile is about to expire in 14 days. Could this be the problem? I don't believe I can renew it until the day it expires. There is a a "renew" button for my ad hoc profile in the organizer but when I click it I get...

The given profile was not found on the provisioning portal. Please refresh your provisioning profiles before attempting to renew “MyAddHocProfile”

The profile in the provisioning portal shows active, expiring on the 30th. I noticed that I had not yet upgraded to 4.6.2 and did so. Then I downloaded my profile and double cliked it thinking that would refresh the profile in Xcode, still no joy. I also tried manually replacing the profile file MyAddHocProfile.mobileprovision in the Library.

What do they mean "refresh your provisioning profile"?

Even so, I would think that as long as the profile is active, I should be able to create an archive. I must be doing something else wrong.

3
  • 264
    Product > Archive is only enabled when your scheme has a destination of “iOS Device” or an actual iOS device. Have you checked that?
    – rob mayoff
    Apr 17, 2013 at 4:08
  • 5
    Darn! That was easy. Thanks! Please post your comment as an answer so I can give you credit and mark this as ansered.
    – user278859
    Apr 17, 2013 at 4:46
  • Archiving a sim version is possible on the terminal. Looking forward to Apple to enable it in Xcode, since you need it when distributing XCFrameworks.
    – naz
    May 30, 2020 at 3:56

8 Answers 8

1838

You've changed your scheme destination to a simulator instead of Generic iOS Device.

That's why it is greyed out.

Change from a simulator to Generic iOS Device

11
  • 1
    Thanks for this, the perfect fix. Any ideas why this happens though?
    – Matt
    Oct 28, 2013 at 15:05
  • 9
    Well, it's just a guess... Maybe Apple wants you to actually test your on a real device before you actually package it for the App Store. Just a hunch :)
    – wiseindy
    Oct 28, 2013 at 17:27
  • 2
    Thanks for the answer. That's so completely non-obvious from a UI perspective that it catches even those of us who have been building apps for many years off guard. Apple should at least float a tooltip or something when it is in that state....
    – dgatwood
    Aug 28, 2015 at 17:43
  • 1
    Si I cannot archive a ios product if I don't have an ios pluged on the mac ? I'm using a cloud access to a Mac, so I cannot plug a device on it... Dec 7, 2015 at 11:48
  • 28
    If your phone is not available, choose Generic IOS device
    – redolent
    Jun 19, 2016 at 22:58
122

Select "Any iOS Device" in newer versions of Xcode. And Archive Option will be enabled!

0
22

Change the active scheme Device from Simulator to Generic iOS Device

20

Select active scheme to Generic iOs Device.

select to Generic iOs Device

13

In addition to the generic device (or "Any iOS Device" in newer versions of Xcode) mentioned in the other answers, it is possible that the "Archive" action is not selected for the current target in the scheme.

To view and edit at the current scheme, select Product > Schemes > Edit Scheme... (Cmd+<), then make sure that the "Archive" action is checked in the line corresponding to the desired target.

In the image below, Archive is not checked and the Archive action is greyed out in the Product menu. Checking the indicated checkbox fixed the issue for me.

scheme settings

6

If you are sure that you selected the Generic iOS device and still can't see the option, then you simply have to restart Xcode.

This was the missing solution for me as a cordova developer with Xcode 11.2

4

You can choose option "Any iOS Device (arm64)" in new versions of XCode and this will enable "Archive" Button in your XCode.

enter image description here

0

Organiser was empty after try every here recommended settings, also it was impossible to do 'Product > Archive' but... Only when device connected on cable and app run then 'Archive' show up. and then was possible to do 'Archive' and app shows up in Organiser

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.