Let's check to see if jailbreaking or unlocking an iPhone makes sense for you by explaining what they actually mean: Jailbreaking allows you to load non-iTunes, third-party apps like these onto the phone, at your own risk. Unlocking lets you use another company's SIM card (for T-Mobile or international travel). That's it. And if you don't like it, you can restore the original Apple software any time using iTunes' Restore button—we've done it plenty of times.
This guide is for the original iPhone, iPhone 3G and iPod Touch running the new iPhone 3.0 firmware. If you own a 3GS, you'll need to wait since it hasn't been hacked quite yet. But if you're ready to hack your iPhone, grab your Mac or PC, iPhone and the USB adapter cable. Let's do this. (Oh, and go to THIS LINK if you'd rather see all of the instructions on one big page.)
Even if all you want to do is unlock the phone, you need to jailbreak it first, and that requires redsn0w, a Mac/PC jailbreaking program. Download the official redsnow torrent files HERE, then download redsn0w via your Bittorrent client of choice. Make sure you've backed up your iPhone to your computer before moving forward. That creates a data restore point in case you want to ditch the jailbreak apps. Done? OK. Last, if you're moving your phone to T-Mobile, disable 3G before going on to the next step.
Redsn0w works by patching the iPhone firmware file on your computer, then loading it onto your iPhone without using iTunes. So open redsn0w. Follow its instructions to select your .ipsw (iPhone firmware) file. On Macs, you can find the file at Home Folder/Library/iTunes/iPhone Software Updates. Or just download a new one from HERE. Once you've found your .ipsw, move on.
Begin patching, but keep in mind this one setting: Redsn0w will ask if you want to install Cydia or Icy or Both. (These are apps that can load programs on jailbroken phones and will be needed to unlock the phone later.) JUST INSTALL CYDIA, NOT BOTH, OR ERRORS ARE PRONE TO ARISE LATER. TRUST ME. Once the .ipsw file is patched, make sure to plug in your iPhone then turn it off while still plugged. When you see the screen "Click NEXT when your iPhone is both OFF and plugged in..." go on to the next step.
Now you need to put your phone into DFU mode to load the patched firmware. You'll hold the top power button for two seconds, then hold the Home button with it for 10. Then you'll release the top button and just hold Home for 30 or so. It's not as hard as it sounds, and if you mess up you can just try again, but you need to pay attention, so make sure you're holding your phone and watching the computer screen when you hit "next." Redsn0w will guide you through the pattern of holding the top and home buttons in timed succession. If you're successful, redsn0w will inform you that your phone is being jailbroken and you can stop holding the Home button. If you're not, redsn0w will reset the process and you'll probably need to manually restart your iPhone.
Wait as the jailbroken firmware loads onto your iPhone. (You'll see a disk drive on the phone's screen, then this cute pineapple graphic as it installs.) After a few minutes, the phone will reboot just as it does with official firmware. Congratulations, your phone is jailbroken! Most of you are done—just load Cydia (which is now an app on your iPhone) and search for apps you'd like to install. Others need to continue this tutorial for the unlock.
If you want to unlock your original or 3G iPhone so it can take a T-Mobile or international SIM, follow these next steps. You're done with your computer, so make sure your iPhone is on a Wi-Fi connection. We're going to use Cydia to download and install ultrasn0w, which unlocks your iPhone.
Cydia will first ask what kind of interface you'd like. I'm no hacker, so I chose the graphical view. Then Cydia will want to download at least 2 Essential Upgrades. Let it by choosing "complete upgrade." If Cydia's successful, you'll see a bunch of install code and the option to "Close Cydia (Restart)." Hit that button. (Note: If you are getting errors in this step, it may be because you installed both Cydia and Icy. If you did that, restore your iPhone with official 3.0 firmware via iTunes and start the process over.)
Reopen Cydia. Go to Manage -> Sources -> Edit - > Add and then enter "repo666.ultrasn0w.com" in the text field. This should add ultrasn0w as a Cydia source so that you can download the ultrasn0w software. Choose to return to Cydia and then click "Done".
Click the repo666.ultrasn0w.com listing under your Sources. Click repo666.ultrasn0w.com again at the next screen (redundant, we know). Then click Install. You'll see a black screen with some text and, after a few seconds, it should read "Complete". Reboot your phone with your new SIM.
Congratulations, your iPhone is unlocked! But if you're having any type of problems (it's not our fault!!) check out the Dev Team blog. Chances are that if you've encountered a particular issue, so has someone else.