[GUIDE] OnePlus One - How to Unlock Bootloader, Install Custom Recovery and Root

Search This thread

EkkieBA

Member
Nov 13, 2017
7
0
Error message when installing custom recovery

Hi,

I am following this guide but ran into a problem in step 2 Installing a custom recovery: I put my phone into fastboot mode, rename the recovery file, and run the commands as listed in the guide. Everything works fine until the command 'fastboot flash recovery recovery.img', which gives me the error message Failed (remote: Device not unlocked cannot flash or erase).

I am working with a Oneplus One China version with ColorOS, and I implemented all the steps from Step 1 (unlocking the bootloader) except disabling CM recovery protection (which you said was not necessary for ColorOS in your previous reply). Any idea what could be going wrong?

Many thanks in advance
 

RodMyers

Senior Member
Jun 21, 2011
141
14
Hi,

I am following this guide but ran into a problem in step 2 Installing a custom recovery: I put my phone into fastboot mode, rename the recovery file, and run the commands as listed in the guide. Everything works fine until the command 'fastboot flash recovery recovery.img', which gives me the error message Failed (remote: Device not unlocked cannot flash or erase).

I am working with a Oneplus One China version with ColorOS, and I implemented all the steps from Step 1 (unlocking the bootloader) except disabling CM recovery protection (which you said was not necessary for ColorOS in your previous reply). Any idea what could be going wrong?

Many thanks in advance

Dumb question. What did you rename the IMG file to? recovery.img or something else? Is the "recovery.img" in the same directory you are working?
 

EkkieBA

Member
Nov 13, 2017
7
0
Dumb question. What did you rename the IMG file to? recovery.img or something else? Is the "recovery.img" in the same directory you are working?

Could you explain why exactly this was a 'dumb question', so that I can improve my queries in the future? As I said, I followed the instructions to the letter in step 1 with the one exception, so I renamed the file recovery.img as instructed, and I replaced the file path following cd in the appropriate command with the correct file path in which the recovery file is saved.
 

Mr.Ak

Senior Member
Jan 14, 2015
4,410
1,970
23
*RESTRICTED AREA*
Dumb question. What did you rename the IMG file to? recovery.img or something else? Is the "recovery.img" in the same directory you are working?
You're the one who's asking dumb questions now.Did you even see his error before replying to him? :/

---------- Post added at 12:20 AM ---------- Previous post was at 12:18 AM ----------

Hi,

I am following this guide but ran into a problem in step 2 Installing a custom recovery: I put my phone into fastboot mode, rename the recovery file, and run the commands as listed in the guide. Everything works fine until the command 'fastboot flash recovery recovery.img', which gives me the error message Failed (remote: Device not unlocked cannot flash or erase).

I am working with a Oneplus One China version with ColorOS, and I implemented all the steps from Step 1 (unlocking the bootloader) except disabling CM recovery protection (which you said was not necessary for ColorOS in your previous reply). Any idea what could be going wrong?

Many thanks in advance
It is self-explanatory,your bootloader isn't unlocked.
Command to check bootloader status: fastboot oem device-info
 
Last edited:

EkkieBA

Member
Nov 13, 2017
7
0
You're the one who's asking dumb questions now.Did you even see his error before replying to him? :/

---------- Post added at 12:20 AM ---------- Previous post was at 12:18 AM ----------


It is self-explanatory,your bootloader isn't unlocked.
Command to check bootloader status: fastboot oem device-info

I figured as much, but do you have any idea why it would not be unlocked after I implemented step 1? Additional info: my data has not been wiped after the command 'fastboot oem unlock', so I'm guessing that this command hasn't worked properly somehow?

The output from the fastboot oem device-info command is

C:\Program Files (x86)\Minimal ADB and Fastboot>fastboot oem device-info
...
(bootloader) Device tampered: true
(bootloader) Device unlocked: false
(bootloader) Charger screen enabled: false
OKAY [ 0.006s]
finished. total time: 0.007s

C:\Program Files (x86)\Minimal ADB and Fastboot>
 
Last edited:

Mr.Ak

Senior Member
Jan 14, 2015
4,410
1,970
23
*RESTRICTED AREA*
I figured as much, but do you have any idea why it would not be unlocked after I implemented step 1? Additional info: my data has not been wiped after the command 'fastboot oem unlock', so I'm guessing that this command hasn't worked properly somehow?

The output from the fastboot oem device-info command is

C:\Program Files (x86)\Minimal ADB and Fastboot>fastboot oem device-info
...
(bootloader) Device tampered: true
(bootloader) Device unlocked: false
(bootloader) Charger screen enabled: false
OKAY [ 0.006s]
finished. total time: 0.007s

C:\Program Files (x86)\Minimal ADB and Fastboot>
Very strange.I've chinese variant of OPO as well,but I didn't had any issues while unlocking bootloader on it.
P.s.:
https://www.youtube.com/watch?v=QDKOEtN9pbo
Do this first,after that,you should be able to unlock bootloader just fine.
 
Last edited:
  • Like
Reactions: EkkieBA
Jan 24, 2017
6
0
i typed this

What exactly was your last command?

fastboot flash recovery recovery.img
fastboot flash boot boot.img
fastboot flash system system.img
fastboot flash cache cache.img
fastboot flash userdata userdata.img
Hopefully you won't get an error, such as "failed".
Then do the command: "fastboot reboot".

i tried with ADB

i checked with fastboot devices it shows that, there is a device. i tried with stock rom and it installed but no luck.

i tried with bacon and oneplus toolbox and windroid nothing happens.. i tried to flash kernel.. smh...
lastly i tried with color OS MSM8975D seems not be able to show port of my device on the list..
please help.... thank you and please excuse my bad english
 

Mr.Ak

Senior Member
Jan 14, 2015
4,410
1,970
23
*RESTRICTED AREA*
fastboot flash recovery recovery.img
fastboot flash boot boot.img
fastboot flash system system.img
fastboot flash cache cache.img
fastboot flash userdata userdata.img
Hopefully you won't get an error, such as "failed".
Then do the command: "fastboot reboot".

i tried with ADB

i checked with fastboot devices it shows that, there is a device. i tried with stock rom and it installed but no luck.

i tried with bacon and oneplus toolbox and windroid nothing happens.. i tried to flash kernel.. smh...
lastly i tried with color OS MSM8975D seems not be able to show port of my device on the list..
please help.... thank you and please excuse my bad english
Okay,what is it that you were wanting to do? What is the state of the device now?
 
Jan 24, 2017
6
0
Oneplus One stuck on Starting LOGO

Okay,what is it that you were wanting to do? What is the state of the device now?

Just the starting logo and i can go into fastboot but not on recovery..its just dont work..

is it possible that hardware can cause this issue? i tried stalling stuck rom it writes but wont load up after starting logo..
 

EkkieBA

Member
Nov 13, 2017
7
0
Very strange.I've chinese variant of OPO as well,but I didn't had any issues while unlocking bootloader on it.
P.s.:
https://www.youtube.com/watch?v=QDKOEtN9pbo
Do this first,after that,you should be able to unlock bootloader just fine.

So I reran everything from the beginning. After the command fastboot oem unlock the phone asked me a question in Chinese with the word 'cache' in it, so I'm assuming it was asking me whether I wanted to wipe my phone (?). I selected yes, and after that all the steps until step 3 A) seemed to work fine. However, my phone does not seem to go into recovery mode: when I press power + volume down, I'm asked to enter my pin number and it goes to the standard (uncostumized) home screen. All of my data has been wiped except for some pics sent through Whatsapp and some mp3 files. My pc does not recognize my phone anymore (e.g. when I run the command fastboot oem device-info, the response is 'waiting for any device', and when I run the command fastboot devices it does not list my phone as a connected device).

Anyone can offer any help as to what went wrong?

Thanks a million in advance

P.S. For future reference, I'm a she, not a he
 
Last edited:

Mr.Ak

Senior Member
Jan 14, 2015
4,410
1,970
23
*RESTRICTED AREA*
My pc does not recognize my phone anymore (e.g. when I run the command fastboot oem device-info, the response is 'waiting for any device', and when I run the command fastboot devices it does not list my phone as a connected device).

Anyone can offer any help as to what went wrong?

Thanks a million in advance

P.S. For future reference, I'm a she, not a he
When your device is connected,manually select unknown device(or any device seemingly related to your device with a caution sign on it) and upgrade adb/fastboot driver.After that it should detect the device just fine.
P.S. Duly noted that you're a girl. :)
P.S2 Are you rooted? If yes,use this
If not,root using kingoroot or kingroot.
 
Last edited:

EkkieBA

Member
Nov 13, 2017
7
0
When your device is connected,manually select unknown device(or any device seemingly related to your device with a caution sign on it) and upgrade adb/fastboot driver.After that it should detect the device just fine.
P.S. Duly noted that you're a girl. :)
P.S2 Are you rooted? If yes,use this
If not,root using kingoroot or kingroot.

Strange, under device manager my PC does recognize my phone as a Oneplus Device, and when I try to upgrade the driver anyway using the universal ADB driver link in the guide it confirms that this driver has already been installed. The Kingroot program however does not seem to recognize my device either: the program says 'Device undetected' in the lower left corner and I get the message 'Network Connection failed' after it tries to connect to my device. I double-checked whether USB debugging was enabled, and disabled and enabled it again, same result. I also got the error message that multiple devices were connected to my pc (which was not the case).
In terms of the guide steps: I started the rooting process with option A), and the command
adb push UPDATE-SuperSU-vX.XX.zip /sdcard/
seems to have worked, but I do not get the screen with install options, simply the home screen.
 
Last edited:

Mr.Ak

Senior Member
Jan 14, 2015
4,410
1,970
23
*RESTRICTED AREA*
Strange, under device manager my PC does recognize my phone as a Oneplus Device, and when I try to upgrade the driver anyway using the universal ADB driver link in the guide it confirms that this driver has already been installed. The Kingroot program however does not seem to recognize my device either: the program says 'Device undetected' in the lower left corner and I get the message 'Network Connection failed' after it tries to connect to my device. I double-checked whether USB debugging was enabled, and disabled and enabled it again, same result. I also got the error message that multiple devices were connected to my pc (which was not the case).
In terms of the guide steps: I started the rooting process with option A), and the command
adb push UPDATE-SuperSU-vX.XX.zip /sdcard/
seems to have worked, but I do not get the screen with install options, simply the home screen.
What that adb command does is simply copy that file to your sdcard.To flash it,you'll have to use the recovery.The ideal method of booting into recovery would be just after you flash it using fastboot,so as to make it permanently replace stock recovery.
About kingroot,you have to be connected to the internet.
If your device is getting detected in Device Manager,you should see a response on fastboot devices.
 

EkkieBA

Member
Nov 13, 2017
7
0
What that adb command does is simply copy that file to your sdcard.To flash it,you'll have to use the recovery.The ideal method of booting into recovery would be just after you flash it using fastboot,so as to make it permanently replace stock recovery.
About kingroot,you have to be connected to the internet.
If your device is getting detected in Device Manager,you should see a response on fastboot devices.

Strangely enough there is no response when I run the command fastboot devices:
C:\Users\n10127>cd C:\Program Files (x86)\Minimal ADB and Fastboot
C:\Program Files (x86)\Minimal ADB and Fastboot>fastboot devices
C:\Program Files (x86)\Minimal ADB and Fastboot>

Running the following commands again gives me the final error message that no device is found:
Microsoft Windows [Version 10.0.16299.64]
(c) 2017 Microsoft Corporation. All rights reserved.
C:\Users\n10127>cd C:\Program Files (x86)\Minimal ADB and Fastboot
C:\Program Files (x86)\Minimal ADB and Fastboot>adb reboot bootloader
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
C:\Program Files (x86)\Minimal ADB and Fastboot>fastboot flash recovery recovery.img
target reported max download size of 536870912 bytes
sending 'recovery' (10106 KB)...
OKAY [ 0.391s]
writing 'recovery'...
OKAY [ 0.231s]
finished. total time: 0.622s
C:\Program Files (x86)\Minimal ADB and Fastboot>fastboot reboot
rebooting...
finished. total time: 0.000s
C:\Program Files (x86)\Minimal ADB and Fastboot>adb reboot recovery
error: no devices/emulators found

Should I try reinstalling the drivers, or perhaps install the complete ADB and fastboot package instead of the minimal package?

Thanks again for all the help!

P.S. About kingroot: I was definitely connected to the internet, so I don't think that this was the issue
 

Mr.Ak

Senior Member
Jan 14, 2015
4,410
1,970
23
*RESTRICTED AREA*
Running the following commands again gives me the final error message that no device is found:
Microsoft Windows [Version 10.0.16299.64]
(c) 2017 Microsoft Corporation. All rights reserved.
C:\Users\n10127>cd C:\Program Files (x86)\Minimal ADB and Fastboot
C:\Program Files (x86)\Minimal ADB and Fastboot>adb reboot bootloader
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
C:\Program Files (x86)\Minimal ADB and Fastboot>fastboot flash recovery recovery.img
target reported max download size of 536870912 bytes
sending 'recovery' (10106 KB)...
OKAY [ 0.391s]
writing 'recovery'...
OKAY [ 0.231s]
finished. total time: 0.622s
C:\Program Files (x86)\Minimal ADB and Fastboot>fastboot reboot
rebooting...
finished. total time: 0.000s
C:\Program Files (x86)\Minimal ADB and Fastboot>adb reboot recovery
error: no devices/emulators found
So,you're still able to flash stuff regardless of no response from fastboot devices?
If so,after you flash the recovery,disconnect the device and reboot into recovery manually by simultaneously pressing power+vol down until you see TWRP splash screen.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 480
    KFIFrYV.png


    Setup, Preparation and Prerequisites

    I know there are already a few root guides out there for this phone, but I found that they weren't very detailed. This guide is thorough and explains each and every step in a noob-proof manner.

    Basic tasks that I may refer to throughout this guide:
    • Open command prompt - Press Window Key + R, type in "cmd" (without the quotes), and hit enter.
    • Enter fastboot mode- Turn the phone off. Hold volume up + power until the "fastboot" screen appears.


    ADB and Fastboot Installation
    1. Download the full Android SDK here (scroll to the bottom of the page>DOWNLOAD FOR OTHER PLATFORMS>SDK Tools Only) or get a slimmed version containing only the essential components here
    2. Extract the zip and place the android-sdk-windows folder on your desktop.
      **If you chose to download the slimmed sdk skip to step 5**
    3. Only if you downloaded the full sdk: Go into the android-sdk-windows folder and run SDK Manager.exe. Install the following packages (there are a total of 4 packages):
      - Tools > Android SDK Tools, Android SDK Platform-tools
      - Extras > Android Support Library, Google USB Driver

    4. Only if you downloaded the full sdk: Go back into the android-sdk-windows directory, and you should see a new folder named platform-tools. If you don't see this new folder, repeat the step above.
    5. To confirm that it is indeed working, open a command prompt window and enter the following commands:
      Code:
      cd Desktop/android-sdk-windows/platform-tools
      adb version
      If it displays "Android Debug Bridge version x.x.xx" it is working. If it is gives an error saying that adb is not a recognized command, it has not been successful. Carefully repeat the steps above if this is the case. Close the command prompt window when you are done.
    • Show File Extensions - Open a command prompt window and run "Control folders" (without the quotes). Go to the View tab and uncheck the "Hide extensions for known file types" option. This will help avoid confusion when renaming files.
    • Battery - Ensure that your phone has at least 60% battery remaining, and that your PC is plugged in and wont shut down spontaneously during the process. The procedure doesn't take very long (5-15 minutes), but its best to have enough charge in case something goes wrong.
    • Backup (Optional) - Unlocking the bootloader will completely wipe all data from the device. This includes apps, settings and even the contents of the internal sdcard (pictures, music, etc.). Copy all important files off the phone onto a PC or upload them to a cloud.
    • Driver Installation - Download and install the Universal ADB Driver. Alternatively, use this method.


    Downloads
    Download a custom recovery and the SuperSU zip below. Place both files (recovery image and root zip) in the platform-tools folder located on your desktop within the android-sdk-windows folder.

    Custom Recovery:
    TeamWin Recovery Project (TWRP)

    Root:
    SuperSU


    Information
    Rooting this device is actually quite a simple and easy process. Before you begin, it is recommended that you at least try to understand what each part of the process will do. Although this guide will elongate each step in order to show all of the details, the method used can be broken up into 3 main steps: Unlocking the Bootloader, Installing a Custom Recovery and finally Rooting. Each new step relies on the previous step to have been completed, and a basic summary of each part is:

    1. Unlocking Bootloader: Opens the door to the internal memory of the device to be written on to. This allows you to flash images onto the main partitions of the phone.
    2. Installing a Custom Recovery: A custom recovery is flashed onto the recovery partition of the device and overwrites the stock recovery that exists by default. Custom recoveries bring lots of functionality and give you the ability to perform wipes, install flashable zips, create full backups of your NAND (Nandroid backup), and various other features. An unlocked bootloader is needed to install a custom recovery.
    3. Rooting: You can gain root by either flashing via recovery a pre-rooted custom rom, or flashing a zip containing the SuperSU binaries. A custom recovery is necessary to do this.

    After completing these steps your phone will be rooted, the phone will have a custom recovery installed, and the phones bootloader will be unlocked. This, in my opinion, is the most practical and beneficial method for rooting your phone. It gives you some basic adb/fastboot knowledge, and should hopefully help you have a decent understanding of what is going on. Also this method will work regardless of what android version your phone has.

    If you are confused by anything in this guide, I would highly suggest getting it clarified being before moving on. Ask your question in this thread and I or someone else will likely answer. Also I'd suggest that you read over the whole thread a few times before actually doing anything to the phone.

    Understand? Good...lets begin:


    1. Unlocking Bootloader
    • Turn the phone off. Then boot it into fastboot mode by holding volume up + power. The phone will display "fastboot" text indicating that it has successfully entered fastboot mode.

    • Plug the phone into your PC, then open a command prompt window and type:
      Code:
      cd Desktop/android-sdk-windows/platform-tools
      Code:
      fastboot devices
      This command will list the connected devices. If your phones serial number shows up you are good to go and may continue. If the phone is NOT listed this indicates that your drivers are not installed correctly. In order for you to continue you must fix your drivers so that your phone is listed under fastboot devices.

    • If the phone has been recognized by the command above, proceed to unlocking the bootloader with the following command:
      Remember that this step will wipe EVERYTHING off the phone
      Code:
      fastboot oem unlock

    • After the above command has finished excuting, run the following
      Code:
      fastboot reboot
      The phone will reboot. Wait until the phone has fully booted up into android, then adjust the following settings on the phone:

    • USB Debugging - On your phone go to Settings > About phone > Tap on Build number 7 times. This will enable Developer options. Now go back to Settings > Developer options > Enable USB debugging
    • Disable CM Recovery Protection - On your phone go to Settings > Developer options. Then disable the 'Update recovery with system updates' option.

    • Close the command prompt window and proceed onto the next section of the guide.


    2. Installing a Custom Recovery
    • Turn the phone off. Then boot it into fastboot mode by holding volume up + power.

    • Rename the recovery file that you downloaded above to recovery.img. *Make sure that you rename it to recovery.img NOT recovery.img.img* Remember that this file should be placed in the platform-tools folder inside of the android-sdk-windows folder on your desktop.

    • Open a new command prompt and run the following commands:
      Code:
      cd Desktop/android-sdk-windows/platform-tools
      Code:
      fastboot flash recovery recovery.img

    • Once the flash has completed type the following command to reboot the phone:
      Code:
      fastboot reboot
      After the phone has booted back up, turn it off. Now to enter your newly installed custom recovery, hold volume down + power. The phone should boot into recovery mode. Now that you have a custom recovery, you may continue to the final step.
    • Close the command prompt window.


    3. Rooting
    Now that your phone has an unlocked bootloader and a custom recovery installed you have a two options to gain root (Pick one or the other. You don't need to do both)

    Option A) Flash SuperSU binaries which will give you root with the stock ROM
    • Confirm that you have downloaded the SuperSU zip from the downloads section above and that it is located in the platform-tools folder inside of the android-sdk-windows folder on your desktop.
    • Turn the phone off then boot into recovery mode by holding volume down + power. Leave the phone at the main screen of the custom recovery for now.
    • Open a command prompt window and run the following commands:
      Code:
      cd Desktop/android-sdk-windows/platform-tools
      Code:
      adb push UPDATE-SuperSU-v[COLOR="Red"]X[/COLOR].[COLOR="red"]XX[/COLOR].zip /sdcard/
      This will copy the SuperSU zip onto your phone. Once the command has completed continue.

      Instructions for TeamWin Recovery Project (TWRP):
    • Install > browse to SuperSU zip and select the it
    • Swipe to confirm the installation. Then reboot.


      Instructions for ClockworkMod (CWM):
    • install zip from sdcard > choose zip from sdcard.
    • Next, browse to the location where you previously copied the SuperSU zip and select the it.
    • To confirm the installation, scroll down to "Yes" and select it. The installation shouldn't take very long, and once it has completed you may reboot.

    Option B) Flash a custom rom which will come pre-rooted
    • Note that not all custom roms will be pre rooted, however the majority of them are. Read the OP of the ROM thread to see what the verdict is.
    • Copy a custom rom (you can find these in the ONE Android Development and ONE Original Android Development section) onto the phone (remember the location of where you copy it to)
    • Turn the phone off then boot into recovery mode by holding volume down + power. To install a custom ROM the general procedure to follow is: factory reset, wipe cache + dalvik cache, flash ROM, flash GApps. Here are the recovery specific instructions:


      Instructions for TeamWin Recovery Project (TWRP):
    • Wipe > Swipe to Factory Reset
    • Install > browse to the location where you previously copied the ROM zip and select it > Swipe to confirm the installation
    • Install GApps using same process as ROM, then reboot.


      Instructions for ClockworkMod (CWM):
    • wipe data/factory reset
    • wipe cache partition
    • advanced > wipe dalvik cache
    • install zip from sdcard > choose zip from sdcard > navigate to the location of the ROM > select the ROM > confirm the installation by selecting "Yes"
    • After that you may install the GApps using the same method for flashing the ROM, and finally reboot the phone.

    Keep in mind that the first boot after installing a custom ROM & wiping the phone may take longer than usual, as the phone will need to rebuild the dalvik cache and initialize other first boot stuff.

    Congrats! That is all! Your phone now has an unlocked bootloader, a custom recovery installed and is rooted. Enjoy :)
    7
    FYI - if anyone else is having problems flashing TWRP (you flash it, commands are all OKAY, but it keeps rebooting into Cyanogenmod Simple Recovery), here's the fix.

    1. Disable CyanogenMod Recovery Protection:
    Open settings > developer options. Then look for an option that says 'Update recovery with system updates' and disable it.

    After doing that, REFLASH TWRP and then it will work.

    I was losing my mind wondering why the dang Cyanogenmod Simple Recovery kept popping up and not TWRP and this was the reason.
    4
    You are missing the "t" in fastboot. You wrote "fasboot", but it should be "fastboot". If that doesnt work, try adding the ./ prefix. ie: "./fastboot devices".

    Man I win i Unlock Bootloader and I flash TWRP but is it normal when I restart in recovery I still have the Cyanogen Simple Recovery ?? Damn .....


    EDITED !!!! FINALLY ROOTED MY ONE PLUS ONE !!!!!!! Finally read read read 18536 threads and I win ahahha
    3
    Everything is well until I start with "ROOTING".
    It doesn't open the recovery mode with TWRP, and when I insert the "adb push UPDATE-SuperSU-vX.XX.zip /sdcard/" command, it says "Device not found"... :(

    What can be wrong?

    Thank you very much for all your help

    First you need to get TWRP successfully installed, before you can start the rooting part. Boot up the phone normally, then go into Settings > Developer options and disable the "Update recovery with system updates" option. After that, put the phone back into fastboot mode and try the steps for Installing a Custom Recovery again.