[Tutorial] TWRP ADB Sideloading - Moto G General

Alternative solution: OTG usb flash drive - With one of these, you can store a ROM zip safely, and still format ‘userdata’ to f2fs or EXT4.
TWRP ADB Sideloading​
Requirements: Mac | Linux | Windows PC / Laptop and TWRP Custom Recovery
Moto G (1st Gen) has no SD Card slot. This creates a problem for people converting their phones to GPE and back; as the entire internal storage needs to be formatted (wiped.)
Fastboot images can be used to get android onto your phone after formatting, but there is another way.
NOTE: TWRP needs to be restarted whenever 'data' is changed to a different filesystem.
Example 1:
GPE user wants to flash Stock Motorola ROM.
1) In TWRP, format ‘data’ to f2fs
2) In TWRP, enable ADB Sideloading
3) On PC, use command: ADB sideload stockrom.zip​
Example 2:
Stock Motorola ROM user wants to run GPE.
1) In TWRP, format ‘data’ to ext4
2) In TWRP, enable ADB Sideloading
3) On PC, use command: ADB sideload gperom.zip​
How to access ‘Recovery mode’ ADB:
On a Linux laptop, this is what happens when I use the 'adb devices' command while in TWRP. No drivers are required. I suspect the same applies to Mac OS.
[email protected]:~$ sudo adb devices
List of devices attached
TA53307V38 recovery​
On Windows, it seems not everyone is able to use ADB when in TWRP. The reason for this is that the Motorola drivers installed on the PC are not adequate.
15 Seconds ADB installer includes a generic android driver that may be the solution for people with this problem.
I'd appreciate any tips and insights into how to make this work on different versions of Windows.

Thanks for the guide
some other methods of doing same
Method-1. TWRP 2.8.4.0 supports MTP mode. (Main Menu >> Mount >> Enable MTP) Drivers required for windows. zip file can be copied in MTP mode (Though MTP mode available in 2.7.1.0 it was not working for me but TWRP2.8.4.0 works ). flash via recovery
Method-2. using ADB: place ROM.zip in the adb folder. type following command
Code:
adb push rom.zip /sdcard/
rom will be copied to sdcard. but it does not show the transfer process. flash via recovery

I will report as soon as I will reach home. Well this was needed for people who have issues with adb..
Sent from my Moto G using XDA Free mobile app

For those getting error:
Code:
C:\Users\username\moto>adb sideload sideload.zip
loading: 'sideload.zip'
* failed to write data 'protocol fault (couldn't read status): Invalid argument' *
In TWRP, go to restart > Recovery mode and try again, after the reboot!
Then it works:
Code:
C:\Users\username\moto>adb sideload sideload.zip
loading: 'sideload.zip'
sending: 'sideload.zip' 100%

Can i sideload any type of zip, like BootAnimation zip or System app zips etc, instead of only ROM zips???

subroto1427 said:
Can i sideload any type of zip, like BootAnimation zip or System app zips etc, instead of only ROM zips???
Click to expand...
Click to collapse
You can sideload any zip that you could also install from local storage.

reversegear said:
Thanks for the guide
some other methods of doing same
Method-1. TWRP 2.8.4.0 supports MTP mode. (Main Menu >> Mount >> Enable MTP) Drivers required for windows. zip file can be copied in MTP mode (Though MTP mode available in 2.7.1.0 it was not working for me but TWRP2.8.4.0 works ). flash via recovery
Method-2. using ADB: place ROM.zip in the adb folder. type following command
Code:
adb push rom.zip /sdcard/
rom will be copied to sdcard. but it does not show the transfer process. flash via recovery
Click to expand...
Click to collapse
It seems Lineage 14.1 uses boot loader 0x4111, instead of 0x411A.
Edit: The following resolved it
https://forum.xda-developers.com/moto-g/general/falcon-bootloader-upgrader-tool-t3093793

Related

How to put file on SDCard from Recovery

I need to flash a ROM, but I can't start my phone up to be able to transfer the file over. There used to be a Mount Storage Device option on my old DHD, but I noticed that on the N4, CWM does not have this option (maybe to do with MTP).
How can I copy a file over onto SDCard so I can flash it? I tried:
Code:
adb push file.zip /sdcard/file.zip
When I try and flash it, it says "Can't open /sdcard/file.zip (bad)
Flash TWRP via fastboot and mount the phone via usb the same drag it into the phone.
Alternatively as a last resort, flash back to stock using stock images provided by Google vis fast boot and then drag it onto the sd as well as reinstalling the recovery.
Sent from my Nexus 4 using xda premium
stefandunn said:
I need to flash a ROM, but I can't start my phone up to be able to transfer the file over. There used to be a Mount Storage Device option on my old DHD, but I noticed that on the N4, CWM does not have this option (maybe to do with MTP).
How can I copy a file over onto SDCard so I can flash it? I tried:
Code:
adb push file.zip /sdcard/file.zip
When I try and flash it, it says "Can't open /sdcard/file.zip (bad)
Click to expand...
Click to collapse
Remove the "file.zip" after the sdcard:
Code:
adb push file.zip /sdcard/
Also ensure the real file name doesn't contain spaces.
Edit: the command as you were typing it was telling adb to take the CONTENTS of file.zip and place them in a FOLDER called file.zip. Out of adb's range of abilities
Alternatively, if you're using CWM, you can use the "Install zip from sideload" option. Once you're in, push the file from adb using "adb sideload filename.zip"
The adb command you tried should work fine in recovery. Maybe you weren't in the correct folder where file.zip was located when you executed the adb command?
Also, if you don't have adb set in your PATH, then the adb app will need to be in the same folder as file.zip.
http://forum.xda-developers.com/showthread.php?t=1667929
se1000 said:
Alternatively, if you're using CWM, you can use the "Install zip from sideload" option. Once you're in, push the file from adb using "adb sideload filename.zip"
Click to expand...
Click to collapse
Thank you very much!

help please

i format my Nexus 4 on twrp recovery using advance wipe and i checked all the box there, and when i rebooted its stuck on google logo, what should i do?
Well why would you do that? If you selected everything under advanced in twrp, that means that you have also wiped the system partition so there is no rom to boot into, hence why you are stuck at the google logo. You will need to use adb to copy a rom onto your phone, and then flash it via twrp. Instructions:
1. Setup adb: http://www.redmondpie.com/how-to-set-up-android-adb-and-fastboot-on-windows-tutorial/
2. Install Koush's universal adb driver (google this for the download)
3. Put the phone into twrp
4. Download a rom on your pc and move it to your desktop. Rename it to "rom.zip".
5. Open a command prompt window and run the following commands:
Code:
adb devices
If your phones serial number shows up, continue. If not, reinstall drivers.
Code:
cd Desktop
adb push rom.zip /sdcard/
6. After its finished pushing, go to install within twrp and flash it.
when i typed in cd desktop it says "The system cannot find the path specified". and when i continue to adb push rom.zip /sdcard/ it says "cannot stat rom.zip: no such file or directory"
it worked, thanks for your help.
I hope you realized when you checked all the boxes, you checked to wipe the internal storage which holds all your personal data.
And you checked to wipe /system partition which house the operating system, of course there wouldn't be anything to boot into.
sent from xda premium app

How can i copy Rom zip to phone, i formatted, no rom to flash but i have recovery

I deleted Rom file in sdcard. I cant flash a rom. I have recovery, root and Philz Touch.
How can i copy Rom zip file from computer to Phone? Any idea. I have rooted KK, i dont want to do all things again.
How to: Copy ROM zip file to the freshly wiped device
I found and share with you, it worked.
Have you ever been in a situation where you mistakenly (or not) wiped the content of the internal storage (including system partition and virtual SD card) on your phone or tablet and unfortunately it doesn't support external storage? Now you can't flash desired custom ROM because you removed it and the device can't be booted due to wiped system partition. Don't worry - it's very easy to fix!
Here are the steps you need to follow to copy the correct rom.zip package to your internal storage:
Download this mini-sdk package and extract it to c:\mini-sdk
Rename the custom ROM package you want to flash to "rom.zip" and copy it to c:\mini-sdk
Connect your device to the PC
Boot your device in recovery mode
Open a command prompt on the PC (cmd.exe), type and confirm each command with ENTER:
cd /d c:\mini-sdk
adb shell
mount /data (error might mean that /data partition is already mounted)
on Android 4.2 and above: mkdir -p /data/media/0
on Android 4.1.2 and below: mkdir -p /data/media
exit
on Android 4.2 and above: adb push rom.zip /data/media/0
on Android 4.1.2 and below: adb push rom.zip /data/media
Wait for a few minutes until the file is copied. It will looks like command shell is not responding, but that means it's still copying. Wait patiently until you'll see blinking cursor again.
Depends on your custom recovery, use the navigation keys to flash the custom rom.zip package in a typical way you used to flash custom ROMs. It should be on your internal storage now. Done! http://android-revolution-hd.blogspot.com.tr/2013/12/how-to-copy-rom-zip.html
easier solution:
*bring device in recovery mode
*open cmd, go to adb.exe
*type adb.exe push *filename.zip* /sdcard/your path **/sdcard is already linked to /data/media/0
*wait after pushing the file, reboot recovery again
*choose file and flash
*** other method ***
*use the sideload function in recovery
*adb.exe sideload *rom.zip* in cmd
it says usb device descriptor failed...is it due to bad cable??
it says usb device descriptor failed...is it due to bad cable??

TWRP 3.0.2 Installation process for LeTV One Pro US with adb and fastboot via Linux

With this process I was able to flash the TWRP recovery under Linux for my new LeTV One Pro US e.g. International Version
Installation process for LeTV One Pro US with adb and fastboot on Linux.
Prerequisites:
1. Download TWRP 3.0.2 International US
--> https://www.androidfilehost.com/?w=files&flid=57905
2. Install ADB and Fastboot package:
--> sudo apt-get install android-tools-adb android-tools-fastboot
3. List USB devices when Phone is connected via USB on you linux box.
--> lsusb
--> Note: your phone will be listed with something like 1830 this is to help you to identify the right entry
4. create or edit follwing file for the LeTV One Pro and enter the second line e.g. SUBSYSTEM.....
--> /etc/udev/rules.d/51-android.rules <--(file name)
--> SUBSYSTEM=="usb", ATTR{idVendor}=="2b0e", ATTR{idProduct}=="1830", MODE="0666", GROUP="plugdev" <--(content of file)
5. create file adb_usb.ini in your linux homefolder under ~.android/adb_usb.ini
--> enter in this file only the above idVendor as 0x2b0e
6. Reboot you linux computer and follow the next lines to flash you phone.
Flashing procedure:
1. adb devices
--> your device must be found and listed
2. adb reboot bootloader (After going into fastboot (penguin mode)
3. sudo $(which fastboot) flash recovery recovery.img (recovery.img is only the renamed TWP 3.0.2 image)
4. sudo $(which fastboot) reboot
--> important right after command No. 4 hold Volume Up (to go directly into TWRP recovery)
5. Make NAND Backup via TWRP 3.0.2 of all Partitions (to save your original X800 Phone state)
6. After that you can root the device by installing with TWRP SuperSU 2.65.
Infos TWRP and System partition rw / r:
With the beginning of TWRP 2.8.7.0 the Team Win Recovery Project has bring a option to mount the system partition read-only ! That's intended to help you make a pure backup of your system image that you can later flash to receive over-the-air updates after having rooted or ROMed your device.
Android 5.0 devices and higher check the system partition to see if it has ever changed from read-only to read/write. Users can now opt to install TWRP as read only. It then won't prompt to install SuperSU, nor will it patch your ROM to prevent itself from being replaced with the stock recovery.
2.8.7.0 also brings a resize2fs feature that lets you resize your data partition to use your full amount of available memory in those cases when you flash a factory image intended for a 32GB device to a 64GB one.
To enable developer mode: phone info -> tap build number 7 times. I am a little confused why the TWRP team does not differntiate between CN and US version...
3. sudo $(which fastboot) flash recovery recovery.img (recovery.img is only the renamed TWP 3.0.2 image)
what does it mean "which fastboot"? what type there?
YabaYaba said:
3. sudo $(which fastboot) flash recovery recovery.img (recovery.img is only the renamed TWP 3.0.2 image)
what does it mean "which fastboot"? what type there?
Click to expand...
Click to collapse
Fastboot is the command under Linux or Windows you have to install the packages if you haven't done so.
--> sudo apt-get install android-tools-adb android-tools-fastboot
Gesendet von meinem Le 1 Pro mit Tapatalk

One Plus 5. No OS issue.

So i am having a issue with my oneplus 5 and hope someone could help me out
So i have ended up wiping the entry phone in recovery, getting rid of all the internal data, including sdcard & operating system. At the moment the only thing i can get access to is fastboot & TWRP. I am trying to sideload or push a rom zip to the phone, but all i keep getting is the below:
adb sideload "Zip folder name and extension".
loading "zip"
cannot read "zip"
or i get an error that just says "Closed.
Now i have update to the latest drivers and adb and when i type "adb devices" my phone is showing...
I have also flashed the oneplus 5 recovery via fastboot, however when i go on to adb sideload, the phone doesnt show in CMD.
any help here will be appricated, as i am out of ideas.
Thanks in advance.
Make the file names shorter.
Alternatively, you should be able to use a flash drive through OTG and install the stuff from it.
Rhoban said:
Make the file names shorter.
Alternatively, you should be able to use a flash drive through OTG and install the stuff from it.
Click to expand...
Click to collapse
Unfortunately, OTG isnt a selectable option and i have also tried shorting the file a names but still no look.
Thank you for the input
Use another recovery. OTG should be there, I know somebody that flashed ROMs this way.
KrypticGT said:
...
adb sideload "Zip folder name and extension".
loading "zip"
....
Click to expand...
Click to collapse
Two things I'd try:
1. Change your directory to the one containing the zip file so the command ONLY has the filename.zip in it
2. Download the zip file again and make sure you do a md5sum check on it just in case its corrupted.
Try this:
- Boot your phone in TWRP
- Open cmd.exe on your PC
- Type adb devices (if everything is ok, it should show some numbers followed by the write "recovery")
- Move your ROM inside a folder on your PC and rename it "Rom.zip" (ie inside the folder "download")
- Using CMD.exe, move inside that folder typing "cd C:/...."
- Type "adb push Rom.zip /sdcard"
- Wait til a confirmation message will appear on CMD.exe
- Flash the ROM using TWRP
So for future reference to anyone that might have the same issue.
I fixed this issue, by flashing a older version of TWRP. This allowed me to use ADB sideload without issue & also allow OTG_USB. It also allowed me to flash files with long names.... I have tried to go back to the latest version of TWRP for OP5 but i get the errors i was getting before.
Strange, but did the fix.
Thanks all for the help & input.

Categories

Resources