Restore to iPhone OS 3.1.3 Firmware from iPhone OS 4.0 Beta1

I know so many people with lot of excitement upgraded their iPhone to OS 4.0 Beta1. After few minutes of discovering the new features you will realize most of your old application are crashing and not running as it is supposed to work. Many of my favorite applications did the same and I got really annoyed. I cannot really blame Apple for OS 4.0 as it is still in beta.

I decided to restore my iPhone to previous 3.1.3 firmware and I kept getting this annoying error 1015. After searching almost a day I found this method which helped me to get back to 3.1.3 firmware. I hope this will help you all


Step #1 Download and install the library “libusb”.

Step #2 Download and copy the application “iRecovery” to the desktop

Step #2 Open iTunes, click the ALT key + Restore and manually load the original 3.1.3 firmware.

Step #3 During the restore process, you’ll notice a pop up with error 1015, neglect it.

Step #4 Click Ok to close the pop-ups and close iTunes.

Step #5 Now open the terminal and type the following commands:

cd Desktop
. /iRecovery -s
setenv auto-boot true

Step #6 Wait a few seconds and disconnect the iPhone from the cable, then reboot the phone by clicking Home + Power buttons simultaneously.

Step #7 Once you connect the phone via USB and proceed normally, the Apple logo appears on the display.

My sincere thanks to Chris Martin for translating this original article.

By Imthiaz

Programmer, SAAS, CMS & CRM framework designer, Love Linux & Apple products, Currently addicted to mobile development & working @bluebeetle


  1. I was just wondering if you could possibly expand on the terminal portion of the article, I am in the same situation as you but I never have really used the terminal part before. Whenever I type there commands into the terminal it gives me weird error messages. If you could help that would be really great, thanks!

  2. For anyone trying this tutorial when you get to Step 5:

    “. / iRecovery -s” should be “./iRecovery -s”

    I hope this helps anyone.

  3. Lifesaver……Thank you so much for this. Gonna think twice now updating to a beta version

  4. I am stuck at step 5. Please help me. so u open the terminal and where do you go to tipe in anything? and do you tipe all of it or just the ./iRecover -s part?

  5. when i get to “setenv auto-boot true” I get “-bash: setenv: command not found”

  6. didn’t work for me :o( couldn’t type anything in the Terminal at all when it opened. carefully went thru the steps twice and still no dice. anyone know now how to *remove* Libusb Library? :/

  7. Worked for me to restore from Beta 3. One warning. THe iPhone will get on recovery mode, no problem.. as soon as you switch it off and reconnect to the computer and start iTunes it gets back to normal. TO restore your backup, you can not choose the latest doen with 4.0 but you need to choose a backup from 3.1.3


  8. hi, and do you know how back up to itunes 9.1.1 when 9.2 beta is installed ?

    thank’s !

  9. Ok, so it worked like a charm. But being curious, I tried to click the restore button as I would have done previously to installing iSO 4. I get the same error message everytime, and have to do the same steps in order for my phone to work. When they release the real version of iSO 4 and others versions, will I need to do the same steps in order to update my phone?

    I feel like I’ve screwed up my phone, and wish I’d never installed the beta version.

  10. If I do this do I lose everything on my phone or will it all still be there with just th eprevious OS?

  11. Hey!! I got a quick question on this. If i do it, what happens to the baseband?


  12. Hey!
    so i literally just got my iphone 3gs and upgraded to 4.0 since everyone said its amazing. which it really isnt. ive tried everything and it refuses to work. it seems the error im getting is from libusb. is it because im using windows??

    pleasee help im so sick of 4.0

  13. So you say to download firmware an app and a file but never say when to use the app (irecovery). I opened it after 2 failed attempts at restoring my 3g and it runs code similar to what you are asking us to type in terminal but you don’t say when to use it. what is the exact sequence??

Comments are closed.