• Introducing XDA Computing: Discussion zones for Hardware, Software, and more!    Check it out!

[GUIDE][OSPREY] Moto G3 BEGIN: Unlock bootloader, Flash: TWRP, ROM, Root, Boot logo

Search This thread

KrisM22

Senior Member
Sep 12, 2010
3,963
1,323
many ways to guide, many ways to heal
Edited Dec 22 -2017 <-- I may not always change this, but this is a work in progress!
[GUIDE][OSPREY] Moto G3 2015 - BEGIN: How to Unlock bootloader, flash TWRP, flash ROM, flash Root, Flash boot logo.

I started this because while trying to explain it to a user I kept running in to old info.

Code:
/*
 * Your warranty is now void.
 *
 * This may destroy your phone. As with any modification to a phone,
 * you must be prepared/willing to THROW IT AWAY without thinking twice.
 * If you need it or it is your daily driver, don't mess with it.
 * I am not responsible for bricked devices, dead SD cards,
 * thermonuclear war, or you getting fired because the alarm app failed. Please
 * do some research if you have any concerns about the suggestions in this guide
 * before following it! YOU are choosing to make these modifications, and if
 * you point the finger at me for messing up your device, I will laugh at you.
 */

This may well work on Merlin but I don't have one to test.

--> NOTE: I no longer use LineageOS so can't help there. Using AOSP 8. Should be no difference.

1a) Prep - before you do anything, in stock, go to settings/Development Options (which is turned on by tapping /settings/about phone/Build Number about 10 times.)
turn "OEM unlocking" ON
turn Debugging - "USB debugging" ON.

1b) Now! - To do anything, you must unlock your bootloader: This is done by going to the Motorola site and following their instructions completely.
https://motorola-global-portal.custhelp.com/app/standalone/bootloader/unlock-your-device-a
They want you to "Install the Android SDK.". You only need adb and fastboot on your PC (windows or Linux).
Try this guide to get ADB and FASTBOOT onto your computer: https://forum.xda-developers.com/showthread.php?t=2588979
For Ubuntu Linux simply type fastboot on the terminal and if it's missing a command will pop up as to how to add it - simple. same with adb.

ADDITIONAL THOUGHTS: a very helpful user suggested the following additional for unlock bootloader and getting adb and fastboot: @Dave here - see post 34ff.
Glad it was helpful! Happy to be able to give something back. Here are some links I used...

LineageOS Osprey install guide:
wiki.lineageos.org/devices/osprey/install

LineageOS Using ADB and fastboot guide:
wiki.lineageos.org/adb_fastboot_guide.html

adb & fastboot: I used this link, which was in the LineageOS ADB guide and I think also the Motorola bootloader unlocking instructions:
Mac: dl.google.com/android/repository/platform-tools-latest-darwin.zip
Windows: dl.google.com/android/repository/platform-tools-latest-windows.zip
Linux: dl.google.com/android/repository/platform-tools-latest-linux.zip

Lenovo forum: "THERE IS AN ERROR WITH YOUR REQUEST! MOTO G ROOTING PROBLEM!" (it's actually about bootloader unlocking, not rooting):
forums.lenovo.com/t5/MOTO-G-MOTO-G-...EST-MOTO-G-ROOTING-PROBLEM/m-p/3458979#M27009

European Motorola unlocking URLs:
motorola-global-en-uk.custhelp.com/app/standalone/bootloader/unlock-your-device-a
motorola-global-portal-de.custhelp.com/app/standalone/bootloader/unlock-your-device-a

2) Now that your phone is "bootloader unlocked" you will get an ugly screen on every bootup - we'll get to that in step 4.
- Now you must set up a custom recovery so you can back things up and change things. To do that you need to flash a recovery from your PC.
-> Follow squid2's guide: https://forum.xda-developers.com/2015-moto-g/orig-development/twrp-twrp-moto-g-2015-t3170537
Hint - to get into fastboot mode on your Osprey, power off, THEN, hold power and vol-down for maybe 8 seconds until the fastboot screen pops up, Then connect USB cable phone to PC.
I recommend flashing his latest.
I also recommend doing it twice in a row, simply because once in a while that is needed.

3) okay, now you can boot into TWRP: power off, hold power and vol-down for a few secs until fastboot screen pops up. use vol-down to step through the options. Choose Recovery and press power to select. 10 secs later, you're in TWRP. If you get the dead android it means you still have the stock recovery - boot to fastboot and flash TWRP again.

IMMEDIATELY tap Backup and select to put backup on external storage - your SDcard. NOTE - if your SDcard has been converted to "internal storage" you will have to choose "internal storage" (em0). I did it twice. This is your stock ROM. YOU WILL NEED THIS LATER.

-- > For TWRP BACKUP I use the default settings of "system,data, and boot". Here is a nice article that explains the differences: https://twrp.me/faq/whattobackup.html .

At this point I recommend you boot back into stock and connect your phone to your PC via USB (slide down) and copy that backup in the TWRP folder to your PC. at least once, maybe twice, for safe keeping. You will need this if you wish to test if a problem exists only on a custom ROM but not on the stock ROM. You will also need this if you simply choose to run stock, instead of a custom ROM. Remember, you are now testing ROMs - nothing is certain!

4. Getting rid of the nasty boot message:
This has some nice ones: https://forum.xda-developers.com/2015-moto-g/themes-apps/bootlogo-beautiful-logos-t3229167
Grab the one(s) you like and download - they're in .zip format. Put it on SDcard. Boot to TWRP, tap install, choose the one you want to flash. Voila.
Be aware there are some sites out there with logos that don't work on Moto G3.

5. To flash a custom ROM: Download to PC and put it on your SD card. Do same for gapps. (gapps - g-apps - google apps allow you to log in to your google account, use play store, etc. example http://opengapps.org/ (use arm, 7.1, whatever size you wish)(if you're new use full, mini, or micro until you know what you need. If you're on a 1GB phone, consider nano or pico.) )
https://download.lineageos.org/osprey or whatever ROM you want.
http://opengapps.org/ or whatever gapps you want.

Boot to TWRP.
Clean flash:
tap WIPE,
tap advanced, carefully checkmark:
Dalvic/ARTCache,
System,
Data,
Cache,

and then swipe the bottom swipe button. Takes a few sec. This is what makes a "clean flash".
Generally: Don't wipe "internal storage" or SDcard as this is where TWRP stores its backups/nandroids. - I always copy my TWRP backups to PC for safety.

Then back to menu screen and tap Install, select the rom, and swipe and let it do its thing.
Then back and tap Install, select the gapps and swipe to flash it.
THEN, and only then: tap Reboot (if you're at the main menu you also have to tap System to boot from system.)
The install takes 3 min or so before it starts asking questions.
Be sure to choose "Set up as New" or else you get whatever junk is in your google drive. This has cost errors and much time. <-----

6. Root: If you want to use bank apps, PokemonGo, etc, follow these instructions for Magisk:
https://forum.xda-developers.com/2015-moto-g/general/guide-pass-safetynet-custom-roms-t3603609
read the whole thread.

- Else go to https://download.chainfire.eu/1019
and download the zip form of Chainfire's SuperSU 2.79 and boot to TWRP and flash (install) it.

Many thanks to @acejavelin for inspiration and information(which I probably shamelessly stole from him), to @squid2 for his installation guide and his version of TWRP, to @Chainfire for the tons of work that continue to go into superSU, to @coolguy_16 for the safetynet/CTS work, and all the many Devs and helpers who make these ROMs possible, and as clean as they are! And to users like you who find bugs and file bug reports! Thank you!

Remember you are working with a Development ROM - a work in progress! (Even stock isn't perfect!!!)

Enjoy!
 
Last edited:

Subinsmani

Senior Member
Nov 18, 2016
1,709
3,534
27
Delhi, Trivandrum
I started this because while trying to explain it to a user I kept running in to old info.

As with any modification to a phone, you must be prepared/willing to throw it away without thinking twice. If you need it or it is your daily driver. don't mess with it. It is YOUR responsibility alone. If you break your phone, I will laugh.

1) To do anything, you must unlock your bootloader: This is done by going to a Motorola site and following their instructions completely.
https://motorola-global-portal.custhelp.com/app/standalone/bootloader/unlock-your-device-a

2) Now that your phone is "bootloader unlocked" you will get an ugly screen on every bootup - we'll get to that later.
- Now you must set up a custom recovery so you can back things up and change things. To do that you need to flash a recovery from your PC.
a) you need to have fastboot support on your PC
Try this guide: https://forum.xda-developers.com/showthread.php?t=2588979
You do not need to put the whole SDK on as s9ome guides would have you do.
Follow squid2's guide: https://forum.xda-developers.com/2015-moto-g/orig-development/twrp-twrp-moto-g-2015-t3170537
Hint - to get into fastboot mode, power off, THEN, hold power and vol-down for maybe 8 seconds until the fastboot screen pops up, Then connect USB cable phone to PC.
I recommend flashing his latest - twrp-osprey-3.1.0-r1.img
I also recommend doing it twice in a row, simply because once in a while that is needed.

3) okay, now you can boot into TWRP: power off, hold power and vol-down for a few secs until fastboot screen pops up. use vol-down to step through the options. Choose Recovery and press power to select. 10 secs later, you're in TWRP.
IMMEDIATELY tap Backup and select to put backup in internal (em0) storage. I did it twice. This is your stock ROM. YOU WILL NEED THIS LATER.

4. Getting rid of the nasty boot message:
This has some nice ones: https://forum.xda-developers.com/2015-moto-g/themes-apps/bootlogo-beautiful-logos-t3229167
Grab the one(s) you like and download - they're in .zip format. Put it on SDcard. Boot to TWRP, tap install, choose the one you want to flash. Voila.

5. To flash a custom ROM: Put it on your SD card. Boot to TWRP.
Clean flash: tap WIPE, tap advanced, carefully select Dalvic, Data, System, Cache, and then swip the bottom swipe thing. Takes a few sec. This is what makess a "clean flash".
Then back to menu screen and install, select the rom, and swipe and let it do its thing.
Then back and select gapps and flash it.
Then do supersu and flash that (optional)
Then "reboot".

6. Root:
nice information... hope this will help many friends.. :)

Sent from my MotoG3 using Tapatalk
 
  • Like
Reactions: KrisM22

Gravemind2015

Senior Member
Dec 1, 2015
1,847
862
A factory reset is recommended. It wipes /data, /cache, ART cache as well as any remnant files in the internal and external storages, which are missed when manually wiping these partitions.

Wiping of /system is not always needed as the updater script of a ROM automatically wipes it before copying files. It is usually needed in case of updating ROMs where some persistent mods are needed to be removed such as gapps.

More on this here at TWRP FAQ.

Broadcasted from Zeta Reticuli
 
  • Like
Reactions: KrisM22

KrisM22

Senior Member
Sep 12, 2010
3,963
1,323
many ways to guide, many ways to heal
A factory reset is recommended. It wipes /data, /cache, ART cache as well as any remnant files in the internal and external storages, which are missed when manually wiping these partitions.

Wiping of /system is not always needed as the updater script of a ROM automatically wipes it before copying files. It is usually needed in case of updating ROMs where some persistent mods are needed to be removed such as gapps.

More on this here at TWRP FAQ.

Broadcasted from Zeta Reticuli

I thought this was true but found my gapps was remaining residual in system - had to clear system to get rid of gapps.
 

Gravemind2015

Senior Member
Dec 1, 2015
1,847
862
I thought this was true but found my gapps was remaining residual in system - had to clear system to get rid of gapps.
Yes you are correct, gapps won't get removed for new builds of the same ROM due to a persistent ROM script. However flashing a ROM different than the one currently installed usually ignores such scripts and does a clean wipe. Doing a manual wipe just to be sure is fine, even needed sometimes.

I just wanted to point out that not performing a factory reset (twrp>wipe>swipe to factory reset) can leave potential conflicting files in aforementioned places which can cause unexpected behaviours ranging from FCs to bootloop. The potential issues are rare but I think you know how much trouble it can bring to folks trying to capture real bugs (thanks for hard work at Linage :p); it was all about removing the potential factors :D.

Broadcasted from Zeta Reticuli
 
  • Like
Reactions: KrisM22

KrisM22

Senior Member
Sep 12, 2010
3,963
1,323
many ways to guide, many ways to heal
The TWRP wipe-swipe does Data, Cache, and Dalvic. That's what I used to do. After messing up some tests this past week and wasting a lot of time, I now recommend adding system to that:
In advanced, checking data, cache, and dalvic/ARTcache, and, now, system. as far as i can see, I am leaving nothing other than internal storage and sd card (and of course whatever is in OTG if there's one attached). TBPro puts its backups on "internal storage". By the way I do appreciate your taking the time to look so closely at this!
 
  • Like
Reactions: Gravemind2015

xMotoDA

Senior Member
May 16, 2016
134
20
[GUIDE]
6. Root: Go to http://www.theandroidsoul.com/supersu-2-79-zip-apk-download/
and download the zip form of Chainfire's SuperSU 2.79 . Use it in step5 above.

NOTES: this has nothing to do with rooting your stock ROM which afaik can't be done.

To root stock ROM with SuperSU, you need to open a terminal in TWRP and type
Code:
echo "SYSTEMLESS=true" > /data/.supersu
This forces a systemless installation.

Edit: Not necessary anymore, just flash SuperSU zip and you're done

MagiskSU is an alternative to SuperSU and similar apps that hides root (to SafetyNet), so it's better to use that with stock ROM. It is also pre-installed on some ROMs like AICP.

If you're using LineageOS, it's best to use the official root package: https://download.lineageos.org/extras (direct link).
 
Last edited:

KrisM22

Senior Member
Sep 12, 2010
3,963
1,323
many ways to guide, many ways to heal
To root stock ROM with SuperSU, you need to open a terminal in TWRP and type
Code:
echo "SYSTEMLESS=true" > /data/.supersu
This forces a systemless installation.

MagiskSU is an alternative to SuperSU and similar apps that hides root (to SafetyNet), so it's better to use that with stock ROM. It is also pre-installed on some ROMs like AICP.

If you're using LineageOS, it's best to use the official root package: https://download.lineageos.org/extras (direct link).

a) I have seen that but not tried it. I did add a note so you're now the authority!

b) not since SuperSU 2.79 - Those were invented because earlier SuperSUs had probs. I've been flashing 2.79 for a while now with no problems on Lineage.

Thanks for looking in!
 
Last edited:

acejavelin

Recognized Contributor
Sep 3, 2009
6,837
3,325
Lincoln, ND
Google Pixel 5a
a) I have seen that but not tried it. I did add a note so you're now the authority!

b) not after SuperSU 2.78 (or 2.70 or something) - Those were invented because earlier SuperSUs had probs. I've been flashing 2.79 for a while now with no problems on Lineage.

Thanks for looking in!
SuperSU 2.79 "General Release" was the version of the change, anything prior needed the forced systemless command, all 2.79 or later versions include the correct check to flash on most Moto devices without the command. Using the echo command to create the file has no detrimental effects on later versions though. Note that using https://download.chainfire.eu/supersu/ as your download link will always get you the most current stable version of SuperSU available directly from the official source.

Magisk is the way to go to root most stock devices though, I would definitely agree with that.
 

KrisM22

Senior Member
Sep 12, 2010
3,963
1,323
many ways to guide, many ways to heal
SuperSU 2.79 "General Release" was the version of the change, anything prior needed the forced systemless command, all 2.79 or later versions include the correct check to flash on most Moto devices without the command. Using the echo command to create the file has no detrimental effects on later versions though. Note that using https://download.chainfire.eu/supersu/ as your download link will always get you the most current stable version of SuperSU available directly from the official source.

Magisk is the way to go to root most stock devices though, I would definitely agree with that.

Huge thanks for that!!! Changed above post.

Never played with Magisk - others (you!) are the authority on that. I think some were saying that was a way to get a custom rom to pass safteynet... Thanks!

Huge thanks for looking in!!!
 

KrisM22

Senior Member
Sep 12, 2010
3,963
1,323
many ways to guide, many ways to heal
Last edited:

Top Liked Posts

  • There are no posts matching your filters.
  • 13
    Edited Dec 22 -2017 <-- I may not always change this, but this is a work in progress!
    [GUIDE][OSPREY] Moto G3 2015 - BEGIN: How to Unlock bootloader, flash TWRP, flash ROM, flash Root, Flash boot logo.

    I started this because while trying to explain it to a user I kept running in to old info.

    Code:
    /*
     * Your warranty is now void.
     *
     * This may destroy your phone. As with any modification to a phone,
     * you must be prepared/willing to THROW IT AWAY without thinking twice.
     * If you need it or it is your daily driver, don't mess with it.
     * I am not responsible for bricked devices, dead SD cards,
     * thermonuclear war, or you getting fired because the alarm app failed. Please
     * do some research if you have any concerns about the suggestions in this guide
     * before following it! YOU are choosing to make these modifications, and if
     * you point the finger at me for messing up your device, I will laugh at you.
     */

    This may well work on Merlin but I don't have one to test.

    --> NOTE: I no longer use LineageOS so can't help there. Using AOSP 8. Should be no difference.

    1a) Prep - before you do anything, in stock, go to settings/Development Options (which is turned on by tapping /settings/about phone/Build Number about 10 times.)
    turn "OEM unlocking" ON
    turn Debugging - "USB debugging" ON.

    1b) Now! - To do anything, you must unlock your bootloader: This is done by going to the Motorola site and following their instructions completely.
    https://motorola-global-portal.custhelp.com/app/standalone/bootloader/unlock-your-device-a
    They want you to "Install the Android SDK.". You only need adb and fastboot on your PC (windows or Linux).
    Try this guide to get ADB and FASTBOOT onto your computer: https://forum.xda-developers.com/showthread.php?t=2588979
    For Ubuntu Linux simply type fastboot on the terminal and if it's missing a command will pop up as to how to add it - simple. same with adb.

    ADDITIONAL THOUGHTS: a very helpful user suggested the following additional for unlock bootloader and getting adb and fastboot: @Dave here - see post 34ff.
    Glad it was helpful! Happy to be able to give something back. Here are some links I used...

    LineageOS Osprey install guide:
    wiki.lineageos.org/devices/osprey/install

    LineageOS Using ADB and fastboot guide:
    wiki.lineageos.org/adb_fastboot_guide.html

    adb & fastboot: I used this link, which was in the LineageOS ADB guide and I think also the Motorola bootloader unlocking instructions:
    Mac: dl.google.com/android/repository/platform-tools-latest-darwin.zip
    Windows: dl.google.com/android/repository/platform-tools-latest-windows.zip
    Linux: dl.google.com/android/repository/platform-tools-latest-linux.zip

    Lenovo forum: "THERE IS AN ERROR WITH YOUR REQUEST! MOTO G ROOTING PROBLEM!" (it's actually about bootloader unlocking, not rooting):
    forums.lenovo.com/t5/MOTO-G-MOTO-G-...EST-MOTO-G-ROOTING-PROBLEM/m-p/3458979#M27009

    European Motorola unlocking URLs:
    motorola-global-en-uk.custhelp.com/app/standalone/bootloader/unlock-your-device-a
    motorola-global-portal-de.custhelp.com/app/standalone/bootloader/unlock-your-device-a

    2) Now that your phone is "bootloader unlocked" you will get an ugly screen on every bootup - we'll get to that in step 4.
    - Now you must set up a custom recovery so you can back things up and change things. To do that you need to flash a recovery from your PC.
    -> Follow squid2's guide: https://forum.xda-developers.com/2015-moto-g/orig-development/twrp-twrp-moto-g-2015-t3170537
    Hint - to get into fastboot mode on your Osprey, power off, THEN, hold power and vol-down for maybe 8 seconds until the fastboot screen pops up, Then connect USB cable phone to PC.
    I recommend flashing his latest.
    I also recommend doing it twice in a row, simply because once in a while that is needed.

    3) okay, now you can boot into TWRP: power off, hold power and vol-down for a few secs until fastboot screen pops up. use vol-down to step through the options. Choose Recovery and press power to select. 10 secs later, you're in TWRP. If you get the dead android it means you still have the stock recovery - boot to fastboot and flash TWRP again.

    IMMEDIATELY tap Backup and select to put backup on external storage - your SDcard. NOTE - if your SDcard has been converted to "internal storage" you will have to choose "internal storage" (em0). I did it twice. This is your stock ROM. YOU WILL NEED THIS LATER.

    -- > For TWRP BACKUP I use the default settings of "system,data, and boot". Here is a nice article that explains the differences: https://twrp.me/faq/whattobackup.html .

    At this point I recommend you boot back into stock and connect your phone to your PC via USB (slide down) and copy that backup in the TWRP folder to your PC. at least once, maybe twice, for safe keeping. You will need this if you wish to test if a problem exists only on a custom ROM but not on the stock ROM. You will also need this if you simply choose to run stock, instead of a custom ROM. Remember, you are now testing ROMs - nothing is certain!

    4. Getting rid of the nasty boot message:
    This has some nice ones: https://forum.xda-developers.com/2015-moto-g/themes-apps/bootlogo-beautiful-logos-t3229167
    Grab the one(s) you like and download - they're in .zip format. Put it on SDcard. Boot to TWRP, tap install, choose the one you want to flash. Voila.
    Be aware there are some sites out there with logos that don't work on Moto G3.

    5. To flash a custom ROM: Download to PC and put it on your SD card. Do same for gapps. (gapps - g-apps - google apps allow you to log in to your google account, use play store, etc. example http://opengapps.org/ (use arm, 7.1, whatever size you wish)(if you're new use full, mini, or micro until you know what you need. If you're on a 1GB phone, consider nano or pico.) )
    https://download.lineageos.org/osprey or whatever ROM you want.
    http://opengapps.org/ or whatever gapps you want.

    Boot to TWRP.
    Clean flash:
    tap WIPE,
    tap advanced, carefully checkmark:
    Dalvic/ARTCache,
    System,
    Data,
    Cache,

    and then swipe the bottom swipe button. Takes a few sec. This is what makes a "clean flash".
    Generally: Don't wipe "internal storage" or SDcard as this is where TWRP stores its backups/nandroids. - I always copy my TWRP backups to PC for safety.

    Then back to menu screen and tap Install, select the rom, and swipe and let it do its thing.
    Then back and tap Install, select the gapps and swipe to flash it.
    THEN, and only then: tap Reboot (if you're at the main menu you also have to tap System to boot from system.)
    The install takes 3 min or so before it starts asking questions.
    Be sure to choose "Set up as New" or else you get whatever junk is in your google drive. This has cost errors and much time. <-----

    6. Root: If you want to use bank apps, PokemonGo, etc, follow these instructions for Magisk:
    https://forum.xda-developers.com/2015-moto-g/general/guide-pass-safetynet-custom-roms-t3603609
    read the whole thread.

    - Else go to https://download.chainfire.eu/1019
    and download the zip form of Chainfire's SuperSU 2.79 and boot to TWRP and flash (install) it.

    Many thanks to @acejavelin for inspiration and information(which I probably shamelessly stole from him), to @squid2 for his installation guide and his version of TWRP, to @Chainfire for the tons of work that continue to go into superSU, to @coolguy_16 for the safetynet/CTS work, and all the many Devs and helpers who make these ROMs possible, and as clean as they are! And to users like you who find bugs and file bug reports! Thank you!

    Remember you are working with a Development ROM - a work in progress! (Even stock isn't perfect!!!)

    Enjoy!
    2
    Thanks guys, I will report back

    ---------- Post added at 01:34 PM ---------- Previous post was at 01:10 PM ----------

    Flash TWRP then immediately start it, allow writes to system, go to reboots menu, select Recovery... TWRP shouldn't ask you for write permission. Then it will stick.

    That's it!, instead of reboot the phone after flashing the recovery, I enter right away :silly:

    Thanks yall
    2
    Help

    Hi i flash it the official twrp 3 times nothing and then the squid and nothing, i am missing some thing here?

    PS: of course i have the bootloader unlocked

    "bootloader unlocked code:3 something something"
    Flash TWRP then immediately start it, allow writes to system, go to reboots menu, select Recovery... TWRP shouldn't ask you for write permission. Then it will stick.
    2
    minor changes.
    2
    a) I have seen that but not tried it. I did add a note so you're now the authority!

    b) not after SuperSU 2.78 (or 2.70 or something) - Those were invented because earlier SuperSUs had probs. I've been flashing 2.79 for a while now with no problems on Lineage.

    Thanks for looking in!
    SuperSU 2.79 "General Release" was the version of the change, anything prior needed the forced systemless command, all 2.79 or later versions include the correct check to flash on most Moto devices without the command. Using the echo command to create the file has no detrimental effects on later versions though. Note that using https://download.chainfire.eu/supersu/ as your download link will always get you the most current stable version of SuperSU available directly from the official source.

    Magisk is the way to go to root most stock devices though, I would definitely agree with that.