Showing posts with label iPhone ipa. Show all posts
Showing posts with label iPhone ipa. Show all posts

Monday, September 8, 2008

How do you create an .ipa file?

This is taken from discussion forum and I found it very useful

What you need:
1: An app
2: A patched MobileInstallation file installed on your iPhone or iPod Touch.
3: Lastly, you need to know that when I say "ProgName", substitute the name of the program you're working with
Getting the iTunesArtwork file
The iTunesArtwork file is simply a jpeg image with the extension taken off, and is included in application's install folder on your device for every app downloaded from the app store. This image is what appears in the Applications section of iTunes as the icon for the app, and is definitely nice to have -- if you don't have it, you get a generic, black icon that no one wants to see. If you have the iTunesArtwork file, skip all this and go down to the next red headline! Otherwise, read on:
1: Open iTunes on your computer and find your application in the iTunes Music Store. On the application's page, find the app icon at the top-left corner of the page and right-click it. Now choose "Copy iTunes Store URL". Your clipboard now contains something like this:
Code:
http://phobos.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=284962368&mt=8

2. run this script (which I created) in mac, eg ./getappicon.sh 284962368
Shell script: getappicon.shSelect all

#!/bin/sh
url=`curl -s -L "http://ax.phobos.apple.com.edgesuite.net/WebObjects/MZStore.woa/wa/viewSoftware?id={$1}&mt=8" | gunzip | grep '100x100-75.jpg' | cut -f22 -d"\""`
appname=`curl -s -L "http://ax.phobos.apple.com.edgesuite.net/WebObjects/MZStore.woa/wa/viewSoftware?id={$1}&mt=8" | gunzip | grep '100x100-75.jpg' | cut -f16 -d"\""`
if [ "$appname" = "0" ] ; then
appname=`curl -s -L "http://ax.phobos.apple.com.edgesuite.net/WebObjects/MZStore.woa/wa/viewSoftware?id={$1}&mt=8" | gunzip | grep '100x100-75.jpg' | cut -f18 -d"\""`
fi
echo ${appname}

url100=${url}
curl ${url100} > ${1}.jpg

url512=`echo ${url100} | perl -pe 's/100/512/g'`
curl ${url512} > ${1}_512.jpg


3: Then you will get two jpg files, 284962368_512.jpg & 284962368.jpg Rename the 512 jpeg to iTunesArtwork. You've just gotten your iTunesArtwork file.

Bundling the .IPA
1: Create a folder on your desktop called "working". Open that, and create another folder inside of it called "Payload". Case-sensitive.
2: Move your iTunesArtwork file into the "working" folder, and your .app into the Payload folder.
3: Mac and Linux users only: Open Terminal and run the following command:
Code:
chmod -R 775 ~/Desktop/working/Payload
4: Go into your ProgName.app folder within Payload (Mac users, right-click ProgName.app and choose Show Package Contents).
5 (For Mac users with Dev Tools installed ONLY): Double-click the Info.plist file. The Property List Editor will open and show a simple table. Click the last row of the table, then press the + button that appears to create a new row at the bottom. In the first new cell enter
Code:
SignerIdentity
and in the second new cell, enter
Code:
Apple iPhone OS Application Signing
Save this file.
5 (For Windows, Linux, and other Macs): Visit the following site: https://brokolice.drsny.net/iphone/plutil/ (You may have to Approve the security certificate -- don't worry, it's safe)
Browse for your Info.plist file, and press the "Convert" button. Save the resulting file to your computer. Windows users, open this file in WordPad. Mac and Linux users can use any text editor.
scroll to the bottom of the file and make a new line just before
Code:
</dict>
And paste the following in that spot:
Code:
<key>SignerIdentity</key>
<string>Apple iPhone OS Application Signing</string>
The end of the file should now look like this:
Code:
<key>SignerIdentity</key>
<string>Apple iPhone OS Application Signing</string>
</dict>
</plist>
Save the file (Make sure the name is Info.plist -- case sensitive!) and replace the Info.plist in ProgName.app with it.
6: Time to zip it up. Use your favorite method to zip the iTunesArtwork file and Payload folder together in one .zip file. Mac users can select both, right-click, and choose "Compress 2 Items". Windows users can select both, right-click, and choose "Add to Archive" (remember to select ZIP, not RAR if that option is available).
If you unzip the file, you should see this structure:
Code:

iTunesArtwork
+Payload
AppName.app
7: Rename the zip file to ProgName.ipa
8: All done! Congratulations!