61

We have created the .xcarchive file code signing with our client's certificate & distribution provisioning profile, but we need to send the .ipa file to our client so that they can upload the app to the App store using Application Loader.

The only way to create the .ipa file in Xcode 4.5 is clicking Distribute -> Save for Enterprise or Ad-Hoc Deployment which has a description underneath saying "Sign and package application for distribution outside of the iOS App Store".

If we save the .ipa file this way, will it cause any problem submitting to the app store? Or is there a proper way of converting the .xcarchive to .ipa?

starball
  • 20,030
  • 7
  • 43
  • 238
aobs
  • 1,063
  • 1
  • 11
  • 23

8 Answers8

99
  1. Create Xarchieve file by using Xcode, click product->archive
  2. first right click on xarchive file-> show in finder
  3. again right click on xarchive file-> show package contents
  4. Then open folder products->applications, here you get the your application file
  5. Now, Drag and drop this one to itunes store's app directory(find apps drop down menu at right top corner of itunes store). This will automatically converts archive file to ipa file. (Here, you can also do this -> drag and drop .app file anywhere in itunestore, once it get processed, search it back from search box).

  6. then again right click on it and ->show in finder, this will show your ipa file. Now you can give this one to any user

hariszaman
  • 8,202
  • 2
  • 40
  • 59
Mehul Thakkar
  • 12,440
  • 10
  • 52
  • 81
  • 6
    Using iTunes 11.4 under OS X Mavericks, this solution didn't seem to work for me. What did work was dragging the application file (step #4 from above) onto the `Library` section of iTunes, located on the top left (where `Music`, `Movies`, `TV Shows`, etc. are listed). From there, it created the `.ipa` file and, since it was the first app I'd added to iTunes this way, also created an `Apps` section under my iTunes Library. From there, you can right-click on the app and select `Show in Finder` to directly navigate to it. – Evan R Oct 08 '14 at 14:50
  • 2
    its working on itunes 11.4 and mavericks, i have tried today itself, after your comment and its working fine – Mehul Thakkar Oct 10 '14 at 11:39
  • Working on Yosemite, with Evan R comment final steps. – aramusss Jan 17 '15 at 17:58
  • 9
    Why it cannot be easier? Apple seems to have pleasure on making the developers suffer! – Eduardo Oct 04 '16 at 20:02
  • Could you be more specific on step 5? Do you mean drag and drop MyProject.app into actual iTunes app screen or what? If not, where is iTunes Store's app directory? I am confused – Artem Zaytsev May 13 '17 at 16:33
  • you can see the "Apps" option in menu at top left corner of itunes. – Mehul Thakkar May 15 '17 at 07:48
  • can't find iTunes on macos monterey, how do step 5 on it? – md-rubel May 11 '22 at 11:05
  • 2
    @md-rubel, Yes as in new mac os systems, apple removed itunes. Now you have to do below steps: Go to Window->Organiser->Archives Here, select your archive fine and click on "Distribute App" button on right side Then Instead of upload, select Export option, and continue selecting default options, it will end you up with generating ipa file. – Mehul Thakkar May 12 '22 at 06:28
54

Updated for Xcode 7 and 8

Here is a script to create the archive and generate the .ipa - tweak as needed:

PROJECT=xxx
ARCHIVE_PATH=/tmp/${PROJECT}.xcarchive
EXPORT_PATH=/tmp/${PROJECT} # DIRECTORY
mkdir -p $ARCHIVE_PATH
xcodebuild -project ./${PROJECT}.xcodeproj -scheme ${SCHEME} archive -archivePath $ARCHIVE_PATH -verbose

PLIST='{"compileBitcode":false,"method":"enterprise"}' # edit as needed

EXPORT_PLIST=/tmp/${PROJECT}.plist
echo $PLIST | plutil -convert xml1 -o $EXPORT_PLIST -

xcodebuild -exportArchive -archivePath $ARCHIVE_PATH -exportPath $EXPORT_PATH -exportOptionsPlist $EXPORT_PLIST
Jason Moore
  • 7,169
  • 1
  • 44
  • 45
30

First Product > Archive then Right click on the generated xcodearchive file and select Show package content and go to the Products -> Applications folder. Create a new folder named Payload and drag the .app file into that folder. Compress the Payload folder and rename it to whatever you want and change the extention to .ipa.

If your app size is too large, you can disable bit code in the build settings to make it 50-70% smaller.

Vahid Amiri
  • 10,769
  • 13
  • 68
  • 113
17

You can create an IPA from XCArchive.

  1. Right click on ProjectName [Date Time].xcarchive
  2. Select Show Package Content.

Step 1

Step 2

It comprises of three things :

a. dSYMs : dSYM files store the debug symbols for your app.

b. Info.plist : property list containing details such as ApplicationProperties, ArchiveVersion, CreationDate, Name, Scheme.

c. Products : This contains App file for your project.

  1. Select Products -> Applications. This contains app file.

  2. Now, drag-and-drop app file into iTunes (MyApps Tab).

  3. Select your project.

  4. Right click and select 'Show in finder'. This will locate newly created IPA file.

Step 4

Step 5

Jayprakash Dubey
  • 35,723
  • 18
  • 170
  • 177
14

If you need this from the command-line, you can find all the details here: http://encyclopediaofdaniel.com/blog/xcarchive-to-ipa. In short:

xcodebuild 
   -exportArchive -archivePath <path to archive> -exportPath <path to output> 
   -exportOptionsPlist <path to export options plist>

Where a minimal options plist looks like this:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>method</key>
    <string>app-store</string>
</dict>
</plist>

Of course the method will change according to the provisioning profile type you used (app-store is for distribution profiles). Run xcodebuild --help to see the list of available options.

Ohad Schneider
  • 36,600
  • 15
  • 168
  • 198
13

In Xcode 13 and later

  1. Select the archive on xCode and click on the top right button "Distribute app".

  2. Select "App Store Connect" in the next screen.

  3. Select "Export".

  4. Choose the signing certificates.

The exported folder will contain the ipa file.

You could also use the Transporter app to upload your ipa file to the AppStoreConnect.

tjpaul
  • 343
  • 3
  • 16
lubilis
  • 3,942
  • 4
  • 31
  • 54
11

I also observed the same problem in one of my projects.

I resolved it by changing settings in target. For main project and dependency.

 skip Install  NO

After this change, goto Xcode->Product->Archive->Save for Enterprise or Ad-Hoc Deployment

We followed the same process and uploaded through Application Loader and Apple approved the app.

enter image description here

Guru
  • 21,652
  • 10
  • 63
  • 102
  • 1
    Skip Install is originally set to NO. Does that mean we can safely send the .ipa file to our client after "Save for Enterprise or Ad-Hoc Deployment"? – aobs Feb 18 '13 at 11:20
  • yes, I did same in many project and app is live on app store now. Make sure you used distribution provisioning profile. – Guru Feb 18 '13 at 11:34
  • 1
    There is no submenu under ->Archive in XCode 8.2, so these directions no longer work. – Logicsaurus Rex Jan 17 '17 at 01:44
  • @LogicsaurusRex in older Xcode also no submenu. Once you click Archive then it opens new window. There select Save for Enterprise... – Guru Jan 17 '17 at 05:50
  • Archive has no submenu under Archive in Xcode 12.5. This spits out an `.xcarchive` file, not a `.ipa` – Pigpocket Jul 02 '21 at 20:58
11
XCode > Project > Archive
XCode > Organizer > Distribute > Enterprise/add Hoc > Save As
Saves as YOURAPP.ipa.
Make sure Save for Enterprise Deploy remains UNCHECKED.
Download latest Application Loader.
tap 'Deliver Your App'
make sure new version in itunes connect in WAITING FOR UPLOAD state
Click on Activity... button 

TIP: open Console.app to see XCode Validation errors

Click on ALL MESSAGE on list of logs on right.
Then in search enter 'XCode' or 'Application Loader' 
to monitor any errors with your upload.

Note:

I did all this and still got email about missing 120x120 icons.

Forgot to update them in Build Target > General Tab List of new icon requirements for iOS7 http://www.icenium.com/resources/forums/icenium-general-discussion/missing-recommended-icon-file

brian.clear
  • 5,277
  • 2
  • 41
  • 62
  • 2
    This should be accepted answer since no one wants to f*ck around with iTunes, not speaking of from some version it just does not show the apps tab in the interface... + This is much more developer attitude. – Dominik Bucher Nov 09 '17 at 10:25