I recently bricked my Atrix 2, and since I don't have easy access to a Windows machine, I attempted to flash it back to stock using fastboot from the android dev tools. I noticed that the XML file in the FXZ looked like a set of fastboot commands, so that's what I tried to do. However, no matter which zip I started from, it always failed to flash system.img, saying that verification failed. After giving up on that approach, I used a friend's windows machine to flash the exact same zip using RSDLite, and it succeeded just fine. This leads me to conclude that RSDLite must be doing something special when flashing the system.img. Does anyone know what it is, and is there a way to do the same thing using the standard Android development tools (fastboot, etc)?
Thanks!
bemjb said:
I recently bricked my Atrix 2, and since I don't have easy access to a Windows machine, I attempted to flash it back to stock using fastboot from the android dev tools. I noticed that the XML file in the FXZ looked like a set of fastboot commands, so that's what I tried to do. However, no matter which zip I started from, it always failed to flash system.img, saying that verification failed. After giving up on that approach, I used a friend's windows machine to flash the exact same zip using RSDLite, and it succeeded just fine. This leads me to conclude that RSDLite must be doing something special when flashing the system.img. Does anyone know what it is, and is there a way to do the same thing using the standard Android development tools (fastboot, etc)?
Thanks!
Click to expand...
Click to collapse
Fastboot is basically doing what RSD Lite does manually. If you keep on getting a flash system.img error mkake sure that you have the proper drivers. You can download Android-SDK for your platform and then open the manager. There should be an option to install a drivers package.
I am pretty sure RSD Lite does nothing special. I have flashed just the system.img multiple times to quickly get my phone back up and running.
.
farshad525hou said:
Fastboot is basically doing what RSD Lite does manually. If you keep on getting a flash system.img error mkake sure that you have the proper drivers. You can download Android-SDK for your platform and then open the manager. There should be an option to install a drivers package.
I am pretty sure RSD Lite does nothing special. I have flashed just the system.img multiple times to quickly get my phone back up and running.
.
Click to expand...
Click to collapse
Thanks, but there are no USB drivers available for Mac OS X: the Android SDK says that they are unavailable for this platform. Maybe if I get the chance, I'll see if doing the flash with fastboot on Windows gives different results.
Are you using moto-fastboot?
Oh there's a Mac version here (from here)
There's a size limit on flash operations with normal fastboot.
moofree said:
Are you using moto-fastboot?
Oh there's a Mac version here (from here)
There's a size limit on flash operations with normal fastboot.
Click to expand...
Click to collapse
I've been using normal fastboot, I didn't realize there was a difference there. Thanks a ton, I'm sure that will solve my issue!
This needs to be added to to using the fastboot command that Farshad posted.
If you are doing this from OS X or linux, or well even windows, I posted a string of commands on how to flash these files using fastboot, there is a certain order, and there are files from the fxz you will need to skip.
Next time please do a search on this board for fastboot flash commands....
I will be nice and post this one last time, but this has been answered by me about 10 times now.... just saying....
run these commands from the OS X or linux terminal command line:
cd to the directory that contains the fxz files, and run the following (make sure that the adb and fastboot commands are in your path, I will not include that here, you should google how to add things to your path):
Code:
fastboot erase userdata
fastboot erase boot
fastboot erase system
fastboot erase recovery
fastboot flash userdata userdata.img
fastboot flash system system.img
fastboot flash recovery recovery.img
fastboot flash boot boot.img
fastboot reboot
jimbridgman said:
This needs to be added to to using the fastboot command that Farshad posted.
If you are doing this from OS X or linux, or well even windows, I posted a string of commands on how to flash these files using fastboot, there is a certain order, and there are files from the fxz you will need to skip.
Next time please do a search on this board for fastboot flash commands....
I will be nice and post this one last time, but this has been answered by me about 10 times now.... just saying....
run these commands from the OS X or linux terminal command line:
cd to the directory that contains the fxz files, and run the following (make sure that the adb and fastboot commands are in your path, I will not include that here, you should google how to add things to your path):
Code:
fastboot erase userdata
fastboot erase boot
fastboot erase system
fastboot erase recovery
fastboot flash userdata data.img
fastboot flash system system.img
fastboot flash recovery recovery.img
fastboot flash boot boot.img
fastboot reboot
Click to expand...
Click to collapse
do you really have to erase before flashing? I always try to avoid formatting system, but I have not done this manually, so you may have to.
lkrasner said:
do you really have to erase before flashing? I always try to avoid formatting system, but I have not done this manually, so you may have to.
Click to expand...
Click to collapse
Yes if you don't you will most likely get an error when you try to flash system.img, over a different system version.
jimbridgman said:
This needs to be added to to using the fastboot command that Farshad posted.
If you are doing this from OS X or linux, or well even windows, I posted a string of commands on how to flash these files using fastboot, there is a certain order, and there are files from the fxz you will need to skip.
Next time please do a search on this board for fastboot flash commands....
I will be nice and post this one last time, but this has been answered by me about 10 times now.... just saying....
run these commands from the OS X or linux terminal command line:
cd to the directory that contains the fxz files, and run the following (make sure that the adb and fastboot commands are in your path, I will not include that here, you should google how to add things to your path):
Code:
fastboot erase userdata
fastboot erase boot
fastboot erase system
fastboot erase recovery
fastboot flash userdata data.img
fastboot flash system system.img
fastboot flash recovery recovery.img
fastboot flash boot boot.img
fastboot reboot
Click to expand...
Click to collapse
Sorry I missed your other explanations. I did see a lot of posts with random fastboot commands, but pretty much none with any sort of explanation or rationale. Most of them seemed to be on the order of "Use these commands because I said so" or "I used these and they seem to work, I don't know why".
Do you have a writeup where you explain why should I flash with fastboot in a different order than is given in the fxz? And can you explain why you are skipping flashing most of the partitions? None of the instructions for using RSD Lite suggested removing nearly that many of the entries in the xml file, so I would like to know why I wouldn't want to flash the same things that RSD Lite would be flashing.
If you do have a canonical post explaining what needs to be done and why, I can ask the maintainer of the newbie information post to add a link to that post, so that it is easy to find and hopefully make it so that you don't have to post about it again. If that post doesn't exist, if you would like to give me enough information to write it, I am more than happy to write it up (crediting you for the info, of course), and then see about getting it added to the newbie post.
bemjb said:
Sorry I missed your other explanations. I did see a lot of posts with random fastboot commands, but pretty much none with any sort of explanation or rationale. Most of them seemed to be on the order of "Use these commands because I said so" or "I used these and they seem to work, I don't know why".
Do you have a writeup where you explain why should I flash with fastboot in a different order than is given in the fxz? And can you explain why you are skipping flashing most of the partitions? None of the instructions for using RSD Lite suggested removing nearly that many of the entries in the xml file, so I would like to know why I wouldn't want to flash the same things that RSD Lite would be flashing.
If you do have a canonical post explaining what needs to be done and why, I can ask the maintainer of the newbie information post to add a link to that post, so that it is easy to find and hopefully make it so that you don't have to post about it again. If that post doesn't exist, if you would like to give me enough information to write it, I am more than happy to write it up (crediting you for the info, of course), and then see about getting it added to the newbie post.
Click to expand...
Click to collapse
The reason is there are other files, and some are binary files that run commands and make changes to the bootloader, and other things, you do not need any of that to have a working phone. Some of them also open the bootloader to allow flashing, which is not needed if you erase the boot partition first. Any of those files like mbmloader, and anything with .bin after it will not work correctly unless you use RSDlite, it sends the signatures and such to the files that require it.
For getting your phone back up in a quick and dirty fashion we don't care about the signatures, we are assuming you got the fxz from a known source, by doing it this way.
You should do other research besides this site, pull apart a few roms, the fxz, and figure out how they work. Do some android research as to the boot process, etc. That how this kind of information is learned. The why in this case is less important. I would have to explain android and linux and how they boot as well in more detail here, but those are best left to the google and linux explanation sites.
This is not a process for a beginner, that is why it is not in the beginner thread. It has the possibility of hard bricking your phone if a mistype happens.
I am going to be 100% honest here, if you don't know any of the information I am referring to in this post, just use RSDlite, it has checks and safeguards that this process does not.
If you really want to learn about this, and not just asking questions because you don't understand, then jump in with us devs and start to learn, pull apart some ROMs flash a few ROMs, build a few ROMs, those things will teach you more than you will ever need to know about what files are and are not needed for a working phone. Also google is a good resource.
Also your boot.img and your recovery.img could be left out, since they are never touched by you or a ROM flash. I leave them in for a slight safeguard that your phone will actually be wiped clean.
P.S. I am a linux and OS X user myself, hence why I learned all of this a long time ago... I have been using and working on android since the G1 firat came out.
I also use bootcamp with win7 just to use RSDlite, when the need arises... that is not often, if you follow my process. It skips all the checking, processing that RSDlite does with using fastboot.
jimbridgman said:
The reason is there are other files, and some are binary files that run commands and make changes to the bootloader, and other things, you do not need any of that to have a working phone. Some of them also open the bootloader to allow flashing, which is not needed if you erase the boot partition first. Any of those files like mbmloader, and anything with .bin after it will not work correctly unless you use RSDlite, it sends the signatures and such to the files that require it.
For getting your phone back up in a quick and dirty fashion we don't care about the signatures, we are assuming you got the fxz from a known source, by doing it this way.
You should do other research besides this site, pull apart a few roms, the fxz, and figure out how they work. Do some android research as to the boot process, etc. That how this kind of information is learned. The why in this case is less important. I would have to explain android and linux and how they boot as well in more detail here, but those are best left to the google and linux explanation sites.
This is not a process for a beginner, that is why it is not in the beginner thread. It has the possibility of hard bricking your phone if a mistype happens.
I am going to be 100% honest here, if you don't know any of the information I am referring to in this post, just use RSDlite, it has checks and safeguards that this process does not.
If you really want to learn about this, and not just asking questions because you don't understand, then jump in with us devs and start to learn, pull apart some ROMs flash a few ROMs, build a few ROMs, those things will teach you more than you will ever need to know about what files are and are not needed for a working phone. Also google is a good resource.
Also your boot.img and your recovery.img could be left out, since they are never touched by you or a ROM flash. I leave them in for a slight safeguard that your phone will actually be wiped clean.
P.S. I am a linux and OS X user myself, hence why I learned all of this a long time ago... I have been using and working on android since the G1 firat came out.
I also use bootcamp with win7 just to use RSDlite, when the need arises... that is not often, if you follow my process. It skips all the checking, processing that RSDlite does with using fastboot.
Click to expand...
Click to collapse
Thanks for the rather comprehensive reply. Sadly, I do not have the time or inclination to build ROMs, in fact, I may not have dug into this at all if I had a Windows license, but I do not. So it is true that I didn't know all of the information that you mentioned in the post, but I had guessed a lot of it given the format of the xml file in the fxz and the names of the partitions. I just like to verify that my guesses are not incorrect, thus the questions. I do have plans to spend some time reading Google's official Android documentation, I just hadn't gotten there yet.
Anyways, while I am not interested in building ROMs, given the format of the xml file, it looks like it would be a fairly easy task to build a Java application that would read the XML file, check the MD5 sums, and then do the flashing just like RSD Lite. If I was to do something to contribute to the development effort, I'd probably start there. Don't know if I'll have time, but that's much more of a problem to me than a custom ROM. You mention signature checking: does RSD Lite actually check cryptographic signatures on the images themselves, or is it only checking the MD5s? (Feel free to ignore that question if you think I should spend some time Googling, if you don't answer, I'll get around to looking it up eventually)
P.S. I am an experienced Linux and OS X user. I only happen to be new to the Android world. (I was using webOS before this)
bemjb said:
Thanks for the rather comprehensive reply. Sadly, I do not have the time or inclination to build ROMs, in fact, I may not have dug into this at all if I had a Windows license, but I do not. So it is true that I didn't know all of the information that you mentioned in the post, but I had guessed a lot of it given the format of the xml file in the fxz and the names of the partitions. I just like to verify that my guesses are not incorrect, thus the questions. I do have plans to spend some time reading Google's official Android documentation, I just hadn't gotten there yet.
Anyways, while I am not interested in building ROMs, given the format of the xml file, it looks like it would be a fairly easy task to build a Java application that would read the XML file, check the MD5 sums, and then do the flashing just like RSD Lite. If I was to do something to contribute to the development effort, I'd probably start there. Don't know if I'll have time, but that's much more of a problem to me than a custom ROM. You mention signature checking: does RSD Lite actually check cryptographic signatures on the images themselves, or is it only checking the MD5s? (Feel free to ignore that question if you think I should spend some time Googling, if you don't answer, I'll get around to looking it up eventually)
P.S. I am an experienced Linux and OS X user. I only happen to be new to the Android world. (I was using webOS before this)
Click to expand...
Click to collapse
No worries.... I am and have been a unix linux architect for 20 years (yes I got a job as a sysadmin at 17), been using macs since the 80s, I don't own a machine with a fulltime windows install. I only recently installed win 7 on my bootcamp partition on my macbook just for rdslite, only used it twice....
I have a shell script that will flash the phone using the commands I posted, if you would like I can upload it and post a link tomorrow. My shell script works on both os x and linux.
If you you try to do EXACTLY what rsdlite does line by line it will FAIL, even with a java app. The bin files and the mbm files can only be utilized with RSDlite. RSDlite has SEVERAL checks that only it can do after each step.... If you want to restore the fxz using the mac or linux the shell script is the easiest, no real need for all the fluff, of rsdlite or an app. I have done it about 20 times now without issue, so have others on here.
Again, just let me know if you want my script and I will post it here.
And no it does not check the cryptographic signature of the bootloader, but the mbm program that rdslite runs, does check the signature of the boot image and the bootloader.
I was not implying that you actually jump into rom dev work.... just that, by doing some pulling apart and attempting it will teach you more than reading the android docs.
If you are a linux guy then hopefully you know what sec linux is, and how it uses signatures with the bootloader. That is similar to what motorola has done with their bootloader on their android phones.
Jim
Sent from my MB865 using xda premium
jimbridgman said:
No worries.... I am and have been a unix linux architect for 20 years (yes I got a job as a sysadmin at 17), been using macs since the 80s, I don't own a machine with a fulltime windows install. I only recently installed win 7 on my bootcamp partition on my macbook just for rdslite, only used it twice....
I have a shell script that will flash the phone using the commands I posted, if you would like I can upload it and post a link tomorrow. My shell script works on both os x and linux.
If you you try to do EXACTLY what rsdlite does line by line it will FAIL, even with a java app. The bin files and the mbm files can only be utilized with RSDlite. RSDlite has SEVERAL checks that only it can do after each step.... If you want to restore the fxz using the mac or linux the shell script is the easiest, no real need for all the fluff, of rsdlite or an app. I have done it about 20 times now without issue, so have others on here.
Again, just let me know if you want my script and I will post it here.
And no it does not check the cryptographic signature of the bootloader, but the mbm program that rdslite runs, does check the signature of the boot image and the bootloader.
I was not implying that you actually jump into rom dev work.... just that, by doing some pulling apart and attempting it will teach you more than reading the android docs.
If you are a linux guy then hopefully you know what sec linux is, and how it uses signatures with the bootloader. That is similar to what motorola has done with their bootloader on their android phones.
Jim
Sent from my MB865 using xda premium
Click to expand...
Click to collapse
You do have a couple of years on me on Linux use, and definitely lots more years of Mac use, I didn't use Macs until OS X. But I think we've established geek cred quite effectively at this point. ;-)
Thanks for offering the script, but if it literally just runs the commands that you gave earlier, it would be simple for me to just toss one together myself. (Now, if you want to elaborate on the secret sauce in RSDLite, I'd be all ears.
I do know what SELinux is. I haven't looked into the specifics of how they use signatures with the bootloader, but I have a pretty good idea of ways that it could be implemented. It does make a lot of sense that Moto would do something similar to SELinux. Actually, I'm a little bit surprised that they're doing something similar and not just doing the same thing, but perhaps the bootloaders are different enough that they needed to roll their own signing. (Or they just did what a lot of people do and fell into NIH syndrome.)
Thanks,
Bem
jimbridgman said:
This needs to be added to to using the fastboot command that Farshad posted.
If you are doing this from OS X or linux, or well even windows, I posted a string of commands on how to flash these files using fastboot, there is a certain order, and there are files from the fxz you will need to skip.
Next time please do a search on this board for fastboot flash commands....
I will be nice and post this one last time, but this has been answered by me about 10 times now.... just saying....
run these commands from the OS X or linux terminal command line:
cd to the directory that contains the fxz files, and run the following (make sure that the adb and fastboot commands are in your path, I will not include that here, you should google how to add things to your path):
Code:
fastboot erase userdata
fastboot erase boot
fastboot erase system
fastboot erase recovery
fastboot flash userdata userdata.img
fastboot flash system system.img
fastboot flash recovery recovery.img
fastboot flash boot boot.img
fastboot reboot
Click to expand...
Click to collapse
Hm. My bootloader and I are not on very good terms atm :\
-It tells me "command restricted" when erasing system, recovery, or boot with fastboot. RSD Lite just says "FAIL."
-Also, it tells me "preflash validation failure" when flashing boot or recovery. RSD Lite again just says "FAIL"
-It also gives me the "preflash validation failure" when flashing system with fastboot. Moto-fastboot and RSD Lite both work. Maybe fastboot would work if we could erase system?
-Finally, we don't have a userdata.img
cogeary said:
Hm. My bootloader and I are not on very good terms atm :\
-It tells me "command restricted" when erasing system, recovery, or boot with fastboot. RSD Lite just says "FAIL."
-Also, it tells me "preflash validation failure" when flashing boot or recovery. RSD Lite again just says "FAIL"
-It also gives me the "preflash validation failure" when flashing system with fastboot. Moto-fastboot and RSD Lite both work. Maybe fastboot would work if we could erase system?
-Finally, we don't have a userdata.img
Click to expand...
Click to collapse
In the first line the fastboot command I referenced and that Farshad mentioned and linked to is the moto-fastboot command. You are supposed to rename the binary to fastboot, there was a readme at one time that explained that and was included with the download of moto-fastboot.
Also, yes we don't have a Userdata.img, but I pulled this from my own personal script, that I have been using since the G1 days, that was my first android phone. My script is not customized for just our phone, so the userdata.img line will fail, but since we don't need it, it is no big deal.
Jim
jimbridgman said:
In the first line the fastboot command I referenced and that Farshad mentioned and linked to is the moto-fastboot command. You are supposed to rename the binary to fastboot, there was a readme at one time that explained that and was included with the download of moto-fastboot.
Also, yes we don't have a Userdata.img, but I pulled this from my own personal script, that I have been using since the G1 days, that was my first android phone. My script is not customized for just our phone, so the userdata.img line will fail, but since we don't need it, it is no big deal.
Jim
Click to expand...
Click to collapse
Oh I see now . I typically use moto-fastboot but I never renamed it. Thanks for the clarification.
cogeary said:
Oh I see now . I typically use moto-fastboot but I never renamed it. Thanks for the clarification.
Click to expand...
Click to collapse
Yeah the reason to rename the binary/exe, was for compatibility with other scripts and programs in old days, when there was no odin or RSDlite, etc. I still do it, so that if someone does come up with some bad-assed way to do something via a script or other means for another phone, then I don't have to edit their script to reference the "moto-fastboot" binary/exe. I just rename the fastboot to fastboot-orig, or fastboot-google. If I ever change phones, and I will, I can rename the binary/exe again real easy.
Just one of those things I have learned over the years with both android and linux and well even in the old DOS and windows NT 3.51 and 4.0 command line days.
Related
So I have my Xoom unlocked and I am trying to flash the recovery in order to root. I have the recovery in the platform tools folder along with fastboot and all that, and I'm able to get the Xoom into fastboot from adb, but I can't get the recovery to flash. I'm typing the name correct. And I'm putting in 'fastboot flash recovery recovery-Tiamat-R4c-100611-1150-cwm.img' without the quotes. Honestly I'm a little bit stumped at this point.
I have had the same issue for the past few days I have also tried the steps here no luck.... http://forum.xda-developers.com/showthread.php?t=1249798
supenova3000 said:
I have had the same issue for the past few days I have also tried the steps here no luck.... http://forum.xda-developers.com/showthread.php?t=1249798
Click to expand...
Click to collapse
I used the same guide. It just makes no sense that I can control the Xoom and unlock it, but I can't flash the darn recovery.
williamthegoat said:
I used the same guide. It just makes no sense that I can control the Xoom and unlock it, but I can't flash the darn recovery.
Click to expand...
Click to collapse
I tried moving the files from the tools folder to platform tools still no luck.. all of this for the I C S flash I'm going to keep working on a solution I will let you know if I have any luck!
So I have the android sdk in c:\ , and in the sdk folder I have everything, and in the platform tools I have my fastboot and recovery. I then use cmd to get into adb, then I put the xoom in fastboot. From there I try to flash the recovery, which always fails. I must be doing something wrong here.
Try downloading the IMG again. Or try out the rogue recovery. I actually like rogue better.
Sent from my MB860 using xda premium
I finally got it. In command I needed to direct it to the platform tools folder and then it flashed just fine. I am now rooted. Now to learn about flashing ICS
Thanks for the responses and help guys
Think you have to be stock to flash to ICS, at least that was the word yesterday.
I gave up trying to root just as I found out about the ICS update.
williamthegoat said:
I finally got it. In command I needed to direct it to the platform tools folder and then it flashed just fine. I am now rooted. Now to learn about flashing ICS
Thanks for the responses and help guys
Click to expand...
Click to collapse
Two simple errors:
1) not opening the command window from the folder where you have fastboot and the image files you're trying to flash; and
2) not realizing that you have hidden file extensions in Windows, and typing ...recovery.img.img
williamthegoat said:
So I have my Xoom unlocked and I am trying to flash the recovery in order to root. I have the recovery in the platform tools folder along with fastboot and all that, and I'm able to get the Xoom into fastboot from adb, but I can't get the recovery to flash. I'm typing the name correct. And I'm putting in 'fastboot flash recovery recovery-Tiamat-R4c-100611-1150-cwm.img' without the quotes. Honestly I'm a little bit stumped at this point.
Click to expand...
Click to collapse
I assume that you've set up a path in environment variables to run adb and fastboot from ay directory... and are running the flash command from a folder other than where your .IMG file is located. In order for fastboot to find the file you're trying to flash, you actually have to run your flash command from the folder your file is located...
So, cd\...\platform-tools and then flash
The simplest way I perform all of my operations for this:
I leave everything installed into it's default locations. I download tiamat's CWM image and place it into the platform-tools folder.
For Windows 7, I use Windows PowerShell.
For example: Open Start Menu > Type "power" to search, "Windows PowerShell" should show up. (For me, its default at the top - so I press enter to open it)
Once opened: I type this configuration EXACTLY as is: (Keys in <>)
Code:
cd C:\Pr <TAB><TAB> An <TAB> An <TAB> Pl <TAB><TAB> <ENTER>
This above brings me directly to:
C:\Program Files (x86)\Android\Android-sdk\Platform-tools\
Of course, this will be different depending upon your computer setup. I've nailed this routine to get to the path the quickest.
to use FASTBOOT (XOOM already in fastboot mode):
Code:
./fastboot flash recovery rec<TAB><ENTER>
This auto completes the filename as ./recovery-tiamat-r4c-xxxx.img
Of course, depending on how many files/folders you have, you may have to hit <TAB> multiple times. I have to do it 3 or 4 times to select the recovery image I want.
Auto-complete is a nice thing. "./" is added to command from the working directory.
williamthegoat said:
I finally got it. In command I needed to direct it to the platform tools folder and then it flashed just fine. I am now rooted. Now to learn about flashing ICS
Thanks for the responses and help guys[/QUOTE
Worked for me too!!! Thanks!!!
Click to expand...
Click to collapse
I see there are a lot of users here in these forums that either are scared of ADB or have no idea how to use it or what to do with it.
The beauty of ADB is it's cross platform, it works on Windows, Mac, and Linux.
The adb commands everyone should know how to use are very basic and used for file manipulation and device control.
To use ADB Google will tell you you need to download and install the most current Android SDK. If you want to write apps for Android, this is true, but for most people there's no need to do this.
You can get everything you need from one of the one clicks.
You need adb and fastboot for your platform.
Download them and put them in a directory of your choice, on my Mac they live in /Android.
I've dug them up and attached adb and fastboot for all platforms. Just unzip them and put the ones for your Operating System somewhere easy to get to.
if you're on Windows you'll need drivers. The best way to get the driver is to download HTC Sync from here http://dl4.htc.com/managed-assets/support/software/htc-sync/htc_sync_setup_3.2.20.exe and install it. After it is installed make sure it isn't running.
I'm now going to go through a few simple adb command and what they're for.
To use ADB or Fastboot your phone has to be in USB Debugging mode Set this in Settings/Developer Options on the phone.
Open a Command prompt
Navigate to the location you put the adb and fastboot commands
1) adb reboot
this command does exactly what it says. If you type it without any modifiers your phone will reboot. You can also reboot recovery or reboot bootloader.
2) adb push
Adb push is the command for putting a file on your device.
The format to use the command is adb push /filelocation/filename /destination the destination is usually /sdcard
3) adb pull
this command is how you get a file off of your phone
adb pull /file location the file will be downloaded to the location of your adb executable
4) Sometimes to help you troubleshoot a problem you may be asked to provide a logcat to someone. What this means is a log of the what is happening on the device. Getting one is easy
adb logcat > logcat.txt
this will create a logcat file and save it to the directory on your computer that you're running the adb commands from. To stop the logcat just use ctrl-c
Now on to fastboot
fastboot is a special mode on Android phones that allow system level partitions to be written or commands executed.
fastboot only works if your phone is in bootloader mode.
Once in bootloader mode
open a command prompt and navigate to where you installed the fastboot executable
You need fastboot to unlock your bootloader
fastboot flash unlocktoken Unlock_code.bin
and to relock it:
fastboot oem lock
you can also use fastboot to flash recoveries
fastboot flash recovery recovery.img use the filename of the recovery you downloaded.
If you've installed the 2.20 firmware from AT&T and you have root, you'll need to flash the kernel for any new rom separately using fast boot.
unzip the rom you've downloaded and locate the boot.img file and put it in the same directory as your fastboot and dab commands
reboot to bootloader then flash the kernel using the command fastboot flash boot boot.img. after hat you can boot into recovery right from the bootloader and install your rom.
These commands are just a few very basic ones.
There's no reason to be afraid of the command line or these tools.
I hope this quick and dirty tutorial helps someone.
If there's something else that can be explained here, feel free to add it to the thread and I'll add it to the OP.
you're right. nobody should be afraid of adb/fastboot commands or understanding WHY they are useful.
i would as far to say that if you dont understand basic adb/fastboot commands, then you have no business modding your phone....
You gotta add that they need to open a command line from the directory that has adb in it and type the commands from there.
_MetalHead_ said:
You gotta add that they need to open a command line from the directory that has adb in it and type the commands from there.
Click to expand...
Click to collapse
Oh yeah, duh
gunnyman said:
Oh yeah, duh
Click to expand...
Click to collapse
You're slackin'
I would go so far to say that this lack of comfort with adb/fastboot is the single largest contributor to the issues people have had in rooting and unlocking their HOXs over the last two months. Thanks for taking the time to put this together. Should help quite a few people unsure of adb/fastboot in general.
Another adb usage that may be helpful to add to this list is adb pull of user apps before updating ROM and then pushing them back. I have often seen people unsure of the best way to restore apps after a ROM upgrade. For me TiB works great, but you need to know what to restore via TiB and what to configure again manually. I think Scott posted the general steps in one of his CleanROM threads, but adding it to this list would be good too.
Just realized it's exactly two months since I received my pre-ordered HOX . No bricks, a superb HOX that I haven't had to warranty replace for any reason so far, and then comes along Scott with his fantastic CleanROM series. What a fun-filled ride it has been so far
Add adb logcat as well please, not enough people know how to use it
nice bro! this will come in handy for those that need it. i was there once! we all were. but good job man!
rohan32 said:
Add adb logcat as well please, not enough people know how to use it
Click to expand...
Click to collapse
Good call. Tomorrow I'll update it.
Done. Keep the suggestions coming. I know enough to get someone started, but I'm no developer.
I like this. Information that won't get old and everyone needs at one point or another. Nice call gunny.
Stickify!
this is great! excellent idea gunny
Oh yeah, stickied! :highfive: Too bad noobs still won't read it lol. They never read anything :silly:
_MetalHead_ said:
Oh yeah, stickied! :highfive: Too bad noobs still won't read it lol. They never read anything :silly:
Click to expand...
Click to collapse
Yeah but now we can be snarky and say "didn't you read the effing sticky???"
What about common connection issues?
Im facing one now
Funny you should say that. Your post made me realize it was missing.
So I'm getting a replacement One X from AT&T on July 19th and need to send my current phone back. I unlocked the bootloader and flashed ROM's on my current phone, so I should just follow this guide to return my phone back to stock before shipping it out to AT&T, correct?
Sent from my HTC One X using Tapatalk 2
acles003 said:
So I'm getting a replacement One X from AT&T on July 19th and need to send my current phone back. I unlocked the bootloader and flashed ROM's on my current phone, so I should just follow this guide to return my phone back to stock before shipping it out to AT&T, correct?
Sent from my HTC One X using Tapatalk 2
Click to expand...
Click to collapse
lock bootloader install RUU
done
Simple and awesome thread. Should help a lot of people.
This really helped me out before I became a member, thanks
Bear with me: Right now my nexus is stuck in a bootloop. My nexus had been partially rooted, everytime i went to download the OTA 5.0.1. update it would just take me to TWRP, and i didn't know what to do with that. So I finally tried to fully root the phone, and also use TWRP to install the OTA update. Now I'm stuck, I've tried wiping the cache/factory reset. How do I got about flashing it back to stock without losing all my data?
(apologies for the title, I thought originally that I had killed mtp and adb, but I figured out how to get them back just after posting)
Thanks!
As I saw your post before the edit.... Stop using toolkits and read about adb. If it's bootlooping then it's 95% not bricked so don't panic and read the guides
Just download system.img you want and fastboot it
Edit -
Don't see this as me being mean or a ****. This is stuff everyone needs to know, it's really not hard at all so don't worry. Once you've used it a few times you'll wonder why you ever used toolkits
Ben36 said:
As I saw your post before the edit.... Stop using toolkits and read about adb. If it's bootlooping then it's 95% not bricked so don't panic and read the guides
Just download system.img you want and fastboot it
Edit -
Don't see this as me being mean or a ****. This is stuff everyone needs to know, it's really not hard at all so don't worry. Once you've used it a few times you'll wonder why you ever used toolkits
Click to expand...
Click to collapse
I don't think you're being a ****. I'm very grateful for your input. I used to be very into jailbreaking when I had an iPhone, but i haven't been able to put the same time towards getting the hang of rooting (which I think has a steeper learning curve to begin with|). I sort of understand adb but I obviously need to learn more. I've been using the toolkit because it was simpler. I remember from trying to use adb before that I need to place the files I want to transfer in the same folder as adb (i think?) but I could never get that to work.
I also don't understand system.img.'s relevance here. I'm not getting the "Error: Update package missing system.img" error.
The reason I say read the guides is simply it saves me or anyone else typing out a massive guide that already exists in many places.
If you're looping then something is more than likely wrong with the system not the data. So flashing just the system will keep your data safe (as long as you flash the same android version as you previously had, lollipop or kitkat)
You need to be in the bootloader not recovery and use the command fastboot flash system system.img
Google img's are here - https://developers.google.com/android/nexus/images
(just keep unzipping until you find the individual img files)
photobumm said:
I don't think you're being a ****. I'm very grateful for your input. I used to be very into jailbreaking when I had an iPhone, but i haven't been able to put the same time towards getting the hang of rooting (which I think has a steeper learning curve to begin with|). I sort of understand adb but I obviously need to learn more. I've been using the toolkit because it was simpler. I remember from trying to use adb before that I need to place the files I want to transfer in the same folder as adb (i think?) but I could never get that to work.
I also don't understand system.img.'s relevance here. I'm not getting the "Error: Update package missing system.img" error.
Click to expand...
Click to collapse
He's saying to flash a system image to get you up and running again, and I agree that that is what you should do. As far as placing the files in the same folder as adb and fastboot is concerned (you'll use fastboot to flash the image), you need to do just that. I created a folder on my desktop called "ADB" and that's where both adb and fastboot are, as well as all the files that I flash with fastboot ie. system images, recoveries, etc... Here's a great guide to get you going with adb and fastboot- http://forum.xda-developers.com/showthread.php?t=2277112
Now when you go to flash it, if you decide to use the flash-all.bat to flash everything (the full factory image) and bring you back to stock, you'll have to open the .bat file with a text editor and remove the "-w" from the script and that way it won't wipe your phone. If you want to just reinstall the OS without everything else (worth a shot), just flash the system with the command
Code:
fastboot flash system system.img
and that should get you running again. If what I just said is confusing, read the guide I posted and it should become clear.
Here is where you'll download the factory image from- https://developers.google.com/android/nexus/images
Just unzip it, pull the system.img out and place it in the same folder that fastboot is in and flash away.
And one final thing- definitely avoid toolkits at all costs. You spent a good chunk of change on your phone, take the time to learn how to mod it the correct way.
Good luck!
_MetalHead_ said:
He's saying to flash a system image to get you up and running again, and I agree that that is what you should do. As far as placing the files in the same folder as adb and fastboot is concerned (you'll use fastboot to flash the image), you need to do just that. I created a folder on my desktop called "ADB" and that's where both adb and fastboot are, as well as all the files that I flash with fastboot ie. system images, recoveries, etc... Here's a great guide to get you going with adb and fastboot- http://forum.xda-developers.com/showthread.php?t=2277112
Now when you go to flash it, if you decide to use the flash-all.bat to flash everything (the full factory image) and bring you back to stock, you'll have to open the .bat file with a text editor and remove the "-w" from the script and that way it won't wipe your phone. If you want to just reinstall the OS without everything else (worth a shot), just flash the system with the command
Code:
fastboot flash system system.img
and that should get you running again. If what I just said is confusing, read the guide I posted and it should become clear.
Here is where you'll download the factory image from- https://developers.google.com/android/nexus/images
Just unzip it, pull the system.img out and place it in the same folder that fastboot is in and flash away.
And one final thing- definitely avoid toolkits at all costs. You spent a good chunk of change on your phone, take the time to learn how to mod it the correct way.
Good luck!
Click to expand...
Click to collapse
So I have adb and fastboot running. And I changed the flash-all.bat file. However, I don't understand what I do now? I downloaded the Hammerhead zip and it has a bunch of things in it. Which files do I put into the adb/fastboot folder and how do I then flash them?
In the hammerhead file it lists the bootloader, flash-all, radio and then a zip file "image-hammerhead...". What files am I using and what is the code that I input? Is this the same sa flashing a rom?
I also tried placing the system.img in the adb folder, and then using the
Code:
fastboot flash system system.img
but it gives me an error "cannot load 'system.img'
So now my issue is I get a "error: could not load 'system.img'. after running
Code:
fastboot flash system system.img [code/] . I also tried with boot.img. Same error.
I ran the "flash all" script, by accident, a screenshot of the terminal is attached.. I'm still stuck in a the boot loop, however, and if try to enter recovery mode an android lying down with a red triangle is present. The above "error: could not load..." is still present.
Create a folder and put fastboot in it.
So you unzipped the stock image. You said you have some images in the folder and a zip image.
Unzip that second zip.
There you will find the rest of the images you need.
Now take the recovery, bootloader, system, userdata, cache, and radio images and move them into the folder which you created for fastboot.
Rename the bootloader image to bootloader. img
Now when looking at that open folder containing all the images and fastboot hold down shift and left click and select "open command promt from window"
Type
/fastboot erase bootloader
/fastboot flash bootloader bootloader.img
/fastboot reboot-bootloader
/fastboot erase recovery
/fastboot flash recovery recovery.img
/fastboot erase radio
/fastboot flash radio radio.img
Repeat for the rest of the image files
Finally type /fastboot reboot
Profit.
---------- Post added at 10:54 PM ---------- Previous post was at 10:51 PM ----------
P. S. Make sure your phone is booted in fastboot mode first.
Oh and that android is stock recovery
U fixed it?
So for some reason I still kept getting that error. I ended up restoring to stock using the nexus root toolkit. So it all worked out in the end.
I've managed to compile 5.1.1 aosp,
here is my problem, fastboot doesn't seem to recognize the command i'm typing in '-S 256M' as stated on the sony site.
If i try and flash them the normal way, for example "fastboot flash system system.img"
it doesn't flash like this, i have tried on linux and windows.
I've attached screenshots to show my problem.
Edit- I should of said first, I can flash boot, recovery and userdata the normal way, but system.img hangs. Fastboot won't let me use the command listed on the sony site when flashing any of the partitions.
My compiled system.img seems fine and I can view and extract the files so I don't think it's corrupted.
issue '-S 265M' after 'flash'..!!!
SO it should be 'fastboot flash -S 265M system system.img'
And you need to specify memory breakdown for the system image only, as it has a massive size, for the rest skip using '-S 265M'
P.S.: You certainly seem to be new at Android compilation.. I would advice you to try checking other forums first... checking out what works and what doesn't before experimenting! Just saying!
Cheers
Okay so I recognize if I had more money I could pay for home internet. But I don't so I'm here with a budget phone, less than ideal tech skills, and can't seem to figure out how to root.
I've borrowed multiple windows 10 computers all the same result.
I've installed the latest Adb drivers from multiple sources. Re-installed drivers. Uninstalled drivers to no avail
I have my bootloader unlocked. I downloaded the latest firmware. I extracted it and patched the boot.img.
whenever I type fastboot flash boot magisk_patched.img this is the result
writing 'boot'...
FAILED (remote: Failed to write to partition Not Found)
when in fastboot mode i see on my phone
device state: unlocked
boot slot:b
Hoping someone can help Life is frustrating without internet.
Jmcarls20 said:
Okay so I recognize if I had more money I could pay for home internet. But I don't so I'm here with a budget phone, less than ideal tech skills, and can't seem to figure out how to root.
I've borrowed multiple windows 10 computers all the same result.
I've installed the latest Adb drivers from multiple sources. Re-installed drivers. Uninstalled drivers to no avail
I have my bootloader unlocked. I downloaded the latest firmware. I extracted it and patched the boot.img.
whenever I type fastboot flash boot magisk_patched.img this is the result
writing 'boot'...
FAILED (remote: Failed to write to partition Not Found)
when in fastboot mode i see on my phone
device state: unlocked
boot slot:b
Hoping someone can help Life is frustrating without internet.
Click to expand...
Click to collapse
Just a tip, if you're in dire need of a computer, I'd recommend a raspberry pi. It's really handy for your situation. I also don't have home internet and was using purely a Pi for a fair while, it's definitely enough for adb/fastboot stuffs among other things.
Now, onto your issue. Have you tried specifying the boot slot? Normally you shouldn't have to specify the slot but in your case you may have to.
You can try running the command
Code:
fastboot flash boot_b magisk_patched.img
Also, verify that the magisk_patched.img is in the directory you started the terminal/PowerShell window in with the adb executable.
Sent from my Pixel 3a XL using XDA Labs
can you flash anything else in fastboot? or are you only trying to flash the patched magisk image?
I've attached the latest platform tools from Google.
Unzip this folder to the root of your C:/ so it looks like this: C:/adb
Put your magisk_patched.img in the folder then shift+right click anywhere in the folder and "open command prompt here".
With your phone in bootloader mode, at the prompt type: fastboot flash boot magisk_patched.img
I've just done this to check and mine worked first time . Let me know how you get on .
Is the modified magisk file in the same directory as the SDK tools?
I do not recommend that you start using "boot partition" specific commands. You should not have to specify which boot partition to write to. If it's not working that is an indication of a larger issue that needs to be resolved. I've seen plenty of people make things worse when they start using boot partition specific commands.
Wow thank you for the support. I got it to flash by boot_b but then I tried to reboot and the touch screen didn't work so I reflashed the original boot.img and then redid the boot file today and will try it tonight. Will keep everyone posted and will re try other solutions tonight. Going to have to look into raspberry pi to that sounds like a nice project to try