iPhone Applications
So, I came upon an iPhone to play with for a few days and decided I should try to learn about how the user applications run on it. There has been a lot of great work already by the guys on the iPhone Dev Wiki around getting SSH and such on the iPhone, needless to say without their work this discovery would not have happened.
The point was to learn how the applications are structured and then see if I could add an existing application back to the iPhone with a different name and icon and have it run. Today Fred and I set out to see if we could get this to happen.
iPhone applications look very similar to applications for OSX, makes sense as they both run some version of OSX. The file structure of the iPhone Calculator is this:
[/Applications] [/Calculator.app] Calculator CalculatorBackground.png Default.png [/English.lproj] InfoPlist.strings Localizable.strings Info.plist LCDBackground.png PkgInfo icon.png ring.png
[ source: iPhone Directory listing ]
For this example we will be trying to change the calculator app into some a touch more fun looking. First step is simple ( if you already have SSH on the iPhone and the binkit on your iPhone) tar up the Calculator app and copy it to a Mac.
Executable [Calculator]
The Calculator file is a compiled binary for the ARM platform running it from OSX produces the error message: “Bad CPU type in executable.” We assume that this has something to with the Universal application concept in OSX. It is opening that executable and looking to see if it has the ability it talk to an Intel/PPC processor it of course doesn’t so it craps out. First thing we did was to rename this file to foobar.
Info.plist
This is the file that has all the information about what to execute when a user clicks on the icon in the home screen. File is a regular plist file from normal OSX applications. The node to concern yourself with is CFBundleExecutable. This points at the binary you want to execute. So, in our case we need to point this node at our renamed executable.
icon.png
A few sites have already figured out you can change these around so, I won’t go into anymore detail then pointing you at the ModMyiPhone wiki that describes the structure of iPhone pngs. You don’t actually need to “optimize” your pngs for your iPhone. It can render regular ones just fine. We threw a “festive” graphic into our package.
“Deploy”
The final step is to move all these files over to the iPhone. Make sure you get the directory structure right: /Applications/foobar.app/ . Reboot the phone and you should see your newly renamed and functioning Calc application on the home page.
One other interesting that came of this is that the iPhone can’t have more then 16 applications on it. The home screen does not have the ability to scroll. We loaded 4 more copies of the calculator onto the phone and were unable to scroll down to see them. Maybe there is a simple change to the launcher application to allow the scrolling to happen or maybe Apple has to change the application to allow it.
You can see the little Handbrake icon peeking out from under the Buttonbar, but you can’t scroll down to see it. Sad.
No, this isn’t a new native application but, it gets us one step closer to deploying applications onto the iPhone once we can compile them, which is still a long way off.


I’m going to buy one. It is very useful info. I’m envious!
hi i enjoyed the read
I’ve made an application with exactly same directory structure. iPod Touch loads the application but just displays the background image and after sometime returns to the home page. Any guesses where I might be wrong?
Don\’t pay for your iPhone 3G, get one free.
Hiya! I just would like to give an enormous thumbs up for the good data you have got here on this post. I will probably be coming again to your blog for extra soon.
Mophie Iphone 4 Since june 2007, iPhone Cell phones have grow to be the major choice for cell phones users.
If you don’t make your dreams a reality reality will take away your dreams.
I\’m trying to find a way to get my ex back…anything! Its hard when a relationship ends over a misunderstanding.
friend, I really admire the way you have framed this particular challenge plus it really does furnish me personally a lot of fodder for consideration. However, from what I have witnessed, I simply just trust as the responses pile on that men and women continue to be on issue and don’t commence upon a rant regarding the news of the day. However, thank you for this superb piece and though I might not really agree with it in totality, I regard your perspective.
great new deal,check this offer,iphone 5 newly released…
[...]computers should be less friendly » Blog Archive » iPhone Applications[...]…
Mobile, nokia mobile, nokia…
[...]computers should be less friendly » Blog Archive » iPhone Applications[...]…