inicio mail me! sindicaci;ón

Archive for Platforms

Running your own iPhone applications without paying the developer fee

For those of you wanting to build off-line, native applications for the iPhone / iPod Touch (with the 2.0 Software Update), you might have been disappointed to hear you need to shelve out $99 yearly for the privilege of being able to run your applications on a real iPhone.

Ok, $99 might not be a lot, but one also has to consider when you come to deploy your app for real, it might not pass through the rather stringent screening process to get it to the masses through the App Store.

Wouldn’t it be great if you could deploy any application you wanted for free?

Well thanks to the recently released pwnage tool, it’s now possible to run non-Apple-approved applications on your iPhone though “Jailbreaking”. I’ve spent quite a while trying to figure out how to get this working. Here’s what i have come up with so far.

First of all…

If you are not using a Mac, or you don’t have the iPhone SDK installed, or alternatively the “open toolkit”, then these instructions will be of no use to you.

If you haven’t done so yet, Jailbreak your iPhone / iPod touch via the “pwnage tool”. For reference, this is what i did:

  1. Download the pwnage tool
  2. Create and transfer Jailbroken firmware using the pwnage tool

After you’ve done all that, you’ll probably notice a new application called “Cydia” appears on your iPhone screen. This is basically the way end-users can access a wide range of free “homebrew” applications on their Jailbroken iPhone’s. If you want to deploy your application to end-users, you’ll have to get it into Cydia.

But enough about Cydia for now…

I’ve built applications, how on earth do i get them over to my iPhone?

If you are using XCode, make sure you set the SDK of your application to “Device - iPhone OS 2.0″ (or the equivalent if it exists). Then all you need to do is click “Build and go”, and your application should appear on your iPhone.

Now you’ll probably get this rather “Unexpected error” popping up if you try and run your application with XCode.

Unfortunately while the pwnage tool allows you to run any application, that application still needs to be signed. So how do you sign it? Well, the best tutorial for that i have found is the “Code Signing Guide” on Apple’s website.

You’ll need to make a self-signed certificate using the Keychain Access utility. Then you should run the following commands in a terminal on your built application:


export CODESIGN_ALLOCATE=/Developer/Platforms/iPhoneOS.platform//Developer/usr/bin/codesign_allocate
codesign -fs "Name of your certificate here" /Path/to/your/built/application.app

Unfortunately even when you do this, you still cannot run your app using XCode, so you can’t use any of those fancy debug tools with it.

In order to run your application, you’ll have to copy it over yourself. You can either use OpenSSH (installed through Cydia), or iphonedisk. I used OpenSSH, as i had problems with the permissions not being preserved with iphonedisk:


scp -r /Path/to/your/built/application.app root@address_of_your_iphone_or_ipod:/Applications/

Re-load the springboard either by installing something with Cydia, or restarting your iPhone. And hey presto, your app appears!

Update: There is now a way to get your apps working directly from XCode. Simply follow the instructions here, and you should be able to debug your application straight from XCode. Neat!

Note: there are of course other ways to get your app working, but personally i found signing it to be the most obvious.

Right, now my application is ready for public consumption

Great! So how do we get it into Cydia? Well there are two options:

  1. Get the Cydia guy’s to host it in their repository
  2. Make your own repository

Well i couldn’t figure out how you are meant to contact the Cydia guy’s to get your application in their repository. Realistically speaking, this is the only way people are going to find your application, considering there is currently no user friendly way to add new repositories to Cydia.

After all, would you really want to type all of this into the terminal to add a single repository?


ssh root@address_of_your_iphone_or_ipod
echo "deb http://location.of/apt_repository/ ./" > /etc/apt/sources.list.d/apt_repository.list

To conclude

If you are really serious about making money off developing iPhone apps, then i’d cough up and pay the $99 developer fee. That way you’ll be able to target every iPhone / iPod Touch user, while being able to charge a fee for downloading.

If however you have an application Apple are never going to distribute (e.g. emulators), or you are just playing about and don’t mind the lack of XCode integration for on-device debugging, then developing for Jailbroken devices is for you. Personally though i’d recommend you compile your own “open toolkit”, as developing your own unofficial apps using the official SDK is legally questionable.

First Impressions of iPhone v2.0 Firmware

Finally, Apple have released version 2.0 of their iPhone and iPod Touch firmware. Priced at $9.95 for Touch owners (though free to iPhone owners), i think it delivers excellent value for money, especially considering the previous update for the iPod Touch cost $20 and didn’t include the App Store.

The new features i am interested in however are all tied into the web browser. Specifically, the database support, touch event handling, CSS transforms, and to tie everything together to make more native-looking apps, full-screen support.

So is it worth it?

Well i am pleased to report that most of these features have made their way to the update. My database demo which i posted about previously works fine, though initially i was a bit concerned that i didn’t see a “databases” section in the configuration options in Safari.

Turned out that this only appears when at least 1 database is created. A word of warning though: when i deleted my test database, the section vanished and i could only get it back by restarting the system. So watch out if you are playing about with it.

Sadly it appears that one of the binding features, the full-screen support, hasn’t made it into the update. Supposedly, you are meant to insert the a “apple-touch-fullscreen” meta tag into your HTML document, but i didn’t notice any difference whatsoever when i tried it. A huge disappointment, IMO.

Regardless, i think this is a positive step towards making the iPhone/iPod’s web application development platform actually useful - in a stark contrast to just over a year ago when Apple were promoting a rather limited web development platform with none of these cool features as the only way of getting third party applications on the iPhone.

Let’s not forget that for those not content with working within the limitations of the iPhone’s web development platform, there is now also the native iPhone SDK. So all in all, there’s a bit for everyone in this update.

So is it worth installing? Hell, yes!

Close
Powered by ShareThis