Difference between revisions of "IPA File Format"

From The iPhone Wiki
Jump to: navigation, search
m (Introductory tweaks.)
m (Usage)
 
(8 intermediate revisions by 4 users not shown)
Line 1: Line 1:
[[Image:IPAFile.png|thumb|IPA file icon from [[iTunes]] 11.]]
+
[[Image:IPAFile.png|thumb|IPA file icon from ''[[iTunes]] 11'']]
A '''IPA''' archive is the de facto way to package applications for [[iOS]]. The name has no ''official'' definition, but is commonly called ''iPhone Application'' by the [[iOS]] community. The file is just a renamed [[wikipedia:zip (file format)|ZIP]] archive. Although any computer with a ZIP archive reader can extract an IPA, [[wikipedia:Portable Network Graphics|PNG]] images (e.g. the app's icon files) are typically in a proprietary variant of the PNG format instead of the standardized PNG format, and the application binary is encrypted with [[wikipedia:Digital rights management|DRM]] which hinders the ability to examine the binary.
+
An '''IPA''' archive is the de facto way to package applications for [[iOS]]. The extension has no official definition, but is commonly called ''iPhone Application'' by the [[iOS]] community. The file is just a renamed [[wikipedia:zip (file format)|ZIP]] archive. Although any computer with a ZIP archive reader can extract an IPA, [[wikipedia:Portable Network Graphics|PNG]] images (e.g. the app's icon files) are typically in a [[Apple PNG|proprietary variant of the PNG format]] instead of the [[wikipedia:Portable Network Graphics|standardized PNG format]], and the application binary is encrypted ([[wikipedia:Digital rights management|DRM]]) which prevents examination of the binary.
   
 
== Contents ==
 
== Contents ==
 
As an IPA file is just a renamed [[wikipedia:zip (file format)|ZIP]] archive, its structure is available from [http://www.pkware.com/documents/casestudies/APPNOTE.TXT PKWARE].
 
As an IPA file is just a renamed [[wikipedia:zip (file format)|ZIP]] archive, its structure is available from [http://www.pkware.com/documents/casestudies/APPNOTE.TXT PKWARE].
  +
* <code>iTunesArtwork</code>
 
  +
* <code>[[iTunesMetadata.plist]]</code>
* iTunesArtwork
 
  +
* <code>Payload/</code>
* [[iTunesMetadata.plist]]
 
  +
** <code>{ApplicationName}.app/</code>
* Payload/
 
** ''ApplicationName''.app/
 
 
*** (various application files)
 
*** (various application files)
  +
  +
=== iTunesArtwork ===
  +
As per [http://developer.apple.com/library/ios/#qa/qa1686/_index.html Technical Q&A QA1686], the <code>iTunesArtwork</code> file should be a [[wikipedia:Portable Network Graphics|PNG]] image. However, Apple, among many other developers, contradict this by using [[wikipedia:JPEG|JPEG]]s instead.
  +
  +
Examination of [http://dl.dropbox.com/u/38132225/iTunesArtwork%20JPEG.png nearly any <code>iTunesArtwork</code> file with a hex editor] can be used to confirm this. If the file's first two bytes are <code>ff d8</code> (hex), the file is a JPEG. If the first 8 bytes are <code>89 50 4e 47 0d 0a 1a 0a</code> (hex), the file is a PNG.
   
 
== Usage ==
 
== Usage ==
Apple uses the IPA format for packaging [[iOS]] aplications. [[iTunes]] can be used to install their contents on a [[iDevice|device]], provided the included files are signed. Developers can use the IPA format for [[Ad Hoc Distribution]] of their apps.
+
Apple uses the IPA format for packaging [[iOS]] applications. [[iTunes]] can be used to install their contents on a [[iDevice|device]], provided the included files are signed. Developers can use the IPA format for [[Ad Hoc Distribution]] of their apps.
   
 
== Creation ==
 
== Creation ==
Line 18: Line 22:
 
# Build application
 
# Build application
 
# Locate the <code>.app</code> folder
 
# Locate the <code>.app</code> folder
  +
# Create a folder named <code>Payload</code>
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-[[Jailbreak|jailbroken]] devices.
 
  +
# Place your <code>.app</code> folder in it
  +
# Create a 512x512 JPEG version of your icon (see [[#iTunesArtwork|above section]])
  +
# Save it as <code>iTunesArtwork</code> (no extension)
  +
# Create your <code>[[iTunesMetadata.plist]]</code> and save it
  +
# "ZIP" the contents
  +
#* <code>iTunesArtwork</code>
  +
#* <code>iTunesMetadata.plist</code>
  +
#* <code>Payload/</code>
  +
  +
== See Also ==
  +
* [[Xcode]]
  +
* [[iTunesMetadata.plist]]
  +
  +
== External Links ==
  +
* Apple Question & Answers [http://developer.apple.com/library/ios/#qa/qa1686/_index.html QA1686] - ''App Icons on iPad and iPhone''
   
  +
[[Category:File Formats]]
== How to create ==
 
IPAs can be created either by hand or through [[Xcode|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'' ''./*''
 

Latest revision as of 21:01, 2 December 2022

IPA file icon from iTunes 11

An IPA archive is the de facto way to package applications for iOS. The extension has no official definition, but is commonly called iPhone Application by the iOS community. The file is just a renamed ZIP archive. Although any computer with a ZIP archive reader can extract an IPA, PNG images (e.g. the app's icon files) are typically in a proprietary variant of the PNG format instead of the standardized PNG format, and the application binary is encrypted (DRM) which prevents examination of the binary.

Contents

As an IPA file is just a renamed ZIP archive, its structure is available from PKWARE.

iTunesArtwork

As per Technical Q&A QA1686, the iTunesArtwork file should be a PNG image. However, Apple, among many other developers, contradict this by using JPEGs instead.

Examination of nearly any iTunesArtwork file with a hex editor can be used to confirm this. If the file's first two bytes are ff d8 (hex), the file is a JPEG. If the first 8 bytes are 89 50 4e 47 0d 0a 1a 0a (hex), the file is a PNG.

Usage

Apple uses the IPA format for packaging iOS applications. iTunes can be used to install their contents on a device, provided the included files are signed. Developers can use the IPA format for Ad Hoc Distribution of their apps.

Creation

IPA files are typically created through Xcode, but may be created manually:

  1. Build application
  2. Locate the .app folder
  3. Create a folder named Payload
  4. Place your .app folder in it
  5. Create a 512x512 JPEG version of your icon (see above section)
  6. Save it as iTunesArtwork (no extension)
  7. Create your iTunesMetadata.plist and save it
  8. "ZIP" the contents
    • iTunesArtwork
    • iTunesMetadata.plist
    • Payload/

See Also

External Links

  • Apple Question & Answers QA1686 - App Icons on iPad and iPhone