What happens if you forgot your iPhone passcode and cannot gain access? Perhaps a friend played a prank on you and changed your passcode, or more simply, applied one when you hadn’t been using one at all. You’re effectively locked out of your device with no means to regain access. The only solution for this is to connect to iTunes, put your device in recovery mode and restore it from a backup. Or is it?
In this article, I’ll walk you through restoring your device and resetting your iPhone password (and your entire device effectively), followed by how jailbreakers are again in luck in a scenario like this.
The Conventional Restore
A conventional method of dealing with forgotten passcode is to bypass the lock screen altogether, put your iOS device in recovery mode and restore to default, hereby losing all your precious data in the process (you can also restore from a backup).
Follow the steps below to restore your iPhone and reset the password:
- Disconnect your iPhone from the PC/Mac. Make sure iTunes is running on your computer
- Power off the device by pressing and holding the sleep button until ‘Slide to power off‘ appears.
- Press and hold the ‘Home’ button on your iPhone and while keeping in pressed, reconnect it back to the computer via USB cable.
- As soon as USB cable is attached, the phone should begin to boot. Keep holding the Home button until an alert message pops up, confirming the detection of an iPhone in recovery mode.
- In iTunes, select your iPhone and under the Summary tab, hit the Restore button.
By doing so, you’ll be restoring your iPhone to its factory state, hence removing everything including the passcode. From here on, you can either start fresh or restore from a previous backup, which hopefully you’ll already have.
Resetting iPhone Password Without Losing Data – Jailbreak Only
For jailbroken devices, the root access that comes along with a jailbreak can also be very useful in the case the user forgot the iPhone passcode. The process involves gaining access to the var/KeyChains root directory and deleting the keychain that holds the passcode information.
To achieve this, you’ll need a method of gaining root access into your device, either via wireless SSH or a free program like iPhone Explorer (I personally favor this). Please note that this method will require your device to be already jailbroken and OpenSSH installed if you plan on using wireless SSH. This method may also fail if your device was jailbroken using limera1n and you haven’t reinstalled the afc2add service.
The following steps utilize iPhone Explorer (download here) to remove the passcode lock on your iPhone or iPod Touch without losing data, for both Windows and Mac.
- Connect your powered-on device to the PC/Mac using USB cable.
- Launch iPhone Explorer and select Root Directory from the left hand pane.
- Navigate to var > Keychains
- Within Keychains, locate the one titled keychain-2.db. Right-click on it and Delete Selected.
- Disconnect your iPhone from the computer, power it off and power back on. The passcode lock would be removed without affecting your personal data or settings.
Did this method work for you? Found the tip useful? What do you do when you forget your iPhone passcode? Let us know through your comments and spread the word.