Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,806,018 Members 45,483 Now Online
XDA Developers Android and Mobile Development Forum

[GUIDES][Q&A]How-To Guides For Beginners + Q&A

Tip us?
 
timmaaa
Old
(Last edited by timmaaa; Today at 07:58 AM.)
#1  
timmaaa's Avatar
Recognized Contributor - OP
Thanks Meter 6,213
Posts: 13,125
Join Date: Jun 2011
Location: Melbourne

 
DONATE TO ME
Default [GUIDES][Q&A]How-To Guides For Beginners + Q&A

Timmaaa's How-To Guide For Beginners + Q&A
OnePlus One

See Also:
[INDEX] OnePlus One Resources Compilation Roll-Up


This thread will serve as a location for basic how-to guides for the OnePlus One (Bacon). I'm going to start off with a couple of the more obvious ones and go from there. If anyone has any suggestions for additions please feel free to let me know.
Please note: you'll need a working adb/fastboot environment on your PC to get through some of these guides. There are many guides on how to install adb/fastboot available on XDA, but Minimal adb & fastboot is probably the most hassle-free. You'll find universal adb/fastboot drivers here.


By attempting any of the processes listed this thread you accept full responsibility for your actions. I will not be held responsible if your device stops working, catches on fire, or turns into a hipster and claims to have been modified before it was cool.

Index
1.How To Unlock Your Bootloader

2. How To Install A Custom Recovery On Your Device

3. How To Make A Nandroid Backup With TWRP Recovery

4. How To Root Your Stock Rom

5. How To Install A ROM with TWRP Recovery

6. How To Install A Custom Kernel With TWRP Recovery

7. How To Flash The Stock Kernel With Fastboot

8. How To Adb Sideload The 30O CM11S OTA Update

9.How To Flash The XNPH33R Fastboot Images

10. How To Make Sure You Can Pretty Much Always Recover From An Accidentally Wiped System

11. How To Backup & Restore Your EFS Partition
1. How To Unlock Your Bootloader
Power off your phone then boot into fastboot mode (power + volume up). Open a command prompt from within your fastboot folder (navigate to where you have fastboot.exe located on your PC, shift + right click anywhere within that folder, select open command prompt here). Check your fastboot connection by issuing this command:

Code:
fastboot devices
It should return your device serial number, if not you need to make sure your drivers are installed correctly. Once you've confirmed your fastboot connection issue this command:

Code:
fastboot oem unlock
The device will boot to a black screen with Andy the Android and some Chinese text, just let it do its thing and it'll boot up into Android. Go back to fastboot mode and issue this command to ensure that it worked:

Code:
fastboot oem device-info
It should have a couple of lines there, both with the flag set to true.

Please note: this will erase all user data from your device, it is best to do this before turning your phone on for the first time, otherwise make sure you backup anything important.
2. How To Install A Custom Recovery On Your Device
You first need to go into Settings/Developer Options and uncheck the "Update recovery with system updates" option. To enable Developer Options go into Settings/About Phone and click 'build number' about seven or eight times.

Download the recovery of your choice (my preferred recovery is TWRP, and we'll be using that for this guide, grab it here), make sure you check the md5 to verify its integrity. Place the file in your fastboot folder (this is where fastboot.exe is located on your PC), connect your phone in fastboot mode, open a command prompt from within your fastboot folder (shift + right click, select open command prompt here), and enter the following commands:

Code:
fastboot flash recovery "filename.img"
(the exact filename, minus the talking marks)

Code:
fastboot format cache
Code:
fastboot reboot
Now you can use the advanced power menu (or the power + volume down button combo) to enter your custom recovery.
3. How To Make A Nandroid Backup With TWRP Recovery
A nandroid backup is a very important thing to have before installing any custom software on your device. It's basically a backup of your stock system that you can fall back on if anything goes wrong or if you just want your stock ROM back. You can also use the backup tool to create a backup of your favourite ROM set up exactly the way you like it. The backup you create can be easily restored using the restore tool in TWRP recovery.

All you need to do is enter TWRP recovery, select the backup option from the TWRP home screen, check the system/data/boot boxes, and swipe to backup. The process will take a few minutes.
4. How To Root Your Stock Rom
First you need to download SuperSU:

http://download.chainfire.eu/452/Sup...erSU-v2.02.zip

Enter TWRP recovery via the advanced power menu (or power + volume down). Select the install option from the TWRP home screen, a file explorer will now show up, navigate to where you have SuperSU stored on your sd card and select it, swipe to install. Once you've installed SuperSU you'll have an option to wipe cache/dalvik and an option to reboot system. Wipe the cache/dalvik, hit the back button, and hit the reboot system button. That's it.
5. How To Install A ROM with TWRP Recovery
Installing a ROM is a pretty straight forward and easy process. Before you install anything you should make a nandroid backup (instructions above).

Step 1. Perform a full wipe. Select the wipe option from the TWRP home screen, select advanced wipe, check the system, data, cache, and dalvik cache options, swipe to wipe.

Step 2. Install the ROM. Select the install option from the TWRP home screen, a file explorer will now show up, navigate to where you have the ROM zip stored on your sd card and select it, swipe to install. Most ROMs will run an installer script at this point but some ROMs have what is called an Aroma Installer which allow you to choose some install options before the script runs. You will also need to install the appropriate gapps package directly after installing the ROM. Once you've installed all necessary zips you'll have an option to wipe cache/dalvik and an option to reboot system. Wipe the cache/dalvik, hit the back button, and hit the reboot system button.
6. How To Install A Custom Kernel With TWRP Recovery
A custom kernel can open up a new level of control over your device, such as overclocking/underclocking, changing governors, enabling sweep2wake, and many other options. Download a kernel that is compatible with your current ROM and check the md5 to verify its integrity.

Enter TWRP recovery, select the install option from the TWRP home screen, navigate to the kernel and select it, swipe to install. Make sure you wipe cache/dalvik cache before rebooting the system. Once your phone has booted up you can use a kernel tuning app to change governors, I/O scheduler, clock speed, and other options. Some of the popular kernel apps are Trickster Mod, No Frills, Kernel Tuner, and many more.
7. How To Flash The Stock Kernel (boot.img) With Fastboot
If you're running a custom kernel on CM11S you'll need to flash the stock kernel back in order to take an OTA update.

What you need to do is download a stock kernel from this thread. Put it in your fastboot folder (where you have fastboot.exe located) on your PC.

Boot into fastboot mode (power + volume up) and open a command prompt from within your fastboot folder (shift + right click, select open command prompt here) and issue this fastboot command:

Code:
fastboot flash boot <filename>.img
It'll take a few seconds to flash the boot.img, once it's finished you can manually reboot your phone or use the following command to reboot it:

Code:
fastboot reboot
Now you have the stock kernel back on your device.
8. How To Adb Sideload The 30O CM11S OTA Update
Please note: If you have modified system files, like volume mods or modified lockscreen, you need to use this modified updater script or the update will fail. You need to replace the original script in the OTA zip with that one. Or you can download the entire modified OTA file here and use that instead of the official one below. Credit to @DirtyDroidX, original thread here.

Please note: this is an OTA so you must have the XNPH25R build currently installed on your device in order to apply this. You can check your current build in Settings>About Phone.


Download the files here and here (the second one is a smaller incremental update, they must be applied separately with a full boot between each) to your PC, once it has completed downloading move it to the location where you have adb.exe and fastboot.exe located. Boot your phone into recovery (power phone off, then hold power + volume up), select advanced from the TWRP main menu then select adb sideload. Connect your phone to your PC via usb cable. Back on your PC open a command prompt from within your adb/fastboot folder (shift + right click on empty space, select open command prompt here), issue this command:

Code:
adb devices
This is just to verify you have a good adb connection, it should return the device serial number in the command prompt. Back on your phone swipe the blue swipe handle to initiate adb sideload mode. On your PC go back to your open command prompt window and issue this command:

Code:
adb sideload cm-bacon-d22b777afa-to-0428073396-signed.zip
(the command will differ for the second update because it has a different filename)

In the command prompt window it'll say sending and show a counter going all the way up to 100%, once that's finished sending the sideload will initiate on your phone. On your phone screen it'll most likely say that it's skipping the md5 check because it can't find one, this is ok. It might seem like it's stalling at this point, don't panic, be patient and let it do its thing. Do not remove the usb cable or you could brick your phone! The process will complete and ask you to reboot your phone, let it boot into Android once, then go back to recovery and repeat the steps for the second incremental update. Once both are finished you can remove your usb cable.

Upon attempting to reboot TWRP will probably prompt you to install SuperSU again because the update removes root, you can do this now or install it later. I prefer doing it later because I like to give the system a chance to boot fully once first. That's it, enjoy your update.
9. How To Flash The XNPH33R Fastboot Images
Please note: This procedure requires an unlocked bootloader. This procedure will factory reset your device! All user data (settings, apps, data on internal storage) will be wiped!

Download the file cm-11.0-XNPH33R-bacon-signed-fastboot.zip to your PC from here:

cm-11.0- XNPH33R -bacon-signed-fastboot.zip

Reboot your device into Fastboot Mode (power + volume up)

Connect your device via USB to your PC

Unzip the file you downloaded and put its contents into the same folder that you have adb.exe and fastboot.exe located in on your PC.

Open a command prompt from within your adb/fastboot folder (shift + right click, select open command prompt here) and issue these fastboot commands:

Code:
fastboot flash modem NON-HLOS.bin
Code:
fastboot flash sbl1 sbl1.mbn
Code:
fastboot flash dbi sdi.mbn
Code:
fastboot flash aboot emmc_appsboot.mbn
Code:
fastboot flash rpm rpm.mbn
Code:
fastboot flash tz tz.mbn
Code:
fastboot flash LOGO logo.bin
Code:
fastboot update -w cm-11.0-XNPH33R-bacon-signed-fastboot.zip
Reboot. Profit.
10. How To Make Sure You Can Pretty Much Always Recover From An Accidentally Wiped System
There may come a time when you accidentally wipe your OS while trying to perform a basic cache wipe in recovery. Don't laugh, it can happen to the best of us. The best way to insure yourself against being stuck in recovery is to keep a ROM zip or a TWRP/CWM backup (a nandroid backup) on your sd card at all times.
This solution seems like common sense but apparently there are quite a few people out there who don't store a ROM or backup on their phone. You might think it's easy to just mount the OTG storage and copy a ROM across to your phone from your PC (which is definitely an option), but there's always a chance that you won't be near your HDD or sd card at the time, or it won't recognise your phone properly. Basically you need to insure yourself against Murphy's law.
11. How To Backup & Restore Your EFS Partition
All too often on this device I've seen folks who have a corrupted or missing EFS Partition. This results in your IMEI being lost and no cellular activity on the device at all. This can be a royal PITA to fix, and some folks haven't been able to fix it at all. You can take a precautionary measure to safeguard yourself against this by taking a couple of minutes to back up your modemst files.

The first thing you need to do is open up Terminal Emulator on your phone (if you don't have it you can download it here). Once it's open you'll be greeted with a command line prompt, in which you can enter text commands, the first thing you need to do is enable root access by entering this line (press the enter key on your on-screen keyboard after each command to issue it):

Code:
su
If this is the first time you've used Terminal Emulator a Superuser or SuperSU popup will appear, make sure you grant root access. Now enter these two commands:

Code:
dd if=/dev/block/mmcblk0p10 of=/sdcard/modemst1.bin bs=512
Code:
dd if=/dev/block/mmcblk0p11 of=/sdcard/modemst2.bin bs=512
The result should look like this:



This will place two files (modemst1.bin & modemst2.bin) on the root of your internal storage, make sure you copy them to your PC immediately so that you have a backup there to use if you need to restore it in future.

If by chance you end up with a corrupt EFS partition all you need to do is flash the files back to your device using fastboot. Make sure your phone is in fastboot mode and make sure the files are in your fastboot folder on your PC. These commands will restore the files:

Code:
fastboot flash modemst1 modemst1.bin
Code:
fastboot flash modemst2 modemst2.bin
Simply reboot your device now and you should be golden. Credit goes to @Vonnegut for originally posting this method in the TWRP thread.

You can also find an auto script by @Vonnegut here, this script will backup everything in the following list that doesn't have an asterisk on the right side.

Code:
Number  Size(Kb)   Name          Device
 1      65536      modem         /dev/block/mmcblk0p1   (*) FAT16
 2      512        sbl1          /dev/block/mmcblk0p2   (*)
 3      32         dbi           /dev/block/mmcblk0p3   (*)
 4      32         DDR           /dev/block/mmcblk0p4
 5      1024       aboot         /dev/block/mmcblk0p5   (*)
 6      500        rpm           /dev/block/mmcblk0p6   (*)
 7      16384      boot          /dev/block/mmcblk0p7   (*)
 8      500        tz            /dev/block/mmcblk0p8   (*)
 9      1024       pad           /dev/block/mmcblk0p9
10      1536       modemst1      /dev/block/mmcblk0p10
11      1536       modemst2      /dev/block/mmcblk0p11
12      10240      oppodycnvbk   /dev/block/mmcblk0p12
13      10240      oppostanvbk   /dev/block/mmcblk0p13
14      1355776    system        /dev/block/mmcblk0p14  (*) EXT4
15      32768      persist       /dev/block/mmcblk0p15      EXT4
16      524288     cache         /dev/block/mmcblk0p16  (*) EXT4
17      16384      recovery      /dev/block/mmcblk0p17  (*)
18      1536       fsg           /dev/block/mmcblk0p18
19      1          fsc           /dev/block/mmcblk0p19
20      8          ssd           /dev/block/mmcblk0p20
21      1024       misc          /dev/block/mmcblk0p21
22      16384      LOGO          /dev/block/mmcblk0p22  (*)
23      32768      DRIVER        /dev/block/mmcblk0p23
24      32768      reserve1      /dev/block/mmcblk0p24
25      16384      reserve2      /dev/block/mmcblk0p25
26      8192       reserve3      /dev/block/mmcblk0p26
27      65536      reserve4      /dev/block/mmcblk0p27
28      58510540   userdata      /dev/block/mmcblk0p28  (*) EXT4
29      294895     grow          /dev/block/mmcblk0p29


Donate To Me
OnePlus One | crDroid/AK | TWRP 2.7.1.1

Do not PM me asking for assistance, that's what my Q&A thread is for!
The Following 52 Users Say Thank You to timmaaa For This Useful Post: [ Click to Expand ]
 
26.2man
Old
#2  
26.2man's Avatar
Senior Member
Thanks Meter 34
Posts: 367
Join Date: Aug 2010
Location: Forest Hill MD
Nice guide!

Sent from my One using Tapatalk

Current Device OnePlus One 64GB







Old Devices
Galaxy S5
Nexus 7
Nexus 5
Nexus 4
Samsung Galaxy S2
Samsung Captivate
The Following User Says Thank You to 26.2man For This Useful Post: [ Click to Expand ]
 
nicholaschum
Old
#3  
nicholaschum's Avatar
Senior Member
Thanks Meter 1,110
Posts: 1,723
Join Date: Feb 2011
Location: Toronto, ON (Hong Kong S.A.R.)

 
DONATE TO ME
Great guide. Short and simple, just how I like it.
ROM Problem? Try this or ask me on G+!
Root/TWRP/Kernel/ROM and KNOX 0x0 on N900W8? My guide.

Primary Phone: OnePlus One - A0001
Mahdi v2.7 14/09, ak v40b08, MR-TWRP 2.8.0

Secondary Phone: Note 3 - SM-N900W8
Temasek UO v133, Temasek v3.93, TWRP 2.7.2, NA2 BL, NB7 CP, 0x0

Tablet: Nexus 7 (2012)

OnePlus One ◆ Note 3 ◆ Xperia Tab P ◆ Nexus 7 ◆ Note II LTE ◆ S III LTE ◆ One X ◆ Note I ◆ Galaxy Nexus ◆ S II LTE ◆ S II


 
ksoze11
Old
#4  
ksoze11's Avatar
Senior Member
Thanks Meter 11
Posts: 142
Join Date: Nov 2011
Quote:
Originally Posted by timmaaa View Post
The best way to insure yourself against being stuck in recovery is to keep a ROM zip or a TWRP/CWM backup (a nandroid backup) on your sd card at all times.
Can you confirm that backups made through CW recovery are fully functional? I remember that my previous phone's kernel wasn't backing up /preload while making nandroid backups...
Oneplus One
Note 10.1 (2014 edition)
The Following User Says Thank You to ksoze11 For This Useful Post: [ Click to Expand ]
 
timmaaa
Old
#5  
timmaaa's Avatar
Recognized Contributor - OP
Thanks Meter 6,213
Posts: 13,125
Join Date: Jun 2011
Location: Melbourne

 
DONATE TO ME
Quote:
Originally Posted by ksoze11 View Post
Can you confirm that backups made through CW recovery are fully functional? I remember that my previous phone's kernel wasn't backing up /preload while making nandroid backups...
I don't use CWM recovery so I can't confirm that personally. I use TWRP and can confirm that backups are fully functional with that recovery.

Transmitted via Bacon
OnePlus One | crDroid/AK | TWRP 2.7.1.1

Do not PM me asking for assistance, that's what my Q&A thread is for!
The Following User Says Thank You to timmaaa For This Useful Post: [ Click to Expand ]
 
Quinnaay
Old
#6  
Senior Member
Thanks Meter 16
Posts: 190
Join Date: Nov 2013
Ive rooted my OPO, how do i perform a nandroid backup ? when i rooted i dont know if i put a custom recovery on it.. i followed this guide https://forums.oneplus.net/threads/r...6#post-3809224
 
timmaaa
Old
#7  
timmaaa's Avatar
Recognized Contributor - OP
Thanks Meter 6,213
Posts: 13,125
Join Date: Jun 2011
Location: Melbourne

 
DONATE TO ME
Quote:
Originally Posted by Quinnaay View Post
Ive rooted my OPO, how do i perform a nandroid backup ? when i rooted i dont know if i put a custom recovery on it.. i followed this guide https://forums.oneplus.net/threads/r...6#post-3809224
You didn't install a custom recovery or unlock your bootloader if you followed that tutorial. Just unlock your bootloader, it'll wipe your data so just backup anything that's important first. Then you can flash TWRP recovery and make a nandroid backup.

Transmitted via Bacon
OnePlus One | crDroid/AK | TWRP 2.7.1.1

Do not PM me asking for assistance, that's what my Q&A thread is for!
 
Quinnaay
Old
#8  
Senior Member
Thanks Meter 16
Posts: 190
Join Date: Nov 2013
urgh, i was hoping i could keep all my data. Think ill give it a miss, it was only so i can install Xposed, but that should work anyway right?
 
timmaaa
Old
#9  
timmaaa's Avatar
Recognized Contributor - OP
Thanks Meter 6,213
Posts: 13,125
Join Date: Jun 2011
Location: Melbourne

 
DONATE TO ME
Quote:
Originally Posted by Quinnaay View Post
urgh, i was hoping i could keep all my data. Think ill give it a miss, it was only so i can install Xposed, but that should work anyway right?
If you're rooted you can just install the Xposed Framework apk and away you go. But, I'd strongly recommend you actually unlock your bootloader now, it's only gonna get harder to do the longer you wait.

Transmitted via Bacon
OnePlus One | crDroid/AK | TWRP 2.7.1.1

Do not PM me asking for assistance, that's what my Q&A thread is for!
 
timmaaa
Old
#10  
timmaaa's Avatar
Recognized Contributor - OP
Thanks Meter 6,213
Posts: 13,125
Join Date: Jun 2011
Location: Melbourne

 
DONATE TO ME
Come to think of it, there's a method around that'll unlock your bootloader without wiping any data, it's in the general section I think, have a look.

Transmitted via Bacon
OnePlus One | crDroid/AK | TWRP 2.7.1.1

Do not PM me asking for assistance, that's what my Q&A thread is for!

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes