From ModMyiFone - Wiki
This is page 3 of the Getting Started iPhone Modding in OS X guide.
You should be running an activated, jailbroken iPhone with 1.1.1 firmware and Installer.app installed.
Make sure your AutoLock is set to never (Settings>General>Auto-Lock>Never on your iPhone).
On your iPhone's home screen, tap the blue Installer icon.
Installer will open up. Press the Install icon on the bottom, and scroll down to System. From there, choose BSD Subsystems and press Install. This will take around 5 minutes, and eventually kick you back to the Install screen. Now, scroll down to the Tweaks (1.1.1) category and tap it.
Now, find the file called OktoPrep, click it, and press Install.
You will get a message saying you are now ready to perform an "update" to 1.1.2 and continue the Touch-Free process. Good.
Bring up iTunes with your iPhone connected to the computer.
NOTE: If you are following the 1.1.1 unlocked to 1.1.2 guide, click the iPhone tab in iTunes now, and skip down 3 images in this guide and start following again from "Good. Now hit update...
iTunes will display a screen asking you to Set Up Your iPhone. Click Set up as a new iPhone, and hit Continue.
Name it whatever you'd like.
You should now see the following screen:
Updated: Since the release of the 1.1.3 firmware, you can no longer upgrade to 1.1.2 automatically through iTunes. First, you need to manually download the 1.1.2 firmware here: Click Here
Once you manually downloaded the firmware, launch iTunes. Hold the SHIFT key for windows users or the OPTION key for MAC users and click the Update button (DO NOT CLICK THE RESTORE BUTTON!). Manually browse to the 1.1.2 firmware you just downloaded and click Ok. Let the update process finish.
You should now see the Slide for emergency screen on your iPhone. Hit eject in iTunes to eject the iPhone, and quit iTunes.
Open up the 1.1.2 jailbreak software we downloaded in the beginning of this guide, and double-click on the jailbreak.jar file. NOTE: MAKE SURE YOU HAVE AN UPDATED VERSION OF JAVA or you will get nowhere.
If you will be doing any modding, I recommend you tick the Install SSH button on the screen that pops up. You can change the password here (a good idea), although when I did it wouldn't install and I had to restart the jailbreak.jar program. You can always change it later. When you're ready, press Jailbreak!
The program will take about 5 minutes to run through a bunch of steps, and will then tell you your iPhone will "reboot a couple of times" (yup, it will).
All right, thats it! Your iPhone is now running 1.1.2, jailbroken, activated, and ready to mod on and rock.
NOTE: If you were doing this guide to unlock an iPhone you were upgrading to 1.1.2 from an older firmware, you can go back to the 1.1.2 upgrade unlock guide now.