185

In Xcode 3.2.5 I use "Build And Archive" to create an IPA file. In Xcode 4 you can use "Product -> Archive" to archive an application in an .xcarchive bundle.

How can I create an .ipa file with Xcode 4?

DrMickeyLauer
  • 3,807
  • 3
  • 26
  • 59
Manni
  • 10,948
  • 15
  • 46
  • 67
  • 3
    Everytime I build a new adhoc version, my google searching leads me here. I have seen this page many times over the past few months. Good question, good solution – coneybeare May 22 '11 at 19:44
  • 1
    Here are [detailed instructions on making an archive and an IPA file for ad hoc distribution including details on Skip Install issues](http://www.musicalgeometry.com/?p=1237). – jj0b Apr 08 '11 at 18:25
  • Good Question and good answer.[Detail instructions on creating ad hoc build server](http://krish.codeworth.com/development/iphone/how-to-create-a-ad-hoc-build-in-xcode-for-testing-ios-app) and [build issues](http://krish.codeworth.com/development/iphone/error-while-creating-ipa-file-in-xcode-4-and-xcode-4-2) – Ramakrishna Guttha Jan 17 '12 at 04:43
  • Here is a Xcode Plugin for exporting IPA https://github.com/rajeshbeats/Xcode-Plugin-Export-IPA – Raj Jul 14 '15 at 16:21
  • Try this answer from another similar question: [https://stackoverflow.com/questions/5271496/xcode4-ios-4-3-no-packager-exists-for-the-type-of-archive/5322743#5322743](https://stackoverflow.com/questions/5271496/xcode4-ios-4-3-no-packager-exists-for-the-type-of-archive/5322743#5322743) – pkananen Mar 19 '11 at 04:41

12 Answers12

393

Creating an IPA is done along the same way as creating an .xcarchive: Product -> Archive. After the Archive operation completes, go to the Organizer, select your archive, select Share and in the "Select the content and options for sharing:" pane set Contents to "iOS App Store Package (.ipa) and Identity to iPhone Distribution (which should match your ad hoc/app store provisioning profile for the project).

Chances are the "iOS App Store Package (.ipa)" option may be disabled. This happens when your build produces more than a single target: say, an app and a library. All of them end up in the build products folder and Xcode gets naïvely confused about how to package them both into an .ipa file, so it merely disables the option.

A way to solve this is as follows: go through build settings for each of the targets, except the application target, and set Skip Install flag to YES. Then do the Product -> Archive tango once again and go to the Organizer to select your new archive. Now, when clicking on the Share button, the .ipa option should be enabled.

I hope this helps.

eploko
  • 5,328
  • 2
  • 23
  • 23
  • 2
    This fixed my problem, thanks! In my case the problem was actually one of the *children* projects (ProtocolBuffers for me) which had several targets that needed skip install to be set. – JosephH Apr 03 '11 at 10:28
  • You may need to Product -> Clean and open/close your workspace before the Product -> Archive option appears. – Mark Chackerian Apr 27 '11 at 15:49
  • I had the problem with multiple targets. Setting the shared lib to Skip Install YES and the app to Skip Install NO fixed it. This was not a problem for me in Xcode 3.2, only 4.1. – logancautrell Aug 08 '11 at 15:51
  • 45
    "Share" is now "Distribute..." Then select "Save for Enterprise of Ad-Hoc Deployment" – Rembrandt Q. Einstein Jul 23 '12 at 20:07
  • "Skip install" is not sufficient - I've got this bug with Xcode 4.5, and it refuses to ever Distribute correctly, ever since I added a library with a bundle. – Adam Apr 26 '13 at 10:00
  • This bug is still not fixed in Xcode 5.0.2 -- ARGH! Why does Apple make such awful user-interfaces / bad UX design? (if there's an error, Xcode-dev-team, you should be DISPLAYING THE ERROR :( ) – Adam Nov 20 '13 at 21:50
  • This answer does not work in XCode 5. The mentioned menu options are not there. – Dustin Feb 04 '14 at 05:39
  • Worked for me in Xcode 5.1.1 ! Thanks a lot for the tip ! – Mohamed Amine Aug 05 '14 at 12:06
  • An additional step which I found necessary was to Edit Scheme and under "Build" uncheck the box for "find implicit dependencies." – Fluffhead Sep 10 '14 at 19:52
  • I can't see the share or distribute options on xcode 6 – jcesarmobile Sep 22 '14 at 08:14
  • Archive is disabled. – Altimus Prime Oct 09 '19 at 03:40
45

Just setting Skip Install to YES did not work for me. Hopefully this will help somebody.

I went to dependence of my project targets: Coreplot-CocoaTouch. Then went to Coreplot-CocoaTouch Targets. In its Targets opened Build Phases. Then opened Copy Headers. There I had some of headers in Public, some in Private and some in Project. Moved ALL of them to Project.

Of course, in Build Settings of Coreplot-CocoaTouch Targets checked that Skip Install was set to YES in Deployment options.

And this time Archive made an archive that could be signed and .ipa produced.

Boris Gafurov
  • 1,363
  • 14
  • 28
  • 1
    After moving headers to Project works perfectly along with above steps. Thanks – iOSAppDev Jun 19 '12 at 14:07
  • Like a cool breeze! Anyone dropping https://github.com/sprhawk/ytoolkit.git for OAuth into thier project will require this. Thx. – vmanjz Sep 08 '12 at 20:58
  • 2
    Why oh why is Xcode still full of bugs as serious as this? 18 months later than this comment and the bug is still there! Thanks for the help. – Ben Clayton Nov 09 '12 at 09:53
  • You have no idea how much I love you right now... at least one of my problems is solved! Thank you! – Dmytro Jul 07 '15 at 03:24
15

For Xcode 4.6 (and Xcode 5) archives

  • In Organizer, right-click an archive, select Show in Finder
  • In Finder, right-click an archive, select Show Package Contents
  • Open the folder Products > Applications
  • The application is there
  • Drag the application into iTunes Apps folder

    enter image description here

  • Right-click on the application in iTunes Apps, select Show in Finder

  • The .ipa is there!
ohho
  • 47,708
  • 70
  • 236
  • 372
  • This is what I really need for my xcode 4.6.3, All the above is just non-sense for me, only this one work. Great ! – Forrest Sep 10 '13 at 03:09
  • caution, will create an ipa but might not install properly, it shows icon on phone after sync but says installing underneath and never ends. anyhow that's my experience so far after trying this, Xcode 5.1.1. – colin lamarre Oct 14 '14 at 05:23
4

In the organizer you can click Share and save as iOS App Store Package(.ipa). You may also have to select 'Archive' from the 'Product' menu to generate the archive in the Organizer. Lastly, I think you have to have a properly signed archived build to do this.

Joshua Smith
  • 6,305
  • 1
  • 26
  • 27
  • 3
    It was easy to figure out how to create the Archive from the project. The problem is that while sharing the option 'Package' is grayed out. You might be right that the archive has to be signed properly so that that option is enabled. I use the key for distribution Ad-Hoc and also have Entitlements specified for a distribution Ad-Hoc. Could you share how to make it possible to create the IPA file? – krasnyk Mar 11 '11 at 08:51
4

I had this same problem, using an old version of the route-me library. I "skipped" all the libraries, and the libraries inside of libraries (proj4), but I still had the same problem. Turns out that route-me and proj4 were installing public header files, even when the libraries were being skipped, which was messing it up in the same way! So I just went into the route-me and proj4 targets "Build Phases" tab, opened "Copy Headers", opened "Public", and dragged those headers from "Public" into "Project". Now they don't get installed in $(BUILD)/usr/local/include, and I'm able to make an ipa file from the archive!

I hope Apple fixes this horrible usability problem with XCode. It gives absolutely no indication of what's wrong, it just doesn't work. I hate dimmed out controls that don't tell you anything about why they're dimmed out. How about instead of ignoring clicks, the disabled controls could pop up a message telling you why the hell they're disabled when you click on them in frustration?

3

Assuming you've done a successful Product > Archive then, from Organizer (Shift Apple 2) click Archives.

Select your Archive. Select Share. In the "Select the content and options for sharing:" pane set Contents to "iOS App Store Package (.ipa) and Identity to iPhone Distribution.

Click Next, enter an App name and click Save.

Full gory details with screenshots are here: Xcode4UserGuide

NANNAV
  • 4,718
  • 4
  • 26
  • 48
Snowcrash
  • 66,400
  • 60
  • 203
  • 323
2

One who has tried all other answers and had no luck the please check this check box, hope it'll help (did the trick for me xcode 6.0.1)

enter image description here

Inder Kumar Rathore
  • 37,431
  • 14
  • 121
  • 176
0

If it is a game(may be app also) and you have some static libraries like cocos2d or other third party library ... then you just have to select *ONLY THE* static library (NOT THE APP) and in its build settings under Deployment , set Skip Install flag to YES and Archive it dats it...!!

atxe
  • 4,825
  • 2
  • 33
  • 48
vivek
  • 1
0

I went threw the same problem. None of the answers above worked for me, but i ended finding the solution on my own. The ipa file wasn't created because there was library files (libXXX.a) in Target-> Build Phases -> Copy Bundle with resources

Hope it will help someone :)

Shrolox
  • 613
  • 5
  • 21
0

I had the same problem... Had to recreate the project from scratch.

Note: my project was created in XCode 3.1 and was linking against a static library that was being built as a subproject (to a common destination). I changed this to build the source instead when I recreated the XCode project in XCode 4.

Now doing a Product/Archive/Share... gets the option of "iOS App Store Package (.ipa)" directly above "Application" (which is now greyed out) and "Archive" (which exports the .xcarchive).

0

Same issue. I solved setting the "skip install" flag to YES for each external projects, leaving the other targets of the main project unchanged.

I also had to go to "Edit scheme…", choose the "Archiving" panel and set the correct build setting for my ad-hoc purpose.

Then a simple Product -> Archive -> Share made the expected job.

nebillo
  • 1,247
  • 10
  • 21
0

You will need to Build and Archive your project. You may need to check what code signing settings you have in the project and executable.

Use the Organiser to select your archive version and then you can Share that version of your project. You will need to select the correct code signing again. It will allow you to save the .ipa file where you want.

Drag and drop the .ipa file into iTunes and then sync with your iPhone.

Surjit Joshi
  • 2,719
  • 2
  • 16
  • 20