Since before the iPhone first shipped, folks have been eagerly waiting to get one in their hot little hands, and break it. To tear it apart, find out what makes it tick, and make it better. I'm sure that many of you have seen the articles here and there about folks installing new applications onto the phone, a Terminal, then later games like Tetris and Tic-Tac-Toe, and now an actual Nintendo emulator and a version of DOOM. This is where things are now starting to get interesting...
Compiling applications and installing them on the iPhone is not for the faint of heart, but thanks to the hard work of many folks, it is now getting easier for lesser folks to get in on the fun. iPhone Central recently published an article called The iPhone Hacking Kit, step by step, and it is a great guide for those wanting to get in on the action. Even with this guide, I still had a few issues, though, but I will walk you through them.
First, I can't say enough good things about the developers who got this all working, and are still working to make things better. And the MacWorld folks did a great job at compiling information from several sources and bundling up a download that's easy to get and easy to use. The issues I had following the directions were minor, but had unexpected consequences. Please take a moment to review their article, and then my comments below.
My first problem was with the setafc command, part of the iphuc software, which is used to set the AFC (Apple File Connection) being used to talk to the phone. Normally, the AFC is restricted to only letting iTunes sync its data to the phone, and only a limited number of directories can be accessed. After jailbreaking the phone, the setafc command listed in the article opens up the phone so that all directories can be accessed.
Anyway, apparently you need to make sure that the values returned eventually get to zero for each parameter returned, even if you get no error message. Repeat the command a few times, exit iphuc and then Terminal, and try again, restart the phone if you have to. It is important to get these values to zero. My first time through, I thought I had everything done right, but ended up stuck in a mode where I couldn't get to the full file structure, and ended up restoring the phone's software. I think that if I'd worked it a bit more, I'd have gotten it, but it was late and I just wanted to get back to a fresh starting point.
The next trick, when you get to doing the putfile commands, you do need to specify the full destination path and filename at the end. So, when copying files to /System/Library/LaunchDaemons, for example, make sure that you add the filename at the end that you're putting there.
I ended up using Stickies to copy/paste a command to get the structure, then duplicated this a few times and copied/pasted in the file/path names to make sure they were all right.
Later in the article, you do some scp commands to transfer files to the phone. This is not a command you enter while in iphuc, or while ssh'd to the phone. Open a new terminal window, and enter those commands here.
With those tips, you should be able to get through this easily, and you'll be well on your way to overloading your iPhone with fun new things to do.