[Q] Flash ROM via adb - Moto G Q&A, Help & Troubleshooting

Hi, I've never used adb before since I flashed all my ROMs via custom recovery. But now, as I moved to an 8GB Moto G, my memory is always full so I was wondering if there's a chance to flash roms this way so I don't need to make room on the internal memory for this. Thanks.

I use fastboot to flash ROMs.
Put the room in the same directory as fastboot
Boot your phone into bootloader. You can use [adb reboot bootloader]
Make sure the device it's connected by typing [fastboot devices]
To flash a ROM type [fastboot flash <name of file> <name of file>.zip
Make sure to have the .zip at the end.
Sent from my XT1032 using Tapatalk

And wipe cache/data and make backups? Can that be done as well? (if you know an adb tutorial with all commands just tell me, it will be easier xD)

I don't remember all the commands myself sorry. A quick Google search for fastboot commands should have everything you need
Sent from my XT1032 using Tapatalk

Related

[Q] Stock Recovery?

Hey all.
I'm trying to root my Moto G and the Superboot option doesn't work, so I'm trying to flash by recovery. However, I want to restore my original stock recovery afterwards. Does anyone have a link to the stock recovery so I can flash it through ADB after rooting?
Thanks!
http://forum.xda-developers.com/showthread.php?t=2578243
Or you can try second time with superboot by Modaco.
1. Download Minimal ADB and Fastboot here https://docs.google.com/file/d/0B1S0LCuXCnnmSWh6NGJmSE1BUWc/edit?usp=sharing
2. Install it.
3. Extract boot.superboot.img from superboot.zip available from Paul's thread at Modaco - http://www.modaco.com/topic/366771-root-your-moto-g-option-1-superboot/ where you installed Minimal ADB and Fastboot.
4. Start Minimal ADB and Fastboot
5.
Code:
adb reboot-bootloader
fastboot boot boot.superboot.img

how to flash stock recovery

hi there. I want to know how to flash stock recovery. im on xt1032, stock ROM 4.4.2 unrooted (I flashed the backup I made before I rooted).I want to go to 4.4.3. now I want to know how to flash stock recovery. through moto tool ? or through adb (please post on what command I should do to flash recovery and where should I open the cmd and where to put file if u say adb) [emoji4]
Sent from my XT1032 using Tapatalk
bublz654 said:
hi there. I want to know how to flash stock recovery. im on xt1032, stock ROM 4.4.2 unrooted (I flashed the backup I made before I rooted).I want to go to 4.4.3. now I want to know how to flash stock recovery. through moto tool ? or through adb (please post on what command I should do to flash recovery and where should I open the cmd and where to put file if u say adb) [emoji4]
Sent from my XT1032 using Tapatalk
Click to expand...
Click to collapse
Okay first of all download your firmware from sbf motorola and extract the zip file to the same location as your adb/fastboot folder. In the folder where your recovery.img and your fastboot is "Hold Shift and Right Click and choose open command window here" Make sure you got USB Debugging on and type in the following command adb reboot bootloader when it reboots into bootloader then you will type fastboot flash recovery recovery.img
serophia said:
Okay first of all download your firmware from sbf motorola and extract the zip file to the same location as your adb/fastboot folder. In the folder where your recovery.img and your fastboot is "Hold Shift and Right Click and choose open command window here" Make sure you got USB Debugging on and type in the following command adb reboot bootloader when it reboots into bootloader then you will type fastboot flash recovery recovery.img
Click to expand...
Click to collapse
yeah I have my official firmware downloaded n extracted. is the place where adb/fastboot folder in sdk --> platform tools?
Sent from my XT1032 using Tapatalk
anyway. I'm on 4.4.3 now. in rooted as well. thank you very much
Sent from my XT1032 using Tapatalk

Bricked Moto G - Need help urgently!

So, I am in the middle of trying to fix my Moto G that is bricked/bootloop.
What happened is that I "accidentally" factory reset my phone using Philz Touch Recovery, after I did that, my phone wouldn't boot. After doing some research on the interwebs I found that since Philz is based of CWM it also deleted the /os folder, so I had to install a custom ROM to fix it. I did install 2 different ROM's twice each (CM11 and Carbon) and still am stuck in a boot loop. (I wiped cache and data .etc before I installed) I have no idea what to do, please help me!
TL;DR: Moto G stuck in Bootloop/bricked
Megadarkwood said:
So, I am in the middle of trying to fix my Moto G that is bricked/bootloop.
What happened is that I "accidentally" factory reset my phone using Philz Touch Recovery, after I did that, my phone wouldn't boot. After doing some research on the interwebs I found that since Philz is based of CWM it also deleted the /os folder, so I had to install a custom ROM to fix it. I did install 2 different ROM's twice each (CM11 and Carbon) and still am stuck in a boot loop. (I wiped cache and data .etc before I installed) I have no idea what to do, please help me!
TL;DR: Moto G stuck in Bootloop/bricked
Click to expand...
Click to collapse
First things first..there are many Moto G models..which model do you have.?
And what version OS is your device on.?
sent by my 4.2.2_12.15.15
(Unlocked) XT1080M Droid Maxx #1
http://waynekent.com/page6.html
NWKENT said:
First things first..there are many Moto G models..which model do you have.?
And what version OS is your device on.?
sent by my 4.2.2_12.15.15
(Unlocked) XT1080M Droid Maxx #1
Click to expand...
Click to collapse
It's on 4.4.2 and I don't know the model number but its the Canadian Rogers Version
Megadarkwood said:
It's on 4.4.2 and I don't know the model number but its the Canadian Rogers Version
Click to expand...
Click to collapse
Try to flash your recovery again, IF you cannot get back into recovery..which ever one you are using, flash again and go into the recovery in order to erase cache/dalvik..if you do erase cache/dalvik and still in a bootloop, then most likely you'll need to flash a new/undefiled OS..
There is a chance that a flash of OS could be done without loosing all your data, but a custom FXZ would be needed..
Go down this list and find your device OS..and download..and flash the new/fresh OS..this list is factory FXZ's which will erase your data..
I personally prefer TWRP recoveries..
Here >> http://sbf.droid-developers.org/phone.php?device=14
Sent from my 4.4_19.6.3
(Unlocked) XT1080M Droid Maxx #2
http://waynekent.com/page6.html
NWKENT said:
Try to flash your recovery again, IF you cannot get back into recovery..which ever one you are using, flash again and go into the recovery in order to erase cache/dalvik..if you do erase cache/dalvik and still in a bootloop, then most likely you'll need to flash a new/undefiled OS..
There is a chance that a flash of OS could be done without loosing all your data, but a custom FXZ would be needed..
Go down this list and find your device OS..and download..and flash the new/fresh OS..this list is factory FXZ's which will erase your data..
I personally prefer TWRP recoveries..
Here >>
Sent from my 4.4_19.6.3
(Unlocked) XT1080M Droid Maxx #2
Click to expand...
Click to collapse
Alright, so since I am a noob let me get this right..
Wipe dalvik cache, done. Still in bootloop.
Now I should flash a new recovery? I am still able to get into my current one.
Sorry for my noob-ness.
Megadarkwood said:
Alright, so since I am a noob let me get this right..
Wipe dalvik cache, done. Still in bootloop.
Now I should flash a new recovery? I am still able to get into my current one.
Sorry for my noob-ness.
Click to expand...
Click to collapse
OK..if you erased cache..then that's all you can do with that..
Reflash your recovery..make sure you have a known good recovery for your particular device..if reflash recovery and still a bootloop..then flashing a clean/fresh OS is the only thing that is left..of course you certainly deserve a second opinion..
If you are concerned about loosing all your data..then there is a way to flash a new/clean OS without erase your data..BUT..it takes a special modified FXZ to do so, and get your device back up..
Sent from my 4.4_19.6.3
(Unlocked) XT1080M Droid Maxx #2
http://waynekent.com/page6.html
NWKENT said:
OK..if you erased cache..then that's all you can do with that..
Reflash your recovery..make sure you have a known good recovery for your particular device..if reflash recovery and still a bootloop..then flashing a clean/fresh OS is the only thing that is left..of course you certainly deserve a second opinion..
If you are concerned about loosing all your data..then there is a way to flash a new/clean OS without erase your data..BUT..it takes a special modified FXZ to do so, and get your device back up..
Sent from my 4.4_19.6.3
(Unlocked) XT1080M Droid Maxx #
Click to expand...
Click to collapse
I am not concerned about any data, just need to get it working. I will flash TWRP as soon as I get back to my computer
Bro, try flashing TWRP, it's easier (my opinion) to use... Do you have the .zip of CM11? If yes, make a Factory Reset and install CM11. If it still in a bootloop, instal the stock firmware.
Sent from my Moto G using XDA Premium 4 mobile app
NWKENT said:
OK..if you erased cache..then that's all you can do with that..
Reflash your recovery..make sure you have a known good recovery for your particular device..if reflash recovery and still a bootloop..then flashing a clean/fresh OS is the only thing that is left..of course you certainly deserve a second opinion..
If you are concerned about loosing all your data..then there is a way to flash a new/clean OS without erase your data..BUT..it takes a special modified FXZ to do so, and get your device back up..
Sent from my 4.4_19.6.3
(Unlocked) XT1080M Droid Maxx #2
Click to expand...
Click to collapse
nArdow said:
Bro, try flashing TWRP, it's easier (my opinion) to use... Do you have the .zip of CM11? If yes, make a Factory Reset and install CM11. If it still in a bootloop, instal the stock firmware.
Sent from my Moto G using XDA Premium 4 mobile app
Click to expand...
Click to collapse
Alright, how am I supposed to sideload the .img for TWRP?
Just download TWRP and flash using your current recovery.. Also you could try going into advance in TWRP and clicking fix permissions..
If you cannot flash a new Recovery using the recovery already on the device.. Flash with adb.
Download a new recovery using a PC.
Place the .IMG into your fastboot folder.
Rename the recovery 'recovery.img' without quotes.
Boot into bootloader.
On your PC hold shift and right click the folder your fastboot is in and select to start your cmd directory their.
A command window should open and type...
"Fastboot flash recovery recovery.img"
Sent from my XT1032 using Tapatalk
Clarkiieh said:
Just download TWRP and flash using your current recovery.. Also you could try going into advance in TWRP and clicking fix permissions..
If you cannot flash a new Recovery using the recovery already on the device.. Flash with adb.
Download a new recovery using a PC.
Place the .IMG into your fastboot folder.
Rename the recovery 'recovery.img' without quotes.
Boot into bootloader.
On your PC hold shift and right click the folder your fastboot is in and select to start your cmd directory their.
A command window should open and type...
"Fastboot flash recovery recovery.img"
Sent from my XT1032 using Tapatalk
Click to expand...
Click to collapse
Won't work, says "Waiting for Device"
Megadarkwood said:
Won't work, says "Waiting for Device"
Click to expand...
Click to collapse
I will try and make this simple as possible, this process will get your device back to stock if you are able to get into fastboot mode.
- Step 1: Put device into fastboot mode.
- Step 1a: Run ADB and check for devices.
Code:
adb devices
- Step 1b: If ADB cannot see the device unplug the USB and plug it back in.
- Step 1c: Run ADB and check for devices again, if device is detected in ADB move to step 3, if not continue on to step 2.
Code:
adb devices
- Step 2: If ADB does not detect the device unplug the USB
- Step 2a: Restart the device in fastboot mode
- Step 2b: Plug USB back in
- Step 2c: Run ADB and check for devices, if device is detected in ADB move to step 3.
Code:
adb devices
- Step 3: Start the flashing process with ADB using your systems firmware.
Code:
fastboot flash partition gpt.bin
fastboot flash motoboot motoboot.img
fastboot flash logo logo.bin
fastboot flash boot boot.img
fastboot flash recovery recovery.img
fastboot flash system system.img_sparsechunk1
fastboot flash system system.img_sparsechunk2
fastboot flash system system.img_sparsechunk3
fastboot flash modem NON-HLOS.bin
fastboot erase modemst1
fastboot erase modemst2
fastboot flash fsg fsg.mbn
fastboot erase cache
fastboot erase userdata
fastboot reboot
- or run the bat file for your firmware.
- Step 3a: If you get errors or hang ups at anytime during the flashing process after recovery.img make more than 1 attempt to run the command in ADB. I have the XT1034 and my sparsechunk2 and 3 along with erase cache and erase userdata likes to hang up and then fail but I am still able to fully restore my Moto G. I hope this helps.
The Closet Candian said:
I will try and make this simple as possible, this process will get your device back to stock if you are able to get into fastboot mode.
- Step 1: Put device into fastboot mode.
- Step 1a: Run ADB and check for devices.
Code:
adb devices
- Step 1b: If ADB cannot see the device unplug the USB and plug it back in.
- Step 1c: Run ADB and check for devices again, if device is detected in ADB move to step 3, if not continue on to step 2.
Code:
adb devices
- Step 2: If ADB does not detect the device unplug the USB
- Step 2a: Restart the device in fastboot mode
- Step 2b: Plug USB back in
- Step 2c: Run ADB and check for devices, if device is detected in ADB move to step 3.
Code:
adb devices
- Step 3: Start the flashing process with ADB using your systems firmware.
Code:
fastboot flash partition gpt.bin
fastboot flash motoboot motoboot.img
fastboot flash logo logo.bin
fastboot flash boot boot.img
fastboot flash recovery recovery.img
fastboot flash system system.img_sparsechunk1
fastboot flash system system.img_sparsechunk2
fastboot flash system system.img_sparsechunk3
fastboot flash modem NON-HLOS.bin
fastboot erase modemst1
fastboot erase modemst2
fastboot flash fsg fsg.mbn
fastboot erase cache
fastboot erase userdata
fastboot reboot
- or run the bat file for your firmware.
- Step 3a: If you get errors or hang ups at anytime during the flashing process after recovery.img make more than 1 attempt to run the command in ADB. I have the XT1034 and my sparsechunk2 and 3 along with erase cache and erase userdata likes to hang up and then fail but I am still able to fully restore my Moto G. I hope this helps.
Click to expand...
Click to collapse
Alright, but do I need a OS file or something in the folder before I do this?
Also, it reconizes the device with "adb devices" but it still says "Waiting for device"
Megadarkwood said:
Also, it reconizes the device with "adb devices" but it still says "Waiting for device"
Click to expand...
Click to collapse
Since you are in fastboot mode you should use "fastboot devices".
meekrawb said:
Since you are in fastboot mode you should use "fastboot devices".
Click to expand...
Click to collapse
It just doesn't work
screenshot: http://gyazo.com/f863d5e9bff06e49d375f62901a38520
Megadarkwood said:
It just doesn't work
screenshot: http://gyazo.com/f863d5e9bff06e49d375f62901a38520
Click to expand...
Click to collapse
Only thing I can think of is to re-install the drivers or try different USB ports.
Megadarkwood said:
It just doesn't work
screenshot: http://gyazo.com/f863d5e9bff06e49d375f62901a38520
Click to expand...
Click to collapse
First of all run the adb setup file and press (Y) all 3 times.
Next unzip the twrp.zip folder. Then flash the twrp recovery by using the "fastboot flash recovery twrp.img" command. Make sure phone is in fastboot mode.
Next boot the phone into the recovery and select advanced. Then click on terminal command and navigate to the /sdcard/ folder. Lastly click "select" on the bottom right corner.
Now download whatever rom and gapps you would like to install on your phone and rename them to something short. Then open a command prompt at the directory where the rom and gapps are. In the command prompt enter these commands "adb push NAMEOFROM.zip /sdcard/" and "adb push NAMEOFGAPPS.zip /sdcard/".
The command prompt will not show change for a few minutes. After you notice the command prompt is ready for the next command it is okay to exit it.
Now just flash the rom and gapps normally and hopefully your phone will be okay.
**BTW the adb setup program makes adb and fastboot accessible from any directory even without the actual adb and fastboot files.
eg0097 said:
First of all run the adb setup file and press (Y) all 3 times.
Next unzip the twrp.zip folder. Then flash the twrp recovery by using the "fastboot flash recovery twrp.img" command. Make sure phone is in fastboot mode.
Next boot the phone into the recovery and select advanced. Then click on terminal command and navigate to the /sdcard/ folder. Lastly click "select" on the bottom right corner.
Now download whatever rom and gapps you would like to install on your phone and rename them to something short. Then open a command prompt at the directory where the rom and gapps are. In the command prompt enter these commands "adb push NAMEOFROM.zip /sdcard/" and "adb push NAMEOFGAPPS.zip /sdcard/".
The command prompt will not show change for a few minutes. After you notice the command prompt is ready for the next command it is okay to exit it.
Now just flash the rom and gapps normally and hopefully your phone will be okay.
**BTW the adb setup program makes adb and fastboot accessible from any directory even without the actual adb and fastboot files.
Click to expand...
Click to collapse
Got TWRP on and everything flashed but carbon is still in a boot loop.
Honestly dude I just bricked my phone converting to gpe and I somehow got out of it... Sometimes it can be a load of factors... Drivers is the biggie!! Delete your old ones reboot computer and reinstall..
Sent from my XT1032 using Tapatalk
---------- Post added at 10:39 PM ---------- Previous post was at 10:30 PM ----------
OK if you hear a beep when connecting your phone while it's in fastboot its not your drivers as such
.. If not tell me cause you will need to activate them!
Sent from my XT1032 using Tapatalk
Clarkiieh said:
Honestly dude I just bricked my phone converting to gpe and I somehow got out of it... Sometimes it can be a load of factors... Drivers is the biggie!! Delete your old ones reboot computer and reinstall..
Sent from my XT1032 using Tapatalk
---------- Post added at 10:39 PM ---------- Previous post was at 10:30 PM ----------
OK if you hear a beep when connecting your phone while it's in fastboot its not your drivers as such
.. If not tell me cause you will need to activate them!
Sent from my XT1032 using Tapatalk
Click to expand...
Click to collapse
Yeah I hear the beep.

Accidentally delete everything using TWRP in "wipe"

Hey,
first of all i KNOW there is a subject with nearly the exact same topic, and i followed the directions but somethng doesn't work.
I still have TWRP on the phone, and when im in bootloader mode and run "fastboot devices" i see the result.
but i can't seem to ADB push or anything else (maybe im missing some commands?)
so i used the NRT root kit and i use the "fastboot flash" function and install the .img file - the software says my device is identified and it installs the system.img file (found on the "image-hammerhead-mra58k" zip), but then the device boots to TWRP and still can't boot to the system itself.
help please!
Sideload a factory rom and u will be fine. U can do it in the advanced portion of TWRP, but u need a pc, or ur hit
Sent from my Nexus 6 using Tapatalk
Sounds to me like you're using adb commands in fastboot.
Boot into bootloader (not recovery)
Type fastboot devices
It should return showing your device
Then you need to make sure you have stock img's downloaded and completely extracted so you have all the img files in the folder you're running fastboot from (rename the radio to simply radio.img)
Then type
fastboot flash boot boot.img
fastboot flash system system.img
fastboot flash radio radio.img
Then boot back into recovery and wipe cache and dvalik for just in case fun
Then reboot system and wait
Sent from my Xperia z5 by Tapatalk
Thank you very very much guys!
that worked! WOOHOO!!
Good good!
Sent from my Xperia z5 by Tapatalk

Can't install any custom ROM'S

Hi All.
I have stuck in weird issue in my pixel 3. Can't able to install any custom rom
Process I hav gone through..
Flash the stock rom Android 10/11 using flash all.bat (downloaded from Google website)
Then install the custom ROM'S boot image and install rom using adb sideload.
There is no error after adb sideload. Showing success.
After reboot, it normally boot into stock os.
Please help me to fix the same. Thanks in advance.
logeshwywan said:
Hi All.
I have stuck in weird issue in my pixel 3. Can't able to install any custom rom
Process I hav gone through..
Flash the stock rom Android 10/11 using flash all.bat (downloaded from Google website)
Then install the custom ROM'S boot image and install rom using adb sideload.
There is no error after adb sideload. Showing success.
After reboot, it normally boot into stock os.
Please help me to fix the same. Thanks in advance.
Click to expand...
Click to collapse
I recently had similar issues (maybe same) doing Lineage. For me the key was to switch to using a usb 2.0 port. Lineage mentions doing this in their directions. I'm familiar with apps like qfil needing it also. Sure enough, all worked as expected with a 2.0 usb port.
cheers
Did you flash stock to both slots? Here's how I flash a custom ROM, starting with a clean flash of stock image:
Once in fastboot:
fastboot --slot=all flash bootloader stock-bootloader.img(or drag and drop to cmd window)
fastboot reboot bootloader
fastboot --slot=all flash radio stock-radio.img(or drag and drop to cmd window)
fastboot reboot bootloader
fastboot --slot=(current slot) --skip-reboot update stock-image.zip(or drag and drop to cmd window)
fastboot reboot bootloader
fastboot --slot=(other slot) --skip-reboot update stock-image.zip(or drag and drop to cmd window)
Then you enter recovery and wipe/format data and reboot to system after.
From here, you enable USB debugging and reboot back into fastboot and follow the flashing instructions for your preferred ROM.
AlexKarimov said:
Did you flash stock to both slots? Here's how I flash a custom ROM, starting with a clean flash of stock image:
Once in fastboot:
fastboot --slot=all flash bootloader stock-bootloader.img(or drag and drop to cmd window)
fastboot reboot bootloader
fastboot --slot=all flash radio stock-radio.img(or drag and drop to cmd window)
fastboot reboot bootloader
fastboot --slot=(current slot) --skip-reboot update stock-image.zip(or drag and drop to cmd window)
fastboot reboot bootloader
fastboot --slot=(other slot) --skip-reboot update stock-image.zip(or drag and drop to cmd window)
Then you enter recovery and wipe/format data and reboot to system after.
From here, you enable USB debugging and reboot back into fastboot and follow the flashing instructions for your preferred ROM.
Click to expand...
Click to collapse
Thanks for your inputs, will try with your steps.. I have one doubt on this..As per Google's statement "Execute the flash-all script. This script installs the necessary bootloader, baseband firmware(s), and operating system." - Flash-all script won't flash on both slots? please clarify! Because I did stock rom flash in that way only..
AsItLies said:
I recently had similar issues (maybe same) doing Lineage. For me the key was to switch to using a usb 2.0 port. Lineage mentions doing this in their directions. I'm familiar with apps like qfil needing it also. Sure enough, all worked as expected with a 2.0 usb port.
cheers
Click to expand...
Click to collapse
Wholla! It's working fine with 2.0 USB Ports. Many thanks for your suggestions.
Tried with 2 custom roms, perfectly great with first attempts..!
logeshwywan said:
Thanks for your inputs, will try with your steps.. I have one doubt on this..As per Google's statement "Execute the flash-all script. This script installs the necessary bootloader, baseband firmware(s), and operating system." - Flash-all script won't flash on both slots? please clarify! Because I did stock rom flash in that way only..
Click to expand...
Click to collapse
I don't use the flash-all script, I use ADB and fastboot. Someone in the Dirty Unicorns thread had the same issue and edited the flash-all.bat and left instructions but he still had to use ADB and fastboot in the end to set the active slot and run flash-all again.
From the DU thread:
And could you please explain how we flash it to both slots?
Edit; got it working now
- Removed the -w in flash-all (not sure if it was necesarry)
- Runned flash-all while on b
- Then fastboot --set-active a
- Runned flash-all while on a
Then followed the instructions, and it worked.
So, for those that may not realize, we should clarify why we may want to flash to both slots;
A custom rom isn't 'complete' by itself. It uses the 'blobs' that are a part of the original firmware. By flashing 'both' slots with the same firmware, that means when the custom rom does an 'update', both slots will have the same version of the 'blobs', and the update will work as expected.
So, if you never plan to update the custom rom, and only want to 'test' it, there's no reason to flash both slots. But, this does necessitate you know which slot you're on, and which slot things are being flashed to, of course.
Yeah, the A/B slot thing, it's confusing.
cheers

Categories

Resources