IPA File Format

From The iPhone Wiki
Revision as of 16:32, 21 March 2013 by Dialexio (talk | contribs) (Changed some language around to make it sound less like a password-protected ZIP.)
Jump to: navigation, search
IPA File Icon in Preview

A IPA file is an iPhone Application archive which stores an iPhone, or iPad application. Looking at the file signature (Magic Number) of a valid IPA File will yield 50 4B 03 04 in HEX or PK.. in ASCII, this shows us that an IPA file is just a fancy ZIP file and can therefore be extracted by the same way a ZIP file would. Though any computer can extract an IPA's contents, the app's binary uses DRM that hinders users' ability to examine or redistribute the app.


Structure

The basic structure of an IPA file is as follows;

  • /iTunesArtwork
  • /iTunesMetadata.plist
  • /Payload/
    • ApplicationName.app/
      • ApplicationName
      • Various other application files

Use

Apple uses the IPA format for iOS applications in iTunes. Developers use the IPA format typically for Ad Hoc Distribution of apps to beta testers, IPAs can be created through Xcode. This requires an Apple Developer or Enterprise account if you want to distribute to non-jailbroken devices.

How to create

IPAs can be created either by hand or through Xcode's Product -> Archive (this requires an App Developer or Enterprise account) and can later be viewed through Organizer -> Archives. To create an IPA hand, build your application and locate the .app file for it. Create a root folder, inside this folder create another folder called 'Payload' and place your application in here. Next, create a 512x512 image for your icon, call it iTunesArtwork and place it in the root folder. Create an iTunesMetadata.plist file and place it in the root folder as well. ZIP the contents of the root folder and not the root folder itself, i.e. select the items inside the root folder and not the root folder itself. Use the following ZIP command to properly create IPA files;

zip -u -y -r -n .jpg:.JPG:.jpeg:.png:.PNG:.gif:.GIF:.Z:.gz:.zip:.zoo:.arc:.lzh:.rar:.arj:.mp3:.mp4:.m4a:.m4v:.ogg:.ogv:.avi:.flac:.aac IPAFileName.ipa ./*