Introduction:
I have found that many people are unaware how to use fastboot, which if you have ever owned an HTC phone or something from the Nexus line you know how important it can be.
About a year ago I got sick of answering questions about fastboot so I made a guide, but it was device specific. Not too bad but I was constantly giving the links to it for other phones... of course more questions just popped up.
So here i am making a comprehensive yet easy to follow (I hope) guide on how to set up and use fastboot. I will cover the basics for Windows and Liunx (sorry Apple users, just cant stand the product/company)
I plan to make a series of guides for XDA-University Thus far there is this guide and:
[Guide] How To Create Recovery Flashable .zips / update.zips
First a short explanation:
Fastboot, like ADB, is a tool to communicate from PC to Android phone. There are times when it is a must to use, and times when it is just helpful.
ADB is used within your recovery or within your OS, but when you are in bootloader mode and need to communicate with your phone then you need fastboot.
And you may ask why would i ever need this?
Well many reasons. Main one is knowledge, learning the ins and outs of fastboot, like learning ADB, can get you out of many jams.
And if you want to unlock your bootloader this is done through fastboot. Granted HTC's unlock is... well crap, but for a Nexus this is how its done.
One other reason I have to stress is learning for safety reasons, This is about the safest way possible to flash firmware to your phone (ie Radio, Hboot, Recovery)
Lastly you may want to know the limitations,
There are many of course, this isnt JTAG, it will not resurrect a hard brick, but it often save peoples phones from 'soft bricks' and lots of time when know how and when to use it.
Think of fastboot as the program that takes over when ADB cant be used, it works with firmware more than software.
So where do i get fastboot? There are a few ways but most often I would recommend getting it from the Android SDK as it is will be up to date.
or you can use THIS HANDY TOOL created by @shimp208
Click to expand...
Click to collapse
Click to expand...
Click to collapse
I will go over the Download and Installation Process in the Next Post
Then i will go over useful commands.
*Just a note, This guide is to always be considered under construction as I plan to continue to make additions such as more commands and pictures
I will continue to attempt to clarifiy when needed and add what I have missed. I have yet to drop any project or guide I have made on XDA and will help where I can
As always I encourage questions I may miss something or be vague, it is best to understand fully then not ask.
Setting up fastboot on Windows and Linux
What is Fastboot?
Fastboot is a protocol designed to flash signed/unsigned partitions to android phones directly into the phones flash memory. If you are familiar with ADB think of it in the same way.
If you're not, just understand it is a tool designed to help flash images such as recoveries, bootloaders, kernels, etc. to your android phone. For the most part you can not use much of fastboot unless you are rooted and have an engineering SPL (Hboot/Bootloader)
If using a Nexus device you in a sense have an engineering bootloader already so don't need to worry about it like HTC folks need. But Some Nexus lines will have different bootloaders with different capabilities.
This however is not a tutorial to root your phone so i will not explain this. I will though go over SOME basics as in unlocking your bootloader to allow it to be rooted.
Click to expand...
Click to collapse
Click to expand...
Click to collapse
How do I get fastboot for Windows?
Fastboot.exe can be downloaded to your computer from Google's SDK found
HERE download the proper package depending on what system you are using.
also
you will need the proper drivers to allow your PC and phone to communicate. You will find these in your devices specific forum or possibly you can use PdaNet
Okay i got it, whats next?
After you downloaded the SDK package to your PC see where it is located, somewhere like this for Windows
C:\android\android-sdk-windows\platform-tools
Click to expand...
Click to collapse
Of course put it where you like, just know where fastboot.exe lies
*If you want to skip the SDK, you can get ADB and Fastboot by themselves with THIS HANDY LITTLE TOOL created by shimp208
Note: After you have ADB and Fastboot you will may want to finish following this guide to add a path in environmental variables.
For Windows:
Although not necessary, but to make it easier i really suggest doing these steps:
left click the Windows (start) button > right click on computer > choose properties > go to advanced system settings > advanced tab > environmental variables > in the first box (user variables for _____) click new > name it
adb
Click to expand...
Click to collapse
> the value is the path from earlier
C:\android\android-sdk-windows\platform-tools
Click to expand...
Click to collapse
(yours may differ from this so double check it!) > in the second box (system variables) find a variable named
path
Click to expand...
Click to collapse
if one doesn't exist make one > double click on it > at the very end of the variable value add the same line as before but with a ; in front of it. like this:
;C:\android\android-sdk-windows\platform-tools
Click to expand...
Click to collapse
alright click ok and you are done!
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Why did I just do all that?
Well this allows you to open a command line from anywhere on your computer without changing directories to use fastboot. Pretty much we told your PC that when you type
fastboot
Click to expand...
Click to collapse
or
adb
Click to expand...
Click to collapse
into CMD where to find it. As you learn how useful fastboot and adb are this will help a lot as CDing to where you want to be is wasted time.
So I still don't know what to do or how to do it!
All right lets start simple, click the windows button and in the search field type
cmd
Click to expand...
Click to collapse
you will notice a window pop up that looks suspiciously like DOS. View attachment 1980110
Here you will see a blinking cursor after your directory, lets try this type
Code:
fastboot
a whole bunch of probably unfamiliar stuff should now pop up View attachment 1386065 (for the most part this is a list of commands that can be used in fastboot) if you get something like
fastboot is not recognized as internal or external command operable program or batch file
Click to expand...
Click to collapse
then we need to troubleshoot, but for now i will assume it worked.
Now try typing
Code:
fastboot devices
...and nothing will happen, Why? because there isn't a device attached. Make sure you have android debugging turned on in your phone (not really needed for fastboot but you do need for ADB), plug it into your computer and boot into fastboot mode. On many phones hold volume down while powering on, if this wont bring you to bootloader mode then see your device specific forum, if needed choose fastboot. Again try typing
Code:
fastboot devices
this time you should have a list of attached devices, this is displayed as the serial number to each. Being many commands will "do" things to your phone try typing
Code:
fastboot reboot
If your phone is now back and running your existing OS, congratulations! :good: You now at least have fastboot set up and working properly. Now lets try a few things out and see why this can be so helpful!
Click to expand...
Click to collapse
How do I get fastboot for Linux?
To get fastboot installed on your Linux box first download appropriate SDK package From Here
*Not all Linux distros are the same and I don't consider myself a Linux guru, I will explain what I know about the few distributions I've used but remember if something don't work look up specifics for yours HERE
After SDK is downloaded extract contents into home folder, maybe in a folder called Android, your choice.
Now we need to make sure we have the latest java JDK installed found HERE or if you prefer you can get it from the terminal
Code:
sudo apt-get update
sudo apt-get install openjdk-6-jdk
or if using Ubuntu, the software center. (I have heard people complain about JDK7 so to be safe stick with JDK 6 for now)
**I have a 64bit machine so I needed the 32bit libraries, you may not need this. If you do run this from terminal
Code:
sudo apt-get install ia32-libs
**As pointed out to me by trevd, if you are using Ubuntu 12.10 or newer you should simply open a terminal and run these two commands
Code:
sudo apt-get install android-tools-fastboot
and
Code:
sudo apt-get install android-tools-fastboot
If you never plan on developing for android or using other tools that come with the SDK
then this should be all you need. And you may also skip the JDK install. As most people will never attempt to create
an app or ROM or mod their phone in a way that they would need more than this, these simple commands should suffice.
Downloading Fastboot
ummm.. isn't that what I just did? Possibly, but as far as I know ADB, fastboot and everything else in platform-tools wont automatically download with the SDK.
Other have told me it does, so feel free to navigate to the platform-tools folder and see if you see these applications.
If you skipped installing the SDK and just installed fastboot and ADB from the command line you can skip down to creating a path. So if you got them, skip this, if you don't, do this:
From in a terminal type
Code:
cd ~/android-sdk-linux/tools
./android
**note depending on what you named the folder the downloaded and extracted SDK is in you may need to change your cd command to something else.
Now a new window will pop up, Click on "Available Packages" and you will be see two boxes. One is Android Repository and the other is Third-party Add-ons.
Click on "Android Repository" then click on Install Selected. now click on "Accept All" and then click on the Install button.
Personally I like downloading all that is possible here, you may have limited space or bandwidth so all you 'need' is the contents of platform-tools.
If you want to download some API's later go for it, they aren't needed unless you are developing.
Adding a Path
Just like in windows changing directories can be brutally annoying so lets add a path. Open a Terminal and type:
Code:
nano ~/.bashrc
or you can use gedit, whatever you have/like to use (sudo gedit ~/.bashrc)
At the end of this text (or at the begining add the following
Code:
Android tools
export PATH=~/android-sdk-linux/platform-tools:~/android-sdk-linux/tools:$PATH
**again be sure this is your path (neat trick, find fastboot from within platform-tools, right click on it, go to properties, highlight the location/path and copy/paste this)
Now click save, this will make so you no longer need to type ./adb all the time
I have been told a reboot is needed here but I don't think so, just type this into a command line:
Code:
source ~/.bashrc
Drivers? I don't need no stinking drivers!
True, sorta, but more than likely we will need to add the android rules so your device can communicate with PC. Open a Terminal and Type
Code:
gksudo gedit /etc/udev/rules.d/51-android.rules
now add the following lines:
Code:
SUBSYSTEM=="usb", ATTRS{idVendor}=="0bb4", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="0502", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="12d1", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="1004", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="22b8", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="04e8", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="0fce", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="0489", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="18d1", SYMLINK+="android_adb", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="04e8", MODE="0666", GROUP="plugdev"
Depending on your device this should be all you need and then some, feel free to check out THIS for the most up to date vendor list.
View attachment 1980099
Now for a test!
So plug your phone into PC via usb, have it in fastboot mode (from within bootloader) and open a new terminal, type:
Code:
fastboot devices
If you see a string of #s and letters then success! :good: you are ready to learn the ins and outs of fastboot!
Click to expand...
Click to collapse
Using Fastboot To Unlock Your Bootloader
Do You need to unlock your bootloader?
For many phones this is necessary to root, for others it is a poor way to root your phone as you may not have full access.
Many HTC model phones can be rooted with various exploits, sometimes removing the radio secure flags completely.
If you have one of these devices than I recommend this, as true radio s-off is far superior to an unlocked bootloader.
But other phones, including the Nexus line, will be fine just unlocking and do not need to worry, Although some phones like the Nexus One can profit from a new bootloader altogether.
To begin the rooting process you simply need to unlock your bootloader with this command from a terminal/CMD
Code:
fastboot oem unlock
and the reverse of course is
Code:
fastboot oem lock
Be prepared for a full wipe of your phone when unlocking the bootloader!
But quickly if you have an HTC and choose to unlock your bootloader to root your phone follow these step:
Select your phone from the list HERE (you will need to create a log in)
there will be some legal mumbojumbo to click through (just saying you void your warranty but you knew this!)
you may need HTC sync found HERE as well as the proper RUU for your phone, the HTCDev site will inform you.
After which the site will move you through the steps to gain fastboot access, but if you followed my guide above just skip it all.
next you will need to get the identifier token, this is unique to your device and really just getting probably voids your warranty,
even if you stopped the guide here. to do so, open terminal/CMD and type
Code:
fastboot oem get_identifier_token
copy and paste this information into the prompt at the bottom of the page. Now wait for an email to get your token....
once you get the email with the token you can now follow their steps to unlock your bootloader...
really if at all possible i recommend not to do this method of rooting. But if you do, follow these same next steps that the Nexus devices will be doing...
Now that your bootloader is unlocked:
We will flash a custom recovery to your phone, then a custom already rooted ROM. To flash the recovery go to your device specific forum HERE and find the developers section.
Look for a custom recovery option and consider reading up on it there.
Different Android phones will have different custom recovery options depending on the developers for it. The most common is ClockworkMod, there are both touch and none touch recovery options.
some others are TWRP, 4EXT, AmonRa and Cannibal. Find out what your options are, pick one and download it.
If possible check the MD5Sum, Windows use: THIS and Linux use a terminal and type
Code:
md5sum <filename>
of course replace <filename> with the file name.
View attachment 1980095
If you prefer, GTK Hash is a nice program as well.
Now this should be an image not a zip, so if the extension is .img your good, if its in a .zip or .jar or whatever extract the image.
Take this image and (for simplistic sake) name it
recovery.img
Click to expand...
Click to collapse
**if using windows be sure to pay attention if your file extensions are hidden, don't name it recovery.img.img!
So be sure your phone is in fastboot mode and connected to PC, open a terminal/cmd in the same location that recovery.img is in
(cd to that directory or windows users can hold shift > right click in the folder it's in > choose open command here)
Code:
fastboot erase recovery
fastboot flash recovery recovery.img
**erase recovery is not necessary but i am OCD about wiping...
now if you get an okay! then your good :good:
Code:
sending 'recovery' (4930 KB)...
OKAY [ 0.521s]
writing 'recovery'...
OKAY [ 0.489s]
finished. total time: 1.10s
If not let me know what the output is and ill help you fix it. (I will also make a troubleshooting section in my final post)
Great! Now Let's Flash a ROM
In that same developers section for your phone, you should pick out a ROM of your licking. If possible i would suggest an older version of CyanogeMod as these builds tend to be quite stable.
Also some phones may have newer ROMs requiring you to do various things to your phone. Such as changing radios or bootloaders or other things we haven't gotten to yet.
So for now try to read the OP of the ROM you like and make sure you meet all requirements.
So Im not going deep into how to flash a ROM from recovery as this is not part of a fastboot guide.
But pretty much just pick a ROM and anything else you may need (gapps, kernel, etc) and put on root of SDcard (no other folder)
Then boot to recovery, wipe all you can (I'll teach you fastboot wiping soon!) and then flash ROM + whatever else you need to and then reboot.
Another Issue With HTC's Unlocked Bootloaders
Well if this not yet another reason to try to gain true radio s-off for your phone...
From with in that ROM that you flashed you also need to unzip and extract the kernel (boot.img) this will need to be flashed through fastboot.
Once all the above steps are completed reboot into fastboot mode, if your recovery doesn't have a quick way to do so just open a terminal/cmd and type:
Code:
adb reboot-bootloader
from here you will need to then open a terminal/cmd in the same location as that boot.img is and type:
Code:
fastboot flash boot boot.img
If it says okay you are finally done!!! Well done with flashing your first ROM but can you flash a ROM in fastboot? I mean do you need recovery at all?
There are ways, and ill teach ya in the next post!
Click to expand...
Click to collapse
Click to expand...
Click to collapse
Flashing a ROM through Fastboot
So Why Do I Need To Do This?
You don't, normally you would flash a ROM through recovery, but why not have another way? Maybe your recovery partition on your phone is corrupt?
Maybe you just want to say "I learned something new!" whatever your reason here are the simple steps:
To start:
We need to download the ROM of choice to your computer. Once complete find the folder that ROM is in and open terminal/cmd to that directory
(quickest way for windows; just hold shift and right click within that folder > open command window here) of course make sure your phone is plugged into computer and in fastboot mode.
Lets see how quick and easy this really is...
In the command line type:
Code:
fastboot devices
Seeing your serial number means we know all is good
Now lets type these commands:
Code:
fastboot erase system -w
fastboot erase boot
fastboot update superawesomerom.zip
Of course replace <superawesomerom.zip> with the correct file name
and last but not least:
Code:
fastboot reboot
*Its been a little while since i did this but the phone might automatically reboot after flash so no need to run the reboot command
As your phone boots into the new ROM, pat yourself on the back...
Click to expand...
Click to collapse
Click to expand...
Click to collapse
A Note on Erasing/Formatting
You may have noticed earlier that I had you erase your recovery before flashing a new one,
now here I had you erase system and boot, you may be wondering why.
I find that a large amount of complaints in developer threads are due to people not properly wiping before a flash.
Of course there is times when a 'dirty' flash is fine, but if you're ever not sure, wipe as cleanly as possible.
fastboot allows for about the cleanest of wipes by the way. And each partition can be done separately too.
Code:
fastboot erase system
fastboot erase data
fastboot erase cache
can all be done individually, but to do these all in one command
Code:
fastboot erase system -w
If possible I recommend to do these steps before flashing a ROM, and now that you know you can do this all within fastboot mode i suggest to try it out, its quick and painless!
Don't forget to wipe your kernel too! (fastboot erase boot)
~Important~ If your device uses an emulated SD card (as in no removable micro SD but an SD partition on phone)
Then be careful wiping data/userdata as this will erase all contents of internal SD - you are forewarned!
Click to expand...
Click to collapse
Click to expand...
Click to collapse
What about just flashing a single partition?
Sure this can be done, hell you can restore a nandroid if you want!
well first you need to make a nandroid back up (unfortunately fastboot cant make a nandroid for you :crying: ) Put it some where on your computer.
Personally I only keep maybe 2 or 3 nandroids on my phone's SD card as why waste space. I do however keep almost all my nandroids on my computer separated into different folders for different phones. So my path to a nandroid backup would be something like:
android/htcg2/nandroids/<nameofnandroid>
Click to expand...
Click to collapse
But here's the catch, most newer recoveries do tar backups I believe TWRP uses .win, these can not be flashed in their current form!
However most older recoveries use yaffs2 format for their backups, these will always work. Pretty much if you get a backup with various partitions as .img you're good to go!
**Hypothetically speaking here: you installed a new recovery and want to flash a nandroid made in old recovery but the two recoveries used different formats...
Well you can flash the images with fastboot, then make a new nandroid and you got them back!
...Maybe I'm stretching... oh well, here's how to!
Now the obvious stuff:
Have phone plugged into PC via USB and in fastboot mode, open terminal/cmd and change directories to that folder where your nandroid is in (or again just hold shift and right click > open command window here if using windows)
Now in terminal/cmd type:
Code:
fastboot devices
all is good when serial number is displayed, now type:
Code:
fastboot erase system -w
fastboot erase boot
*This isn't 100% necessary but I'm a firm believer in wiping before any flash, even a backup
Code:
fastboot flash userdata data.img
fastboot flash system system.img
fastboot flash boot boot.img
fastboot reboot
(of course change the image names if needed)
Click to expand...
Click to collapse
Click to expand...
Click to collapse
And you did it! :good: now you are almost a pro at using fastboot!
keep playing around, you'll get the hang of it and will quickly see that this is one of the best tools in the Android SDK.
It makes things much faster and easier and in many cases safer than the alternatives. Any questions... feel free to ask!
Happy Flashing!
What About Flashing Firmware?
Flashing any firmware to your phone can be dangerous but if possible the best and safest way is with fastboot.
Hypothetically you flash a new Hboot through recovery and this Hboot was corrupt in some way, if the flash takes you will have a bricked phone, hard bricked, only JTAG can bring it back.
But with fastboot you get to input your command to terminal/cmd an see the output, if something goes wrong, just DO NOT REBOOT until you fix the problem.
And again, checking MD5sums is nice when flashing software but a must when flashing firmware.
I will again recommend THIS for windows and using the terminal for Linux
Okay, Time To flash A New Bootloader!
Some phones will not allow bootloader flashes unless you remove the radio secure flags, if you have a phone like this check the developers thread for a how to.
To begin, find the appropriate bootloader (sometimes referred to as an Hboot or SPL) for your phone,
Now download and check MD5sum, have your phone in fastboot mode and open a terminal/cmd in the location your Hboot.img is stored.
Code:
fastboot devices
fastboot flash hboot hboot.img
and of course replace 'hboot.img' with whatever you titled your image
**Do not reboot if you see 'sending.... failed' need to see the 'okay!'
I am not trying to scare you as these instances are so rare, but knowing what to do ahead of time is just common sense.
Not all devices use the same terminology for partitions, so if the above does not work than consider changing to this command:
Code:
fastboot flash bootloader bootloader.img
Again replacing <bootloader.img> with the name of your image
Now flashing a new bootloader will more than likely repartition your phone, so from here you probably should flash a new recovery, then flash a new ROM.
Be prepared to do all this before flashing a new Hboot!
Click to expand...
Click to collapse
Click to expand...
Click to collapse
I'm ready to flash a new radio!
Flashing a radio can also be dangerous, but again the safest way to do so is within fastboot. So if possible always flash radios in fastboot mode!
**I am not referring to the FM radio in your car, rather your cellular Radio, you know where you get reception... don't ask me how to add a FM radio to your phone!
Also know OEMs commonly use baseband and radio as interchangeable terms, for the most part this is the exact same thing
First things first, know why you are flashing a new Radio. Is it because you have poor reception? Poor data speeds? Poor battery life?
Yes a new radio can cure all this, but NO ONE can tell you which radio is best for your phone, not even someone living in the same city.
The best radio for my phone will not for sure be the best for yours, even if you live down the road from me. Don't ask what Radio is best! and only flash a radio meant for your device!
Now that that's out of the way, lets do the same steps as before:
Download appropriate radio
Extract if needed (should be in .img format)
For simplistic sake name it 'radio.img'
Plug in phone to PC and open a terminal/cmd in the same location as your radio.img
Code:
fastboot devices
fastboot flash radio radio.img
fastboot reboot-bootloader
Again only reboot if all goes well (It will if you follow all direction)
Upon rebooting your bootloader you will notice your radio version has changed, congrats! You're becoming a pro!
*note, occasionally OEMs package another image called rcdata.img along with a firmware release, if they do I also recommend to flash this along with the radio
Code:
fastboot flash rcdata rcdata.img
**another note, if possible try to match the ril libraries between your ROM and radio, this is device specific and you will need to see your developers thread for this info.
It is not always possible or necessary to do so, but many do say it help quite a lot
Click to expand...
Click to collapse
Click to expand...
Click to collapse
Flashing a Kernel
Earlier I went over flashing kernels as part of HTC Unlocked Bootloader Flashing, the process is the same for anyone else as well.
Locate the Kernel you want to flash
navigate to the folder it is in (should be in .img format and lets name it boot.img)
Code:
fastboot flash boot boot.img
But lets say you are a developer and have worked on a new kernel for your device, a quick and easy way to test it out may be to fastboot load the kernel:
Code:
fastboot erase boot
fastboot boot kernel ramdisk
As usual replace file/image names accordingly
If you do not want to erase the current kernel, just skip erasing.
But I would just have a working kernel.img handy and erase, this way I know there are no residual effects from previous kernel - choice is yours
Code:
fastboot flash:raw boot kernel ramdisk
fastboot reboot
Test it out and see how things go! Good luck! :good:
Click to expand...
Click to collapse
Click to expand...
Click to collapse
As always, if you have questions or comments feel free to leave them here!
Happy Flashing!
What Are Some Other Things That Fastboot Can Do?
A Whole lot really... This guide would be forever long going through all of this. But I'm trying to progressively go through as many options as I can in order from simple to complicated.
I mainly am making this guide for beginners but I want the Advanced Android user to learn something too! Hope we can all learn from each other!
RUUs or HTC's ROM Utility Updates
This can be a way of returning to stock or updating to an official OEM update.
To do this make sure your bootloader is locked
(as far as I know RUU's fail if unlocked, but depending on phone engineering SPLs or having radio s-off can be safe - but not always so check device forum)
So boot into fastboot mode, open cmd/terminal in location of RUU then
If needed:
Code:
fastboot oem lock
then to get into RUU mode
Code:
fastboot oem rebootRUU
Then you will flash the zip, change command to correspond to proper name
Code:
fastboot flash zip rom.zip
If it gets stuck and you see a message like flush immediately! just do the above command again, often first try fails for some reason
Always know if you need to or should be flashing an RUU, some people do more damage to their phone just because they thought they were bricked and tried 'everything'
And if you're looking for OTA's (over the air updates) or RUU's for your phone HERE is a great source!
Click to expand...
Click to collapse
Click to expand...
Click to collapse
Some Useful Information About Your Phone
Lets say you want something basic like your device's model number, type:
Code:
fastboot getvar mid
the return output is your model number. Some phones are locked into only allowing new versions of an OS to be flashed, to check yours type:
Code:
fastboot getvar cid
cid: 11111111
Click to expand...
Click to collapse
If your return value looks like this then you have superCID, meaning you are allowed to flash older and newer versions of Android OS. And depending on phone you can just use this command:
Code:
fastboot oem changeCid
or possibly a common cid (SuperCID)
Code:
fastboot writecid 11111111
If you want to get a bunch of info quickly try this:
Code:
fastboot getvar all
Here you will receive an output of much of your devices specifics, such as bootloader and radio versions, devices name and if its locked, IMEI # and so on.
Click to expand...
Click to collapse
Click to expand...
Click to collapse
What about trouble shooting?
There have been various devices over the years which have used inferior parts. like the HTC DZ/G2 or Glacier.
These phones, like some others, had two different emmc's installed; one worked great and one was prone to failure.
I found the easiest way to check which emmc was in the phone was with a few fastboot commands:
Code:
fastboot oem list_partition_emmc
fastboot oem check_emmc
fastboot oem check_emmc_mid
Of course this couldn't prevent a phone from the mysterious random hard brick, but it could tell you if your hardware was prone to failure or not.
There are also a serious of tests that can be performed depending on the bootloader you have installed:
Code:
fastboot oem list_partition all
fastboot oem partition_test all
Both of these commands you can substitute 'all' for 'system' 'cache' or whatever if you just need info or test a single partition.
You may have noticed that some of these commands require knowledge of hex editing, which of course no one is good at but the info is there if you want to search for it! So here is some more!
Code:
fastboot oem heaptable
fastboot oem imgcrc
The second command here will run a checksum for your hboot, recovery, boot, and system partitions.
I find it helpful to know the value of what the should be when phone is working good and can use this against another checksum if i have issues down the road.
System and boot will change of course, but recovery and hboot wont unless i flash a new recovery or bootloader, this can help check for bad blocks.
Speaking of bad blocks, lets look for some:
Code:
fastboot oem rbchk
Now having some bad blocks in your nand is not always going to cause your phone to be unusable, sometimes its a partition thing too.
Some of these commands don't do anything...
True, various devices and bootloaders will allow for various fastboot commands. two tests you can do to see what yours supports
fastboot
Click to expand...
Click to collapse
or
fastboot oem ?
Click to expand...
Click to collapse
typing just this into a terminal/cmd will give you an output of available commands for your device. I hope to add a bunch more soon but i need to finish my papers and studying for finals!
Click to expand...
Click to collapse
Click to expand...
Click to collapse
A Bit More Helpful Tips For Booting
Sometimes you may have issues booting, earlier we went over booting a kernel you made yourself as well as flashing a kernel
What about just booting a kernel without flashing it to your device?
Code:
fastboot boot boot.img
The above, when executed properly, will boot a kernel from pc on your phone without flashing directly. There are times we need to force boot or just test.
What may be even handier is to boot a recovery without flashing it, this is done in the same manner as above and can let you use a recovery on your device without installing it.
Plug phone into PC, connect with USB cable and have phone in fastboot mode, now open CMD/Terminal in the same directory as your recovery image
Code:
fastboot boot recovery.img
Of course name image correctly to fit command or vise versa
Now you are in recovery of choice within your device without it being flashed to your recovery partition. There is a time and a place for everything, can you think of ways this may help you? Sure you can!
Click to expand...
Click to collapse
Click to expand...
Click to collapse
as always... Happy Flashing!
Is There Anything Fun I can Do With Fastboot?
How would you like to go from this:
to this to this to this to this
Or really just about anything you want?
Click to expand...
Click to collapse
Click to expand...
Click to collapse
Of course I'm referring to the splash screen, the one that appears when you first boot your device, before the bootanimation.
This is a static image put there by the OEMs and often is real boring. True some phones have some neat ones, others little gifs, but really why not change it if we can?
Well in order to do this we need to know where our device in question stores the splash screen. If it has its own partition, your rooted, and your bootloader has fastboot capabilities we are good to go!
...well almost, remember when i talked about s-off earlier? This is low level firmware stuff, at least the way many device see it. Having root access doesn't mean we can do anything unfortunately.
I would suggest checking your phones forum to see if anyone know specifics to your device and where this partition is stored, if you need help other than from this guide feel free to post and ill see what i can do!
Ok, so I'll use HTC as an example here, we are rooted, we have an engineering bootloader, and security flags are removed. Now we need to find partition location.
Code:
mmcblk1p2 - "sd-ext"
mmcblk1p1 - "sdcard"
mmcblk0p31 - "misc"
mmcblk0p29 - "pdata"
mmcblk0p27 - "devlog"
mmcblk0p26 - "modem_st2"
mmcblk0p25 - "modem_st1"
mmcblk0p24 - "cache"
mmcblk0p23 - "userdata"
mmcblk0p22 - "system"
mmcblk0p21 - "recovery"
mmcblk0p20 - "boot"
mmcblk0p19 - "adsp"
mmcblk0p18 - "radio_config"
mmcblk0p17 - "radio"
mmcblk0p16 - "misc"
mmcblk0p14 - "splash1"
mmcblk0p12 - "bootloader" hboot
So this device keeps the splash screen in mmcblk0p14, this is very important to know and will change with most devices.
We will know extract original splash before we change it. Again I cant stress how important it is to know what you're doing when using dd commands!
So open a terminal/cmd
Code:
adb shell
su
dd if=/dev/block/mmcblk0p14 of=/mnt/sdcard/splash.img
This will now pull the original splash and place it on your sd card named splash.img
***remember the above command differs for every phone!!
Now that we have this, keep a copy somewhere just in case.
You can now use a tool like FFmpeg to extract the image, use gimp to make a new one, and follow this simple guide if your confused. Or ask here and I can help.
Click to expand...
Click to collapse
Click to expand...
Click to collapse
You may have noticed none of the above used fastboot... huh, and here this is a fastboot guide!
Ok we'll just say you have a new splash image all ready and you want to flash it, but how? In the case of this phone fastboot is the way to go
Code:
fastboot flash splash1 splash.img
fastboot reboot
And done! :good: way to easy I know, put you're a pro at fastboot now so what did you expect!
Click to expand...
Click to collapse
Click to expand...
Click to collapse
And for future reference you can use dd commands to flash to your phone as well, but the don't call the "disk destroyers" for nothing!
Also its possible to flash in recovery, to the best of my knowledge I'm the only one to create flashable .zips for this (not bragging just saying I'd like to see more)
HERE Is an Aroma flashabe I made for the HTC Doubleshot
HERE Is an Aroma flashable I made for the HTC Vision
Both recovery flashable.zips allow the user to flash one of many custom splash screens and bootanimations with the easy UI Aroma brings
It is not as safe as fastboot, but I have never seen an issue when the code is done right.
I plan to make more for other phones as I have time, want one for your phone? Go through my scripts, feel free to copy and paste, I need no credit, just glad to see more people with more options!
If you need help making them, again just ask. I prefer in this thread over pm though as my inbox fills to quick...
Click to expand...
Click to collapse
Click to expand...
Click to collapse
Old stuff... in the process of editing to make things more clear....
Come one, like the previous stuff isn't fun!
Well many aren't aware that they can change the splash screen on their phone or tablet, this is just another partition most often like system, or cache.
Yes some phones will have it built into params or locked elsewhere in the firmware but often fastboot is a simple way of flashing a new splash screen.
To find out a list of your device's partitions i would advise to check you sites development thread here in XDA. But we can quickly do it as well with some simple ADB commands.
This guide does not go over ADB and for a better understanding search out one of many guides in XDA and elsewhere. (I am considering making one here as i have yet to see a comprehensive yet easy to follow guide)
Having said this, here are a few things you need to know. If you followed this guide and have fastboot working, ADB should also work just fine.
Know that fastboot is to be used in bootloader mode and ADB is used when booted into the OS or in most recoveries.
So now boot to your OS, make sure debugging is turned on, android 2.x and older this is found under settings>applications. 4.x and up it will be under developer options in settings.
Now connect your PC and phone via USB (wireless options are also a possibility here) You should notice a symbol in your status bar confirming debugging is on. (unless disabled) open a terminal/CMD and type:
Code:
adb devices
If you see your serial number lets proceed, if not post in this thread and i'll help.
Code:
adb shell
cat /proc/partitions
This will list all your partitions and their size, but this wont give you what each partition stores. There are different ways to do this for different devices, so you may need to try a few commands
Code:
ls -l /dev/block
ls -l /dev/block/platform/sdhci-tegra.3/by-name
the last command is for a device with a tegra 3 processor, of course will only work if yours has one (you may need to type 'su' to get commands to work)
you can also try:
Code:
df
busybox df -hm
Really all this isn't 100% necessary as someone probably found this out for you already. If not we just need to know the location and proper size of the image to flash.
I will help further if requested but as of know I'm going to assume we have this.
Alright lets flash the new splash screen already!
So we have a new image in .img format and it is the proper size. we will name it splash.img And as most phones that allow flashing a new splash we will call the partition its it splash1
**If your phone is different than whats listed here commands may very or not be allowed without changing bootloaders.
Back in fastboot mode, plug in phone... the usual
Code:
fastboot flash splash1 splash.img
fastboot reboot
Now that initial boot screen (before animation is replaced!) congrats!
**As you can see this section is poorly written, it is hard to universally apply a command to all phones as this command differs between them.
There are dd commands to flash just about anything, including splash screens, but dd commands can be dangerous and I would not recommend them to anyone who doesn't fully understand what they are doing.
Feel free to post with any questions!
Troubleshooting and FAQs
Some Common Questions and Answers
Q: When I open terminal/cmd and type fastboot devices i just get a blank line...
A: Well there are a number of reasons why this could happen, but here are the things you should check:
*Is the device powered on in fastboot mode?
*Is the USB cable in good shape (not a junky .99 cable)
*Do you have the proper drivers installed (Windows) Android Rules (Linux)?
*Do you have fastboot.exe on PC?
*Have you set up a path in environmental variables (Windows) or the path in .bashrc (Linux)?
****If not then what if you open the terminal/cmd in the location of adb/fastboot?
Click to expand...
Click to collapse
Click to expand...
Click to collapse
Q: When I type in command fastboot <whatever command> I get < waiting for device >
A: Then you are either not in fastboot mode on phone, bad connection to PC, missing drivers (or android rules) - fastboot is installed and working just your devices isn't communicating
Click to expand...
Click to collapse
Click to expand...
Click to collapse
Q: When I type in command fastboot <whatever command> an error message like
Code:
...
(bootloader) [ERR] Command error !!!
OKAY [ 0.016s]
finished. total time: 0.016s
A: This means the fastboot command you are trying to use isn't supported by your current bootloader, to find the list of commands available to you type in one of these two commands:
Code:
fastboot
fastboot oem ?
Q: When I type in a command to flash <XXX> it starts to work but then I get this error:
FAILED (remote: Download size too large) finished. total time: 0.002s
A: Chances are this is not the proper image for your device or your are trying to flash to the wrong partition, double check that this is the correct .img (md5sums help)
Click to expand...
Click to collapse
Click to expand...
Click to collapse
Q: When I tried to flash <XXX> I keep getting this error
Code:
sending 'recovery' (3518 KB)... OKAY
writing 'recovery'... INFOsignature checking...
FAILED (remote: signature verify fail)
A: This is because you don't have the proper permissions, you are trying to flash an unsigned image to a write protected partition. You will need to unlock bootloader or flash and engineering SPL, or find an OEM image.
This error is very device specific in the sense that I would need to know more about what you are trying to flash and what bootloader you have to answer properly
Click to expand...
Click to collapse
Click to expand...
Click to collapse
Q: When I tried to flash <XXX> or fastboot boot <XXX> I keep getting this error
Code:
downloading 'whatever here'....
FAILED (status malformed (1 bytes))
finished. total time: 0.000s
A: This is often because of a few things:
first, make sure you have a high quality USB cable, and USB port is good. Just because the cable works for charging does not mean it is a good cable.
second way I've seen this issue, user is in bootloader mode but not fastboot mode. yes I often say this is one in the same, but double check, some devices specifically have a fastboot mode within bootloader!
Click to expand...
Click to collapse
Click to expand...
Click to collapse
*Note I have found many errors are due to not running fastboot with elevated privileges, try running fastboot as administrator (Windows) or su/sudo (Linux)
As people post errors or questions I will try to add more Q&As
Happy Flashing!
Nice Guide
Hi There
Nice guide there, good to see some of the more advanced stuff like booting over usb covered :good:
Couple of things
Fairly sure you don't need java or ia32-libs to run fastboot on linux but I suppose it doesn't hurt to install it . Also if you're running the last 2 version ubuntu , 12.10 or 13.04 ( or any ubuntu flavoured Linux ) then fastboot can be installed through apt.
Code:
sudo apt-get install android-tools-fastboot
adb is in there as well
Code:
sudo apt-get install android-tools-adb
EDIT: Also you don't have to do the erase command before doing the boot command as you can use it just to boot a kernel on it's own which would be very difficult if you just used erase to erase the ramdisk, the following are both valid
Code:
fastboot boot kernel
fastboot boot kernel ramdisk.img
Thanks
Thanks for the reply!
I'll be sure to add that in, I read a bit about this but I've just used old fashion install on all my Linux distros I've used. I'll be sure to add as many new Linux user choose ubuntu and apt get is just way easier.
I haven't had a chance to edit through everything yet, last day of finals were today and I needed some study breaks, hence a quickly written guide. I have lots more to add, and looking over some of my write up I'm far from clear on some pieces.
So yeah any input is much appreciated and I'll be cleaning this up soon!
Sent from my Nexus 7 using xda premium
thank you!
good man.
demkantor said:
what is fastboot?
Click to expand...
Click to collapse
can i use fastboot to flash firmware onto my phone and bypass getprop("ro.product.name") in the updater-script? or somehow flash an unsigned update.zip?
edit: thanks for this great guide, if you could just tell me which bits of the guide you think would be relevant to me that would be awesome. i just don't want to do something off my own bat and then it be absolutely redundant.
sure, fastboot should bypass the ro.product.name (but this is also easy to take out of the updater-script) and it allows to flash unsigned zips as well.
maybe explain to me in a little more detail what you want to accomplish and I could help you do it.
The reason i ask is that flashing firmware is very dangerous and flashing the wrong firmware can easily give you a brick. If all security flasgs are removed on your device you can flash whatever you want in fastboot (for the most part) but that wont mean you should. Let me know what it is you want to flash and hopefully i can tell you if it is safe to do or not.
demkantor said:
sure, fastboot should bypass the ro.product.name (but this is also easy to take out of the updater-script) and it allows to flash unsigned zips as well.
maybe explain to me in a little more detail what you want to accomplish and I could help you do it.
The reason i ask is that flashing firmware is very dangerous and flashing the wrong firmware can easily give you a brick. If all security flasgs are removed on your device you can flash whatever you want in fastboot (for the most part) but that wont mean you should. Let me know what it is you want to flash and hopefully i can tell you if it is safe to do or not.
Click to expand...
Click to collapse
I want to update my KIS LITE (v790 with 256mb ram) with a KIS LITE firmware from ZTE website. It's for a different country/telco, the product names match but the one in the update has productname_telco instead of the stock productname on my phone which i bought directly from china. I'm pretty sure it's all compatible, i have a rooted phone, and i changed the build.prop to match productname_telco but it still errors out updating in recovery at the product name check. (weird???) if i change the zip which is quite easy, it's unsigned and won't update. i'm trying to update specifically to "Greece KIS LITE SD card upgrading instruction & software package(Cosmote)-213550B0197ZTE Kis LiteV1.0.0B01\update.zip"
@knifey_au
ok so I downloaded and took a look at the file you want to flash
Code:
assert(getprop("ro.product.device") == "roamer2" ||
getprop("ro.build.product") == "roamer2");
assert(getprop("ro.product.name") == "P752D01_Cosmote_GR");
these are the three lines that need to be the same in build prop, but in truth if you havent a custom recovery than it may still see your product info in your recovery as you have the stock kernel=stock recovery
and these are all the lines in the new build.prop you are trying to flash
Code:
# begin build properties
# autogenerated by buildinfo.sh
ro.build.id=GRK39F
ro.build.display.id=ZTE Kis LiteV1.0.0B01
ro.build.version.incremental=20130427.041932.31486
ro.build.version.sdk=10
ro.build.version.codename=REL
ro.build.version.release=2.3.6
ro.build.date=Sat Apr 27 04:30:41 CST 2013
ro.build.date.utc=1367008241
ro.build.type=user
ro.build.user=
ro.build.host=zte
ro.build.tags=release-keys
ro.product.model=ZTE Kis Lite
ro.product.brand=ZTE
ro.product.name=P752D01_Cosmote_GR
ro.product.device=roamer2
ro.product.board=roamer2
ro.product.cpu.abi=armeabi-v7a
ro.product.cpu.abi2=armeabi
ro.product.manufacturer=ZTE
ro.product.locale.language=el
ro.product.locale.region=GR
ro.wifi.channels=
ro.board.platform=msm7k
# ro.build.product is obsolete; use ro.product.device
ro.build.product=roamer2
# Do not try to parse ro.build.description or .fingerprint
ro.build.description=P752D01_Cosmote_GR-user 2.3.6 GRK39F 20130427.041932.31486 release-keys
ro.build.fingerprint=ZTE/P752D01_Cosmote_GR/roamer2:2.3.6/GRK39F/20130427.041932.31486:user/release-keys
# end build properties
#
# system.prop for surf
#
rild.libpath=/system/lib/libril-qc-1.so
rild.libargs=-d /dev/smd0
persist.rild.nitz_plmn=
persist.rild.nitz_long_ons_0=
persist.rild.nitz_long_ons_1=
persist.rild.nitz_long_ons_2=
persist.rild.nitz_long_ons_3=
persist.rild.nitz_short_ons_0=
persist.rild.nitz_short_ons_1=
persist.rild.nitz_short_ons_2=
persist.rild.nitz_short_ons_3=
ril.subscription.types=NV,RUIM
DEVICE_PROVISIONED=1
debug.sf.hw=1
debug.composition.7x27A.type=mdp
debug.composition.7x25A.type=mdp
dalvik.vm.heapsize=40m
#
# system props for the cne module
#
persist.cne.UseCne=none
persist.cne.bat.range.low.med=30
persist.cne.bat.range.med.high=60
persist.cne.loc.policy.op=/system/etc/OperatorPolicy.xml
persist.cne.loc.policy.user=/system/etc/UserPolicy.xml
persist.cne.bwbased.rat.sel=false
persist.cne.snsr.based.rat.mgt=false
persist.cne.bat.based.rat.mgt=false
persist.cne.rat.acq.time.out=30000
persist.cne.rat.acq.retry.tout=0
persist.cne.fmc.mode=false
persist.cne.fmc.init.time.out=30
persist.cne.fmc.comm.time.out=130
persist.cne.fmc.retry=false
#
# system props for the MM modules
#
media.stagefright.enable-player=true
media.stagefright.enable-meta=false
media.stagefright.enable-scan=true
media.stagefright.enable-http=true
media.stagefright.enable-fma2dp=true
media.stagefright.enable-aac=true
media.stagefright.enable-qcp=true
#
# system prop for opengles version
#
ro.opengles.version=131072
#
# system props for the data modules
#
ro.use_data_netmgrd=true
persist.data.ds_fmc_app.mode=0
#
# system props for IMS module
#
persist.ims.regmanager.mode=0
#
# system prop for requesting Master role in incoming Bluetooth connection.
#
ro.bluetooth.request.master=true
#
# system prop for Bluetooth FTP profile
#
ro.qualcomm.bluetooth.ftp=false
#
# system prop for Bluetooth SAP profile
#
ro.qualcomm.bluetooth.sap=false
#
# system prop for Bluetooth Auto connect for remote initated connections
#
ro.bluetooth.remote.autoconnect=true
#
#system property for Bluetooth discoverability timeout in seconds
#0: Always discoverable
debug.bt.discoverable_time=0
#
# System prop to enable/disable OMH. Enabled by default
#
persist.omh.enabled=1
#System prop to enable ehrpd capability
ro.config.ehrpd=true
# System property for cabl
ro.qualcomm.cabl=1
#
#System prop to determine availability of
#analog fm path
#
ro.fm.analogpath.supported=true
#
#System property for FM transmitter
#
ro.fm.transmitter=false
#
#System property for single instance recording
#
ro.fm.mulinst.recording.support=false
#
#System property for msm
#
ro.hw_plat=7x27a
#
#System property for Power Saving
#
persist.radio.add_power_save=1
#
# ADDITIONAL_BUILD_PROPERTIES
#
ro.com.google.clientidbase=android-zte
ro.com.google.clientidbase.yt=android-zte
ro.com.google.clientidbase.am=android-tmobile-{country}
ro.com.google.clientidbase.ms=android-tmobile-{country}
ro.com.google.clientidbase.gmm=android-zte
ro.build.baseband_version=P752D01_Cosmote_GRB01
ro.build.sw_internal_version=COS_GR_P752D01V1.0.0B01
ro.build.baseband_version=P752D01_EUROPEB01
ro.build.sw_internal_version=P752D01_EUROPEV1.0.0B07
ro.build.baseband_version=P752D03B01
ro.build.software_version=GENERIC_P752D03V1.0.0B01
ro.build.sw_internal_version=GENERIC_P752D03V1.0.0B01
ro.camera.intrplt.2mpto3mp=true
ro.build.baseband_version=V766B01
ro.build.software_version=GB_P752A10V0.0.0B01
ro.build.sw_internal_version=GB_P752A10V0.0.0B01
ro.config.ringtone=COSMOTE_1_BACKRINGTONE_A_2.mp3
ro.config.notification_sound=F1_New_SMS.ogg
persist.sys.timezone=Europe/Athens
ro.config.notification_sound=OnTheHunt.ogg
ro.config.alarm_alert=Alarm_Classic.ogg
ro.setupwizard.mode=OPTIONAL
ro.com.google.gmsversion=2.3_r11
persist.sys.usb.enable_switch=1
persist.sys.usb.linux_switch=1
persist.sys.usb.switch_pid=0x1351
persist.sys.usb.linux_pid=0x1351
persist.sys.usb.default.pid=0x83
ro.com.google.clientidbase=android-zte
ro.com.google.clientidbase.yt=android-zte
ro.com.google.clientidbase.am=android-zte
ro.com.google.clientidbase.ms=android-zte
ro.com.google.clientidbase.gmm=android-zte
ro.camera.intrplt.2mpto3mp=true
net.bt.name=Android
dalvik.vm.stack-trace-file=/data/anr/traces.txt
not sure what your current android version is but this one is 2.3.6 and should be fairly easy to build a custom recovery for your phone allowing you to flash nonstock .zips
just follow clockwork or twrp guide on how to create your own
and there is no firmware in this package, just kernel, ROM, and recovery so it should be safe enough to flash as long as you have a backup of original.
best of luck!
i downloaded so many new updates trying to get one to flash that i actually forgot to check the version. i'm trying to upgrade from 2.3.6. now i feel dumb. i'll try and find the right update and actually check the version number this time. *facepalm. i'll get back to you.
knifey_au said:
i downloaded so many new updates trying to get one to flash that i actually forgot to check the version. i'm trying to upgrade from 2.3.6. now i feel dumb. i'll try and find the right update and actually check the version number this time. *facepalm. i'll get back to you.
Click to expand...
Click to collapse
how do i get to the version number in the update.zip? Never mind i got it.
All the KIS lite downloads from ZTE are 2.3.6. Which is a pitty, since the 512mb version of the v790 is supposed to have ICS and go a lot faster with it. nfi if ram is the only thing they changed though so i'm not going to try and install KIS firmware on KIS lite when I don't know if it will bork things up. Unless you want to look at the phillipenes download for the v790 from ZTE website and tell me if you think it will work for the kis lite.
Hate to say it but it will doubtfully work without a lot of modifications, as handy as fastboot is it won't help with this.
Unfortunately if your phone doesn't have any custom ICS ROMs your best bet in getting one is to create a devices tree and then make it yourself. Simply flashing it from another device will probably leave you in a boot loop at the least and possibly a brick
Sent from my Nexus 4 using xda premium
Would you mind if I linked this thread in my signature?
russellvone said:
Would you mind if I linked this thread in my signature?
Click to expand...
Click to collapse
Of course not! Feel free to share this thread with whomever you choose, my goal is to help anyone and everyone. Now if I could just finish adding all I plan to...
Sent from my Nexus 4 using xda premium
Related
The purpose of this document is to clarify a few basics about HTC Android Phones and basic commands to interface with the phones. Think of this as a beginner's guides to the Android device from a non-traditional user's point of view. I'll keep it simple and plain as much as I can for the new users. I'll also try to keep all the technical aspects true as much as I can while keeping it simple.
Before you go on, please read this and understand the basic concepts and how and why following commands are being used. Do not follow anyone's instructions/tutorials/guides without prior basic understanding of what each command do. I do want to believe it's humans visiting this forum and not lemmings. If you do not understand, feel free to ask here. I will or someone else also knowledgeable will answer your questions. DO NOT QUOTE THIS AS A WHOLE. My pet peeves and a complete waste of screen space.
Sometime, depending on your OS, command names may change (e.g: mouse / mouse.exe / mouse-linux / mouse-mac). For general purpose, we'll use mouse instead of an OS specific commands in this instructions.
So to repeat myself, if you understood the concepts of the commands, and you are on a linux system and someone's guide says touch index.php, you will automatically type touch-linux or whatever the name of your executable is on your system.
We shall assume you know how to install needed drivers and where to get android sdk and put the sdk binaries (executables) in the system path. If we need to expend this let me know and I'll expend this here.
Further, if I get any parts wrong, PM me and I'll get those parts corrected.
Android Partition, SPL etc.
Partitions:
Followings are a list of partitions on your android phone.
misc - misc partition -
recovery - Recovery Partition - This is where the original HTC recovery or Amon Ra's recovery or any other Recovery would go. Basically if you reboot into recovery it'll boot from here.
boot - This is your boot partition
system - This is where all your system information (ROM resides)
cache - cache (When you factory reset the phone, this area is wiped)
userdata - user data (like your login, your user settings etc) When you factory reset the phone, this area is wiped)
So, if you replace the recovery image, you are pretty much set for updates provided here at XDA. Note: By replacing your recovery image, you may not be able to have OTA updates.
ROM images will normally replace boot and system images at the same time and often time, userdata and cache too; reseting the phone completely.
SPL/Bootloader/Radio/Bricking Phones:
SPL / Bootloader is like BIOS on a computer. At least I think of it that way. SPL can be updated! SPL comes as either Security-On of Security-Off (S-ON/S-OFF).
Note: It is my understanding that radio will boot first, followed by other systems. So it is IMPORTANT that your radio image/version will work with your SPL image/version. This is the one and only reason for phones being bricked. You can not brick your phone by flashing a ROM or Boot image or recovery image. Once you flash the wrong radio for the SPL, the only known method of recovery is to send the phone back into HTC for repair.
How do I know the phone is bricked? A bricked phone can not boot into bootloader, recovery, or into normal operation modes. You can not connect to a bricked phone via adb or fastboot. You can only see one screen on the phone and it will be the first splash screen.
Commands:
adb - Android Debug Bridge - One of the two things you'll need to know if you ever want to do anything non-conventional on your android based phone.
List of commands that can be used by adb can be prompted by typing adb at the system shell (command prompt or terminal)
Notable adb commands:
adb devices - If you don't know anything, this is the ONE thing you have to know.
adb devices will give you a list of devices connected to the computer. This is also a good way to make sure that your phone is actually connected to the computer.
adb reboot (bootloader|recovery)
adb reboot - this will reboot your phone normally.
adb reboot bootloader - this will reboot your phone back into the bootloader (white screen with the android on wheels)
adb reboot recovery - this will reboot your phone back into recovery console (either default or amon_ra's recovery).
adb shell - this will shell into the phone and you can now explore the phone. Remember phone's native backend os is linux so know your linux commands.
adb remount - remounts the system partition on the phone so you can you read/write to it.
adb push xxx yyy - will push xxx file from computer into yyy location/file on phone (needs rooted access)
adb pull xxx yyy - will pull xxx file from phone into yyy location/file on computer (needs rooted access)
Fastboot is protocol used to update the flash filesystem in Android devices from a host over USB. It allows flashing of unsigned partition images.
Notable fastboot commands:
fastboot devices - If you don't know anything, this is the ONE thing you have to know.
fastboot devices will give you a list of devices connected to the computer. This is also a good way to make sure that your phone is actually connected to the computer.
fastboot reboot - this will reboot your phone normally
fastboot oem unlock - this will unlock your bootloader - NOTE THIS WILL VOID YOUR NEXUS ONE WARRANTY
fastboot erase XXX - Will erase the partition XXX (such as userdata, cache) - mainly used for resetting phone and clearing userdata / factory settings.
fastboot flash XXX YYY - This will flash XXX partitionn with YYY image.
e.g: fastboot flash system system_update.img will flash/update your system partition with an image called system_update
If anyone needs me to dig deep into using anything else, please PM me. I'll add it on here. Hopefully this will help all newbies about the basic commands and what they do.
FAQs (UPDATED Feb 09, 2010)
Q: One question about the Android SDK. Do I need it to flash my N1 or just to program new apps? Where can I get it?
A: Android SDK is not entirely needed to flash the N1. However, there are tools in there that you need. Adb / Fastboot etc. Although they can be downloaded by themselves, the windows version of the SDK also have the Drivers that are needed for android devices for USB connection. So, it is recommended to get it. You can get it from developer.android.com
Q:I have never experienced anything like this when I did a hard-spl on my winmo phone. Radio versions are included with SPL's, right?
A: Official packages from HTC did come with nbh packaging, meaning it is a all in one upgrader that will update Radio, ROM, System etc, it is very much common for active development area here at XDA to get the radio or SPL or ROM separately and independently of one another. And as such, you will most likely flash them seperately (who wants to wait 6-8 months). Also, since this phone is released by google, HTC will most likely not update any major Radios. However, it is very likely that we will be hacking in Radio updates or any other "updates" from HTC from their new device - HTC Bravo.
Q: Is there a guide for snow leopard? I'm kind of stuck.
A: I personally ran android SDK and aforementioned executable on both MAC OS 10.5 and 10.6. Like I posted, the commands and the executable names may be slightly different. I may call adb and you may find it as adb-mac. I am not going to write 3 separate documents for 3 separate OSes. You have to know that adb=adb-mac (on your mac), adb-linux (for linux) etc. And yes the above guide will work universally.
Q: Can i replace the splash image..?? (unlocking related)
A: As of the above date (next to the FAQ) no you can not. Issue is probably a few folds. One of them is that splash1.img is not going in due to security lock. Remember, you unlocked the phone. HTC will not like it. Anyhow, I like the current quad color X. If you are thinking of getting rid of the lock logo, good luck. Even if you can get rid of it, you will still have to overcome the pink text that says ***UNLOCKED*** on your bootloader.
Q: Can you run Windows Mobile on Android Phones?
A: With enough resources given, sure. Will it ever happen? No. Why? Windows mobile compiler and builder cost $. As a matter of fact, as of version 5, it was going to cost me $75 per device. That's one of the reasons why handset makers went to Android open platform. Android is free and universal so as long as you use certain chipsets and certain items, you are good to go. Can it ever be ported? Sure. With right amount of time and money anything can be done. But at this point, it's cheaper for you to go buy a windows mobile smartphone.
Q: How do I know the phone is bricked?
A: You can not brick a phone unless you are flashing Radio/SPL packages. Make sure if you are doing that, you follow directions VERY CAREFULLY. A bricked phone can not boot into bootloader, recovery, or into normal operation modes. You can not connect to a bricked phone via adb or fastboot. You can only see one screen on the phone and it will be the first splash screen.
Q: I have installed the Android SDK however, i cannot seem to get the laptop to detect the nexus. What have i left out?
A: Most common item that people forget to enable is USB Debugging. Settings => Applications => Development => USB debugging [checked]
Q: I have rooted n1. when I go to recovery to do backup, I get the triangle with the little green android guy, but phone is stuck there. I have to remove battery to reboot phone. What have I done wrong?
A: You still have the stock (shipping) recovery. If you want a different recovery (Amon RA's), download it, the from fastboot, run fastboot flash recovery downloaded_recovery.img
Q: Which step of the rooting / recovery procedure does it give root?
A: Root and Recovery are two totally different things. Recovery is a partition that contain recovery information. Stock recovery is what allows OTA updates etc. Normally it will search for update.zip in the root folder of the SD card. Amon_RA's Recovery or any other recovery images are there to enhance the traditional stock recovery. Amon Ra's Recovery for example, contains thing such as ability to update from different zip files, and backup/restore of your data/system.
Rooting is not done by recovery but is a kernel level access (simply put) that will give root or "SU". It is done by patching the boot partition of the your android device.
Q: What are the differences, advantages, disadvantages of the different ROM's?
A: They are all different. Some have some features, some are plain stock, some are made for bleeding edge kernel etc. You'll have to try them out and figure out yourself. I may make a chart of what they are (see the bottom at my signature - wiki) but with too many android devices, I will need some major help. One person alone will not have total knowledge of all the ROM releases. There are just way too many devices and ROMs.
Q: Which ROM will allow OTA updates?
A: Stock ROM WITH Stock Recovery.
Q: If the phone is SIM/carrier unlocked and you root do you have to SIM unlock again?
A: SIM/Carrier unlock has nothing to do with rooting your phone. You can still have root and still be carrier locked. Nexus One comes carrier unlocked from factory.
Q: How much space is there for apps? is using the sd card really necessary? (on Nexus One)
A: Search google? The phone has 512MB or space. That SHOULD be more than enough for you. If not, you have some serious issues. I do not believe you will not App2SD for Nexus One. Google did say during the release conference that they will update Android/N1 so that apps can be run/installed to SD but that requires some system and security changes (mainly to prevent pirated software - Yes if I write something, I deserve to get paid for it).
Q: When you do "flash zip from sdcard" or "fastboot flash image" does this merge and overwrite the files in to the partition?
A: When you update a software (via recovery), software my be merged. However, if you fastboot flash, just like the word flash says, it will flash and overwrite the partition.
Q: Which partition does "flash zip from sdcard" affect?
A: Depends on what you are flashing. It could be any or all of the partitions such as SPL, Boot, System, Recovery, Radio. You should study first before randomly flashing things.
sorry, got it!
blakestimac said:
i apologize if this is the wrong place for this but, but i have adb setup perfectly, but fastboot is not recognized at all. could i have missed something?
Click to expand...
Click to collapse
I need your system info.
What os are you running? where did you get fastboot? what are you trying to do?
Don't forget fastboot boot for testing images. My most used command
I still have no idea how to use or setup adb i have downloaded the sdk and used fastboot and superboot to root my phone and am currently running the cm 5.0 beta 2 rom and want to learn how to use adb so i can enable the ram. Thanks, Joe
really a noob question here.....it wa easier with Hero.
i have installed the Android SDK
however, i cannot seem to get the laptop to detect the nexus.
what have i left out?
wishmaker738 said:
really a noob question here.....it wa easier with Hero.
i have installed the Android SDK
however, i cannot seem to get the laptop to detect the nexus.
what have i left out?
Click to expand...
Click to collapse
Check the FAQ.
dylanfan424 said:
I still have no idea how to use or setup adb i have downloaded the sdk and used fastboot and superboot to root my phone and am currently running the cm 5.0 beta 2 rom and want to learn how to use adb so i can enable the ram. Thanks, Joe
Click to expand...
Click to collapse
Ok. I need to know what you actually did. I am not understanding what you are trying to do.
Can't run adb commands - device not found
Thanks for the info. I am having an issue with running adb commands. My phone is rooted via superboot and I tested it with Nexus Torch which works. Now I am trying to install the new kernel so I can run the wireless tether app... but I can't get any of the adb commands to recognize the phone. I boot the phone by holding the trackball and power button. I am in USB debugging mode. When I run fastboot devices, the phone serial number shows up. When I run adb devices, it says no device detected. And when I try to run any other adb commands they do not work, even though fastboot commands work. Any ideas? Thanks.
Sorry i was pretty vague before i down loaded the sdk and also installed the adb setup file included with the superboot pack but just have no idea how to get it to work and add things through adb. I tried typing adb commands into comand line with the phone connected to the computer but nothing happend. just said not recognised command so i just basically need a rundown of how to setup adb.
dylanfan424 said:
Sorry i was pretty vague before i down loaded the sdk and also installed the adb setup file included with the superboot pack but just have no idea how to get it to work and add things through adb. I tried typing adb commands into comand line with the phone connected to the computer but nothing happend. just said not recognised command so i just basically need a rundown of how to setup adb.
Click to expand...
Click to collapse
I'm a noob so can't offer much help...but I would make sure the usb drivers are installed if you're using windows....this probably should have happened when you installed the sdk, but you can also install it through the device manager and point it to the folder where the usb drivers are located. Also make sure the phone is in USB debugging mode. also you may need to reboot your pc. Make sure you have setup running when you run the adb commands. you need to be in the same directory as the adb file, or in the case of the superboot pack you need to type "adb-windows" not just "adb". you may also need to put .exe, ie adb-windows.exe.
pwnvds said:
Thanks for the info. I am having an issue with running adb commands. My phone is rooted via superboot and I tested it with Nexus Torch which works. Now I am trying to install the new kernel so I can run the wireless tether app... but I can't get any of the adb commands to recognize the phone. I boot the phone by holding the trackball and power button. I am in USB debugging mode. When I run fastboot devices, the phone serial number shows up. When I run adb devices, it says no device detected. And when I try to run any other adb commands they do not work, even though fastboot commands work. Any ideas? Thanks.
Click to expand...
Click to collapse
You run fastboot from the white screen. Android on non-white screen. It's one or the other. It's ADB or Fastboot (depending on the mode of the phone).
dylanfan424 said:
Sorry i was pretty vague before i down loaded the sdk and also installed the adb setup file included with the superboot pack but just have no idea how to get it to work and add things through adb. I tried typing adb commands into comand line with the phone connected to the computer but nothing happend. just said not recognised command so i just basically need a rundown of how to setup adb.
Click to expand...
Click to collapse
Is the directory where ADB/fastboot (SDK) is installled in your system path?
I am guessing it's not. If it was, just by typing adb alone (without commands), it'll give you a list of commands. Click here if you want to know how to change your system path to include a particular folder.
We're now in the age of nintendo pilots and point and click OS that no one knows how to use command lines and system paths anymore.
recovery
I have rooted n1. when I go to recovery to do backup, I get the triangle with the little green android guy, but phone is stuck there. I have to remove battery to reboot phone. What have I done wrong?
umplarry said:
I have rooted n1. when I go to recovery to do backup, I get the triangle with the little green android guy, but phone is stuck there. I have to remove battery to reboot phone. What have I done wrong?
Click to expand...
Click to collapse
Answered in FAQ area.
seraph1024 said:
Answered in FAQ area.
Click to expand...
Click to collapse
I tried that before I posted. I searched the FAQ again. Maybe I am a complete DA, but still can't find answer. I don't mind searching, it will help me to learn, but could you point me in the right direction in FAQ?
umplarry said:
I tried that before I posted. I searched the FAQ again. Maybe I am a complete DA, but still can't find answer. I don't mind searching, it will help me to learn, but could you point me in the right direction in FAQ?
Click to expand...
Click to collapse
Q: I have rooted n1. when I go to recovery to do backup, I get the triangle with the little green android guy, but phone is stuck there. I have to remove battery to reboot phone. What have I done wrong?
A: You still have the stock (shipping) recovery. If you want a different recovery (Amon RA's), download it, the from fastboot, run fastboot flash recovery downloaded_recovery.img
Click to expand...
Click to collapse
There you go.
seraph1024 said:
There you go.
[/B]
Click to expand...
Click to collapse
Thanks for your help
seraph1024 said:
There you go.
[/B]
Click to expand...
Click to collapse
I had it downloaded, just had not flashed it
I've been looking all over, but I probably need to check the HTC Dream forum or something.
How do I install a custom ROM? I know you have to adb push update.zip somewhere, but I can't find any info about this. Please help.
I've been a lurker for the last few years; never thinking I would need any help or assistance .. but I have a situation ..
My Sprint HTC One was working better than I had ever seen it just last Thursday. I was running CM11, with ART. I had an old version of SuperOne (Sense 5) backed up with TWRP. I thought I'd go ahead and load the backup, and update all the apps and then make another more recent backup before returning to CM11. I got as far holding the power button and selecting recovery. The phone locked up at that point.
It took 10 minutes to get it back to the screen where you can select fastboot, factory reset, etc. Interestingly I couldn't get into TWRP. The screen read "entering recovery" and nothing. It would just hang there.
I read that erasing the cache with fastboot might work, and it did. But when I was able to enter recovery, instead of restoring CM11, I thought, "well, maybe now it'll work", so I just rebooted. Wrong. Wouldn't boot. And, now running fastboot cache erase (or erase cache) doesn't do anything.
Now, by pressing the power button alone and holding it in I'm able to get to the fastboot, factory reset, etc screen. Went to fastboot usb, and fastboot commands work but ADB doesn't detect the device. I can't send ADB commands, but I can send ONE fastboot command. After sending any fastboot command, the phone locks up. Nothing from that point.
I tried installing a RUU. The .exe file detected the version on my phone, and everything went great until the program said it was booting to the bootloader. Locked it up. Nothing from that point.
I need help.
Thanks.
I uninstalled the HTC drivers and reinstalled them. A suggestion since ADB didn't work. And I can't get into bootloader. No difference.
Any suggestions
Any suggestions at all. I'm desperate.
Ogre77497 said:
Any suggestions at all. I'm desperate.
Click to expand...
Click to collapse
You can get into fastboot correct?
Fastboot - Yes .. Sorta
I can get into fastboot, but I copy anything to the phone via fastboot. I'm told "unable to write". Thanks.
Ogre77497 said:
I can get into fastboot, but I copy anything to the phone via fastboot. I'm told "unable to write". Thanks.
Click to expand...
Click to collapse
Ok it's probably a problem with your USB cable or USB port. Try using another PC and another cable.
If this doesn't work read some guide to properly set up ADB, uninstall all HTC stuff and install only the "naked driver" and than run the LATEST ruu. Maybe you have upgraded your firmware and can't flash older ruu's.
Sent from my HTCONE using Tapatalk
Will Try
I'll give that a try. I really appreciate the help. I run my whole business on that phone.
Just make sure you follow my suggestions properly. It should be just the cable, and I think you don't have the right drivers for ADB. Stay calm your phone is just soft bricked. You only need to be patient and read. Naked driver here http://forum.xda-developers.com/showthread.php?t=2263822
Sent from my HTCONE using Tapatalk
elvisypi said:
Ok it's probably a problem with your USB cable or USB port. Try using another PC and another cable.
If this doesn't work read some guide to properly set up ADB, uninstall all HTC stuff and install only the "naked driver" and than run the LATEST ruu. Maybe you have upgraded your firmware and can't flash older ruu's.
Sent from my HTCONE using Tapatalk
Click to expand...
Click to collapse
+1
I did the same thing a few weeks ago and lost recovery in the process. The naked driver did the trick. Also the thread about restoring after a gsm rom install is a great. It's not a loss. Not having an sd card in the one made things a little different for me, but I was able to get everything back. These drivers suck!
Progress
I've followed your directions. I downloaded the naked driver, and the minimal ADT. I found the correct RUU (3.04.651.2) I attempted to relock the bootloader, but I got a message .. " Status read failed <no such file or directory>" Went ahead and tried flashing the RUU (fastboot flash zip ruu.zip), and got the message "FAILED Remote: not allowed"
The phone is unlocked, CID SPCS_001, and HBOOT 1.44
I wasn't able to access TWRP recovery earlier, so I tried reflashing the img file. Failed remote: image update error. I tried erasing the cache .. "Failed remote erasing error", but now I can get into TWRP.
TWRP says I have "0" internal storage. I also can't mount system, data or cache. The choices are there but can't be selected.
I can't use ADB (device not found). and the phone isn't detected by windows. I had installed the HTC drivers, but couldn't uninstall them, so I install HTC Sync manager and then uninstalled it. The program deleted the HTC drivers when I uninstalled it. When I plugged in the HTC One (with a new cable) nothing happened, so I used the windows hardware wizard to install the naked driver. The phone still isn't detected, but again I can issue fastboot commands. Well, one fastboot command and then the phone freezes up.
If I use filemanager within TWRP there's no emulated sd card. I really think that's where my problem is. No partitions are available. And, when I use TWRP to shut down, it warns me that no OS is installed.
Any other suggestions?
I sure appreciate all your help. Thanks.
elvisypi said:
Just make sure you follow my suggestions properly. It should be just the cable, and I think you don't have the right drivers for ADB. Stay calm your phone is just soft bricked. You only need to be patient and read. Naked driver here http://forum.xda-developers.com/showthread.php?t=2263822
Sent from my HTCONE using Tapatalk
Click to expand...
Click to collapse
Are you Linux savvy at all? All this crap is far easier on Linux. I guarantee the drivers are absolute cakewalk -- there isn't a specific driver at all, just a rule to tell the kernel about the device.
I can give you the udev rule for the phone if you are sick of trying to get Windows to work. The Android SDK is also quite easy to install.
If you want to try, just install Ubuntu 12.04 LTS. Later versions also work, but that version is the current stable release. I can help from there.
Try another cable maybe it's faulty. Uninstall all the HTC crap, run some cleaner app like ccleaner (maybe there are leftovers) and install only the naked driver. Your phone should be detected. Make sure you have the latest version of ADB. here's the latest http://click.xda-developers.com/api...n 1.1.3 Here&jsonp=vglnk_jsonp_13877458281136
The ruu is not to be flashed with fastboot commands, you must run the exe file
Here's the latest ruu
http://click.xda-developers.com/api....05.651 .5&jsonp=vglnk_jsonp_138775039936710
-extract zip to a folder on your pc
-using fastboot, type this cmd: fastboot oem lock this will relock the bootloader
-from pc, run ARUWizard.exe from the extracted folder. it will run the RUU utility & flash back to stock
Sent from my HTCONE using Tapatalk
Installing Ubuntu
Not Linux savy at all, but I'll install Ubuntu. I'll let you know when I'm able to boot into it. Thanks.
tdhite said:
Are you Linux savvy at all? All this crap is far easier on Linux. I guarantee the drivers are absolute cakewalk -- there isn't a specific driver at all, just a rule to tell the kernel about the device.
I can give you the udev rule for the phone if you are sick of trying to get Windows to work. The Android SDK is also quite easy to install.
If you want to try, just install Ubuntu 12.04 LTS. Later versions also work, but that version is the current stable release. I can help from there.
Click to expand...
Click to collapse
Ogre77497 said:
Not Linux savy at all, but I'll install Ubuntu. I'll let you know when I'm able to boot into it. Thanks.
Click to expand...
Click to collapse
When you get it installed, login and open a terminal windows (it'll install Unity by default, so click on the first button on the left sidebar and search for terminal, then click on it), then type exactly the following (cut/copy/paste should do it too) noting that the first command will make you give your password since sudo requests root level access:
sudo apt-get update -y
sudo apt-get install -y wget openjdk-7-jdk
wget http://dl.google.com/android/android-sdk_r22.3-linux.tgz
mkdir ~/bin
cd ~/bin
tar xvzf ~/android-sdk_r22.3-linux.tgz
cat >> ~/.bashrc <<EOF
if [ -d ${HOME}/bin/android-sdk-linux ]; then
PATH+=":${HOME}/bin/android-sdk-linux/tools"
PATH+=":${HOME}/bin/android-sdk-linux/platform-tools"
fi
export PATH
EOF
exit
That last command will exit the terminal. Start another and it'll read the .bashrc file and presto -- you have SDK access from everywhere.
Then, type this command:
android
That will bring up the SDK UI -- let it download/install all of the latest stuff (r22 of the tools and whatnot).
When done, close the android SDK window.
Type adb (bet it works), but fastboot will require root access (I'm not going to teach you how to get around that yet -- no problem, you just run sudo and I'll show that in a sec).
Finally, plug in your HTC One and type adb devices and let's see if it didn't just know it already.
Lemme know.
Ubuntu 12.04 LTS Installed
I have Linux running on my Dell laptop. No internet though. Something about installing broadcom drivers ..
What do I need to do, sir?
tdhite said:
Are you Linux savvy at all? All this crap is far easier on Linux. I guarantee the drivers are absolute cakewalk -- there isn't a specific driver at all, just a rule to tell the kernel about the device.
I can give you the udev rule for the phone if you are sick of trying to get Windows to work. The Android SDK is also quite easy to install.
If you want to try, just install Ubuntu 12.04 LTS. Later versions also work, but that version is the current stable release. I can help from there.
Click to expand...
Click to collapse
Ogre77497 said:
I have Linux running on my Dell laptop. No internet though. Something about installing broadcom drivers ..
What do I need to do, sir?
Click to expand...
Click to collapse
Check PM
bigdaddy619 said:
Check PM
Click to expand...
Click to collapse
@bigdaddy619 probably got you covered, but if not, let me know. Your friend for Broadcom chips on Dell boxes is here:
https://help.ubuntu.com/community/WifiDocs/Driver/bcm43xx
The gist is pretty simple. If you don't know which wireless you have, do this:
1) widen your terminal window so you have ample room (good and wide);
2) run sudo lspci -v
Hunt down the Broadcom info -- it'll say which device is your broadcom wifi. Just need the numbers.
Working ..
I feel like I'm making some progress here, but it's still not being recognized. Everything worked great up until ...
After closing the SDK window, I connected the HTC One, and "Fastboot USB" came up on my phone. I typed adb devices and got a line "List of Devices attached" by nothing was showing as being attached.
If I enter a fastboot command, it hangs saying "waiting on device".
tdhite said:
When you get it installed, login and open a terminal windows (it'll install Unity by default, so click on the first button on the left sidebar and search for terminal, then click on it), then type exactly the following (cut/copy/paste should do it too) noting that the first command will make you give your password since sudo requests root level access:
sudo apt-get update -y
sudo apt-get install -y wget openjdk-7-jdk
wget http://dl.google.com/android/android-sdk_r22.3-linux.tgz
mkdir ~/bin
cd ~/bin
tar xvzf ~/android-sdk_r22.3-linux.tgz
cat >> ~/.bashrc <<EOF
if [ -d ${HOME}/bin/android-sdk-linux ]; then
PATH+=":${HOME}/bin/android-sdk-linux/tools"
PATH+=":${HOME}/bin/android-sdk-linux/platform-tools"
fi
export PATH
EOF
exit
That last command will exit the terminal. Start another and it'll read the .bashrc file and presto -- you have SDK access from everywhere.
Then, type this command:
android
That will bring up the SDK UI -- let it download/install all of the latest stuff (r22 of the tools and whatnot).
When done, close the android SDK window.
Type adb (bet it works), but fastboot will require root access (I'm not going to teach you how to get around that yet -- no problem, you just run sudo and I'll show that in a sec).
Finally, plug in your HTC One and type adb devices and let's see if it didn't just know it already.
Lemme know.
Click to expand...
Click to collapse
Ogre77497 said:
I feel like I'm making some progress here ....
Click to expand...
Click to collapse
Hang in, writing you some instructions, just a few minutes -- just need to get a udev rule into place but I want to make it easy for you.
---------- Post added at 08:18 PM ---------- Previous post was at 07:50 PM ----------
tdhite said:
Hang in, writing you some instructions, just a few minutes -- just need to get a udev rule into place but I want to make it easy for you.
Click to expand...
Click to collapse
Actually -- let's walk before we run. I loaded up Ubuntu real quick to assure I can duplicate what I want you to see. So, do this:
1) connect (if not already connected) the HTC to the usb port so you get 'fastboot (usb)' as normal;
2) type the following:
sudo su
lsusb -v >/tmp/lsusb.txt
chmod 666 /tmp/lsbusb.txt
exit
Now, edit that file in the text editor (just search for 'edit' like you did for 'termina' and select the "Text Editor". When you get that open, have it "File | Open" the file above -- /tmp/lsusb.txt
Then look through for text similar to what I give below. If we get that -- I need the idVendor line -- it should read: "idVendor 0x0bb4 High Tech Computer Corp."
I copied some sample output from my own machine so you can see how it should look:
--------
probably a bunch of stuff we don't care about, then something like...
Bus 001 Device 005: ID 0bb4:0ff0 High Tech Computer Corp.
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 2.10
bDeviceClass 0 (Defined at Interface level)
bDeviceSubClass 0
bDeviceProtocol 0
bMaxPacketSize0 64
idVendor 0x0bb4 High Tech Computer Corp.
idProduct 0x0ff0
bcdDevice 1.00
iManufacturer 1 htc, Inc
iProduct 2 Android 1.0
iSerial 3 XXXXXXXXXXXX (I X'd this out -- it'll be your device serial id).
bNumConfigurations 1
Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength 32
bNumInterfaces 1
bConfigurationValue 1
iConfiguration 0
bmAttributes 0x80
and a bunch more stuff...
If we don't see that, we got troubles. If we do -- we'll make a udev rule to load it up for adb and fastboot.
It appears he's bricked, when we first mounted the phone to the PC and it tried to install drivers we got QHSUSB_DLOAD which usually indicates a brick.
The strange thing was we could still access fastbootusb and the PC would recognize it being in fastboot. But any other command then fastboot devices would lock up the bootloader and fail.
Getting Closer
That's exactly it. "idVendor 0x0bb4 High Tech Computer Corp."
Finally, something worked. Thanks.
Now, edit that file in the text editor (just search for 'edit' like you did for 'termina' and select the "Text Editor". When you get that open, have it "File | Open" the file above -- /tmp/lsusb.txt
Then look through for text similar to what I give below. If we get that -- I need the idVendor line -- it should read: "idVendor 0x0bb4 High Tech Computer Corp."
Contents / Thread overview
Introduction
What is Fastboot?
What is adb?
How to install adb and fastboot
How to test adb and fastboot work
OK Gimme some useful fastboot commands please!
OK Gimme some useful adb commands please!
A little more about using Windows command prompt
Myth Busters
Introduction
adb and fastboot are very useful command line tools. They can be used from Windows, Linux or Mac to carry out tasks on your android device, such as moving and backing up files, rooting and restoring your phone to it's factory state. Understanding how to use these tools could save your phone when you get yourself in trouble. This is especially true of rooted users. Particularly those of you who are "new to the scene". You definitely should read and understand this thread before you do ANYTHING root related.
This thread is not intended to be a non-exhausted reference. It is merely here to give an overview of the most basic of basics
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
What is fastboot?
Fastboot comprises of 2 components.
1) Fastboot mode on the phone (The Bootloader)
2) Fastboot tool on your computer
Fastboot is a small command line tool that you can use from your computer whilst the phone is connected via USB and you are booted into the bootloader. The most common uses for fastboot are:
Unlocking the bootloader - needed as part of the rooting process
Flashing a custom recovery to the device - needed as part of the rooting process
Flashing factory images - used for saving / trestoring your device back to stock
Being able to do these 3 things are essential before rooting. Many new users skip learning these and use a toolkit to root. As a result, when they mess up and we try to explain what they need to do to fix their issues, it becomes very difficult for us to help as fastboot is not understood. It is YOUR responsibility to understand these things BEFORE you mess up.
What is adb?
adb is another small command line tool that stands for "Android Debugging Bridge". Again, it can be used from a computer connected via USB to your android device. It can be used whilst the device is booted into Android or (if you have a custom recovery), it can be used in recovery too, unlike fastboot (yes, adb and fastboot are NOT the same thing) which can only be used in the bootloader.
adb can be used to push files to (or pull files from) your phone. It can also be used to execute many of the commands available in Linux terminals (Or Android terminal emulators) on the device itself. We're not here to cover all these commands however. We just want to cover the basics.
How to install adb and fastboot
adb and fastboot are very easy to install and can be installed on Windows, Linux and MAC computers. The Windows install can be a little bit more complicated than the other 2 and may need additional drivers installing too.
Windows.
There is a very handy tool that can install adb and fastboot in 15 seconds. It is recommended that you use this to install adb and fastboot. Please see the link immediately below for that tool:
ADB, Fastboot and Drivers - 15 seconds ADB Installer - Really quick and easy way to install adb and fastboot (by @Snoop05). Downlkoad links are at the bottom of post 1.
This tool asks if you want to install adb and fastboot (to which you should answer Y) and then creates c:\adb\adb.exe and c:\adb\fastboot.exe
It then asks if you want to install it system wide (to which again, you should answer Y)... This then allows you to type adb commands in the command prompt without having to open a particular directory first. You may or may not understand what I mean when I say that, but take it from me, its much more convenient and easier to use this way.
There is actually a manual way of doing what the 15 second installer is doing, by extracting the adb.exe and fastboot.exe to your computer and using the Windows Enviroment variable PATH to make the executables work system wide, however the installer is much quicker, but for reference:
Code:
right-click computer > properties > advanced > environment variables.
under system variables click "path" and click "edit"
at the end of the line, add the below:
;c:\adb_fastboot
where c:\adb_fastboot is where you decided to extract adb and fastboot executables.
Please note, the semi-colon ; is VERY important.
You can do this if for some reason the installer becomes unavailable
It will also ask if you want to install device drivers. Actually, say N to this as we're going to cover that next, using the Universal Naked driver which has better compatibility.
Here is a link to the naked driver: DOWNLOAD THIS which has been taken from this thread:
[ADB/FB/APX Driver] Universal Naked Driver
Some of the below instructions are taken from the thread above by @1wayjonny but I have moved them here to make it easier for you guys.
Code:
To install on Windows 7:
- Ensure existing drivers are uninstalled first*
- Extract the zip to c:\adb (created earlier by the installer)
- Right-click "Computer" > Manage in windows and choose "Device Manager"
- Boot the Nexus 5 to the bootloader (Volume down + Power) and connect the USB Cable
- Watch for any new devices with exclamation marks appearing
- Right-Click the new device > Update driver software
- Choose the "browse" method and browse to c:\adb then follow the wizard to the end.
*To uninstall existing drivers, boot into Android and connect the USB cable. Monitor device manager for the device showing up. To uninstall the device, right-click it to uninstall it. At the prompt, ensure you also choose to delete the driver. Repeat this for bootloader and recovery.
Code:
To Install on Windows 8, you must additionally disable driver enforcement
- From the Metro Start Screen, open Settings (move your mouse to the bottom-right-corner of the screen and wait for the - -- pop-out bar to appear, then click the Gear icon).
- Click ‘More PC Settings’.
- Click ‘General’.
- Scroll down, and click ‘Restart now’ under ‘Advanced startup’.
- Wait a bit.
- Click ‘Troubleshoot’.
- Click ‘Advanced Options’
- Click ‘Windows Startup Settings’
- Click Restart.
Once that is done, your Windows computer is configured for adb and fastboot.
In device manager, the device should show up as below, depending whether you are booted into recovery or bootloader...
Recovery - Android Device > Google Nexus 4 ADB Interface
Bootloader - Android Device > Google Nexus 4 Bootloader Interface
If it shows as something different, either you have existing drivers in the way or something went wrong.
Linux and Mac
Here is a really simple tool to install adb and fastboot on the above OS. The only expectation is you know how to open and run a terminal command. Please see the link immediately below:
Nexus Tools 2.2 (Featured by XDA) - adb and fastboot installer for Linux and Mac (by @corbin052198)
Once you have installed adb and fastboot from the above link, you're ready to go.
How to test adb and fastboot work
As previously mentioned, adb and fastboot are both command line tools. That means you must run these tools from command prompt (cmd in Windows) or Terminal (Linux and Mac).
Remember earlier, I mentioned that fastboot can only be used in bootloader? and adb can only be used in Android (or custom recovery - lets cover that later)? We can use the command "fastboot devices" and "adb devices to see if we have adb and fastboot working correctly.
Lets try it.
Boot your phone into android
Connect it to your computer via USB
Open cmd (start > type "cmd" on Windows) or Terminal (Mac/ Linux
Type in the windows "adb devices" and press enter
Here is what we don't want to see:
Notice how there is nothing underneath where it says "List of attached devices" That means it cannot see any device
Here is what we DO want to see:
We can see that there is now a device listed.
OK lets test fastboot. Unplug the USB and turn off the phone. When it is off, hold down Volume down + power until you feel the vibrate. You will now be in the bootloader. Reconnect the USB cable.
In the same window (cmd or terminal) we're going to now type "fastboot devices".
Again, here is an example of what we don't and do want to see:
If in both modes, you can see your devices "Serial Number", then you know they are both working. If they're not working (mainly Windows users) you may want to check this additional thread about troubleshooting drivers.
[*] Diagnosing USB Driver and ADB issues in Windows - Ensure ADB and fastboot WORK before you root (by @MaxRabbit)
Please note that if you cannot get adb and fastboot to work "system wide", you can open the command prompt to the location of the adb and fastboot executables exist and try from there.
OK Gimme some useful fastboot commands please!
Here are some of the most useful fastboot commands you will come across. Fastboot is used mostly for flashing images to the devices partitions on the internal memory.
Code:
fastboot oem unlock
This unlocks your bootloader and allows you to flash a recovery to root. WARNING, this will wipe your device. If you actually want to do this, please follow this guide:
How to Unlock Bootloader, Install Custom Recovery and Root - The preferred method. Allows you to learn and understand the basics (by @Chromium)
Code:
fastboot flash recovery recovery.img
This will flash a recovery.img to the recovery partition. The command is broken down into "fastboot flash" (what to do) "recovery" (where to flash to) "recovery.img" what to flash there. In the terminal or command prompt, you cannot just type "recovery.img" though. It has to be the path to where the recovery image is. For example, if my recovery image is on my desktop, I would have to type:
Code:
fastboot flash recovery c:\users\rootsu\desktop\recovery.img
It is worth noting, that it IS case sensitive, meaning if your file is called Recovery.img, you must type the capital R...
Other things you would flash:
Code:
fastboot flash system system.img
fastboot flash boot boot.img
These will flash the system image (ROM) and bot image (kernel) as you would if you were returning to stock. If you want to return to stock, please use this guide:
How to flash a factory image | Return to stock | Unroot/SAVE your Nexus 5 - Understand how to undo whatever you do before you root (by @abaaaabbbb63)
You can also boot into a recovery.img without flashing it...
Code:
fastboot boot c:\users\rootsu\desktop\recovery.img
which is "fastboot boot" (what to do) "c:\users\rootsu\desktop\recovery.img" what to do it with. As you may have noticed, we did not define the recovery partition in this command, that's because we're not flashing it....
OK Gimme some useful adb commands please!
At the moment, we are going to assume you have a custom recovery and you have booted into recovery. The reason for this is using adb in recovery can be much simpler.
Here are some useful scenarios for using adb.
Backup your sdcard to your PC
Code:
adb shell
mount data
exit
adb pull data/media/0 c:\MyBackup
**Please note, some recoveries may "mount data" automatically on boot, so don't be disheartened if you get an error stating device or resource busy. This probably just means you can't mount what is already mounted**
/data/media/0 is the real location of /sdcard for your information. Also referred to as "The mount point". What we have done here is "adb pull" (what to do) "data/media/0" (what to move) "c:\MyBackup" (where to move it to)
Push a zip file from your PC to your sdcard (useful if you wiped your sdcard and rom)
Code:
adb shell
mount data
exit
adb push c:\rom.zip data/media/0
What we have done here is "adb push" (what to do) "c:\rom.zip" (what to move) "data/media/0" (where to move it to)
You can of course also use adb to push and pull files to and from /system too. You just need to:
Code:
adb shell
mount system
exit
I mentioned earlier that using custom recovery is much easier for adb than whilst booted into Android. You need to ensure you have a kernel that allows insecure adb before you do anything with system and data partitions. You also need to ensure that USB debugging has been enabled in developer options.
For example, to mount system to pull files whilst android is running you have to:
Code:
adb root
adb shell
mount -o rw,remount /dev/block/platform/msm_sdcc.1/by-name/system /system
...which is clearly a little bit more involved, so I recommend you use recovery for adb push and pull. You can find more detailed information on adb here: http://developer.android.com/tools/help/adb.html
A little more about using Windows command prompt
One thing to understand is that like Windows, command prompt (cmd.exe) works with directories (or folders if you like). The Linux and Mac terminals are the same, but most linux users, we expect you would already know this.
Here you will see I have downloaded a recovery image that I want to flash using fastboot.
As you can see, the recovery.img is located in C:\users\rootSU\Desktop
Usually when you open the command prompt from the start menu, or run command, the command prompt will default to your user location as seen below:
So lets try and fastboot flash recovery recovery.img...
It fails with a not-too-accurate error message. It has failed because you have not told it where the recovery image is. It assumes it is in the directory as listed in the prompt
So, how do we deal with this? Well, there are 3 ways.
1) We tell the command prompt where the recovery.img actully is in the command itself
Success! As you can see, we have told the command that the location for the file is Desktop\recovery.img
2) We can change the directory in command prompt to the directory where the file is. In this example, we change directory to "Desktop". The change directory command is "cd " or in this case "cd Desktop"
3) ...and possibly the simplest method. We hold shift whilst we right-click on the folder we want to change directory to, and directly open a command prompt there:
Another point to make with command prompt or terminals, is if you do a particular command, it is "pre-programmed" to "expect" a particular format of that command.
For example, we know that adb push as a command expects after it . This means the command is actually
Code:
adb push
BUT if you put something AFTER , for example -
Code:
adb push somethingelse
, it will assume that the "somethingelse" is a bad parameter, and the command will fail. It will probably display (or "print" which is the technical term in a terminal) a helpful guide of how the command should be used instead of trying to run the command which it does not understand.
You're probably wondering why I am telling you this. Well quite simply, it is a warning about folder names. Imagine you have c:\users\rootSU\My Documents as a folder. You assume the command is then
Code:
adb pull /data/media/0 c:\users\rootSU\My Documents
but it is not... There is a space in between My and Documents. What you have actually done is
Code:
adb pull Documents
because it uses a space to signify the end of a command or parameter. It is best to avoid using folders with spaces in them. Avoid as much as you can. In the event it is unavoidable (Although when is it ever>) then please surround the path with quotation marks,
Code:
adb pull /data/media/0 "c:\users\rootSU\My Documents"
so that way, it sees everything between the " " as a single parameter.
Myth Busters
Myth 1: You need USB debugging on to use adb and fastboot
If you cannot boot into Android, it doesn't matter. You DO NOT need USB Debugging turned on to use adb outside of android. USB Debugging is an Android ONLY setting. Fastboot obviously also does not need debugging either as this too is outside of Android
Myth 2: to adb push or fastboot flash files, they must be in the same folder as adb or fastboot executables. Sorry but this is rubbish. You can pass the full path of the image you're flashing or file you're pushing in the command and fastboot / adb can be called system wide if you've set them as an environment variable or used the 15 second installer
This should absolutely be a sticky!!
Sent from my EVO using XDA Premium 4 mobile app
Evolution_Freak said:
This should absolutely be a sticky!!
Sent from my EVO using XDA Premium 4 mobile app
Click to expand...
Click to collapse
Thanks. I created it specifically to put in the general sticky in my signature. Section 1a and 4
Great work @rootSU definitely should be sticky!
psycho693 said:
Great work @rootSU definitely should be sticky!
Click to expand...
Click to collapse
Thanks. Its in there. All in the main sticky thread
Sent from my Nexus 5 using Tapatalk
rootSU said:
Thanks. Its in there. All in the main sticky thread
Sent from my Nexus 5 using Tapatalk
Click to expand...
Click to collapse
It helps a lot because I have been looking for a good guide to pull system files while the phone is running
psycho693 said:
It helps a lot because I have been looking for a good guide to pull system files while the phone is running
Click to expand...
Click to collapse
Cool
The main thing for me was we had a diagnosis thread and we had a full guide for rooting or returning to stock but nothing to answer the how to set up or how to adb push basic questions... I've seen several threads today alone
Sent from my Nexus 5 using Tapatalk
Very cool, didn't actually know the push/pull commands or that driver you reference
wonderful(really wonderful)!
but i cant find the start button on this toolkit.. :silly:
simms22 said:
wonderful(really wonderful)!
but i cant find the start button on this toolkit.. :silly:
Click to expand...
Click to collapse
LMAO! rootSU, this is freakin awesome. Every thread that I find complaining about issues with toolkits will be redirected here. If this isn't stickied it should be a crime.
Sent from my Nexus 5 using xda premium
I suggested to the mods that we have just one sticky in general that has all the threads we believe to be Stickies within it. That way we can control it ourselves but without making it messy, so we have that now ( see signature).
Sent from my Nexus 5 using Tapatalk
Thanks for listing my Nexus Tools
corbin052198 said:
Thanks for listing my Nexus Tools
Click to expand...
Click to collapse
Thanks for making them
Sent from my Nexus 5 using Tapatalk
simms22 said:
wonderful(really wonderful)!
but i cant find the start button on this toolkit.. :silly:
Click to expand...
Click to collapse
How do I flash the toolkit? I think its bricked :silly:
Good thread.
Amazingly detailed thread. There's no way to mess up reading this thread, the noobs will definitely learn if they can do the reading first that is.
I will laugh when a noob asks, "fastboot? It takes about a minute for me to boot!"
Sent from my Nexus 5 using XDA Premium 4 mobile app
I'm not sure what this all is, but awesome guide!!!!
? I'll be frequently linking this too.
Good job my friend, i am sure it's really helpful for a lot of people
Tapatalk Team SlimRoms
Added the below section about using command prompt. Hopefully a little more detail should help.
A little more about using Windows command prompt
One thing to understand is that like Windows, command prompt (cmd.exe) works with directories (or folders if you like). The Linux and Mac terminals are the same, but most linux users, we expect you would already know this.
Here you will see I have downloaded a recovery image that I want to flash using fastboot.
As you can see, the recovery.img is located in C:\users\rootSU\Desktop
Usually when you open the command prompt from the start menu, or run command, the command prompt will default to your user location as seen below:
So lets try and fastboot flash recovery recovery.img...
It fails with a not-too-accurate error message. It has failed because you have not told it where the recovery image is. It assumes it is in the directory as listed in the prompt
So, how do we deal with this? Well, there are 3 ways.
1) We tell the command prompt where the recovery.img actully is in the command itself
Success! As you can see, we have told the command that the location for the file is Desktop\recovery.img
2) We can change the directory in command prompt to the directory where the file is. In this example, we change directory to "Desktop". The change directory command is "cd <directory>" or in this case "cd Desktop"
3) ...and possibly the simplest method. We hold shift whilst we right-click on the folder we want to change directory to, and directly open a command prompt there:
Click to expand...
Click to collapse
Added a bit more about using directory paths with spaces.
Sent from my Nexus 5 using Tapatalk
After a week with my new nexus, it's time for a litlle fun... But first must say thank you for this explanation.
Sent from my Nexus 5 using Tapatalk 2
Read this whole guide before starting.
This is for the 2nd gen Fire TV Stick (tank)
Current relase: amonet-tank-v1.2.2.zip
NOTE: Recent reports indicate a change that disables brom DL-mode
The change seems to have been introduced with devices that where manufactured in December 2019 or later.
The change is unrelated to the software-version and results in the device not showing up as a USB device when shorted.
Unfortunately these devices cannot currently be unlocked.
NOTE: If you are on version 1.0, don't update to 1.2.1 through TWRP, as there is a bug.
NOTE: This issue has been fixed in version 1.2.2
NOTE: When updating from version 1.0, don't install anything else before rebooting
To update to the current release if you are already unlocked, just flash the zip in TWRP.
What you need:
A Linux installation or live-system
A micro-USB cable
Something conductive (paperclip, tweezers etc)
Something to open the stick.
NOTE: Ideally you want to update your system to 5.2.6.9 before starting this process, since this flashes the 5.2.6.8 boot.img and people have reported issues with adb-authorization with older firmware.
Since version 1.2 this isn't required, because instead of flashing the 5.2.6.9 boot.img, your existing boot.img will be patched.
It is still recommended to first update to 5.2.6.9
Install python3, PySerial, adb and fastboot. For Debian/Ubuntu something like this should work:
Code:
sudo apt update
sudo add-apt-repository universe
sudo apt install python3 python3-serial android-tools-adb android-tools-fastboot
Make sure ModemManager is disabled or uninstalled:
Code:
sudo systemctl stop ModemManager
sudo systemctl disable ModemManager
NOTE: If you have issues running the scripts, you might have to run them using sudo.
Also try using different USB-ports (preferably USB-2.0-ports)
1. Extract the attached zip-file "amonet-tank-v1.2.2.zip" and open a terminal in that directory.
2. start the script:
Code:
./bootrom-step.sh
It should now say Waiting for bootrom.
Short CLK to GND (The metal shielding is also GND) according to the attached photo and plug it in.
NOTE:
In lsusb the boot-rom shows up as:
Code:
Bus 002 Device 013: ID [b]0e8d:0003[/b] MediaTek Inc. MT6227 phone
If it shows up as:
Code:
Bus 002 Device 014: ID [b]0e8d:2000[/b] MediaTek Inc. MT65xx Preloader
instead, you are in preloader-mode, try again.
dmesg lists the correct device as:
Code:
[ 6383.962057] usb 2-2: New USB device found, idVendor=[b]0e8d[/b], idProduct=[b]0003[/b], bcdDevice= 1.00
4. When the script asks you to remove the short, remove the short and press enter.
5. Wait for the script to finish.
If it stalls at some point, stop it and restart the process from step 2.
6. Your device should now reboot into unlocked fastboot state.
7. Run
Code:
./fastboot-step.sh
8. Wait for the device to reboot into TWRP.
9. Use TWRP to flash custom ROM, Magisk etc.
NOTE:
Only ever flash boot/recovery images using TWRP, if you use FlashFire or other methods that are not aware of the exploit,
your device will likely not boot anymore (unless you flashed a signed image).
TWRP will patch recovery/boot-images on the fly.
NOTE:
This process does not disable OTA or does any other modifications to your system.
You will have to do that according to the other guides in this forum.
Very special thanks to @xyz` for making all this possible and putting up with the countless questions I have asked, helping me finish this.
Thanks to @hwmod for doing initial investigations and providing the attached image.
Changelog
Version 1.2 (25.03.2019)
Update TWRP to twrp-9.0 sources
Implement downgrade-protection for LK/PL/TZ
Add scripts to enter fastboot/recovery in case of bootloop
Automatically restore boot-patch when you boot into recovery
Features.
Hacked fastboot mode lets you use all fastboot commands (flash etc).
Boots custom/unsigned kernel-images (need to be patched)
For the devs: sets printk.disable_uart=0 (enables debug-output over UART).
TWRP protects from accidental lk/preloader/tz downgrades
Set bootmode via preloader
NOTE: Hacked fastboot can be reached via TWRP.
NOTE: Hacked fastboot won't patch your boot/recovery-images, so you can easily go back to stock.
Use TWRP for autopatching.
There are three options for interacting with TWRP:
A mouse via USB-OTG
TWRP commandline via adb: https://twrp.me/faq/openrecoveryscript.html
Via /cache/recovery/command
Example for /cache/recovery/command:
Code:
echo "--update_package=/path/to/zipfile" > /cache/recovery/command
echo "--wipe_cache" >> /cache/recovery/command
reboot recovery
Should you somehow end in a bootloop you can boot into hacked fastboot or recovery using.
Code:
sudo ./boot-fastboot.sh
Code:
sudo ./boot-recovery.sh
NOTE:This will only work if the boot-exploit is still there.
Source Code:
https://github.com/chaosmaster/amonet
https://github.com/chaosmaster/android_bootable_recovery
how would you get to twrp after rebooting to system?
krsmit0 said:
how would you get to twrp after rebooting to system?
Click to expand...
Click to collapse
Code:
adb reboot recovery
k4y0z said:
Code:
adb reboot recovery
Click to expand...
Click to collapse
ok, made it to recovery. not sure how to navigate recovery.
krsmit0 said:
ok, made it to recovery. not sure how to navigate recovery.
Click to expand...
Click to collapse
Either via adb shell, or a mouse via USB-OTG
k4y0z said:
Either via adb shell, or a mouse via USB-OTG
Click to expand...
Click to collapse
found this, thanks, didnt know about this
https://twrp.me/faq/openrecoveryscript.html
Oh nice! I'll try it later today!
first one worked fine. second seemed to go ok but i cant get back in with adb. device unauthorized. i went through the process again to get back to recovery and i copied the adb_keys from the one that worked to the other one. permissions and ownership are the same, but it still says unauthorized. i also dont get the prompt to allow connection on the stick itself. i have connected with this stick through adb before this.
UPDATE: Factory reset didnt bring back the adb debug prompt. but an update did. I was on an older version.
krsmit0 said:
first one worked fine. second seemed to go ok but i cant get back in with adb. device unauthorized. i went through the process again to get back to recovery and i copied the adb_keys from the one that worked to the other one. permissions and ownership are the same, but it still says unauthorized. i also dont get the prompt to allow connection on the stick itself. i have connected with this stick through adb before this.
Click to expand...
Click to collapse
Mhh, what Firmware are you on?
Does it still boot normally?
Have you tried adb both over network and USB?
Can you make sure, adb is enabled in developer settings?
If that doesn't help could you try factory reset?
k4y0z said:
Either via adb shell, or a mouse via USB-OTG
Click to expand...
Click to collapse
k4y0z said:
Mhh, what Firmware are you on?
Does it still boot normally?
Have you tried adb both over network and USB?
Can you make sure, adb is enabled in developer settings?
If that doesn't help could you try factory reset?
Click to expand...
Click to collapse
it took an update to resolve it. factory reset didnt work. i was not getting the adb authorization prompt so i couldnt boot to recovery. i have it back up and running.
krsmit0 said:
it took an update to resolve it. factory reset didnt work. i was not getting the adb authorization prompt so i couldnt boot to recovery. i have it back up and running.
Click to expand...
Click to collapse
fastboot-step flashes the 5.2.6.8 boot.img, maybe that was causing an issue with older firmware.
Glad you got it solved. Now we also know updates are working fine (Allthough disabling OTA might not be the worst idea)
The photo has the points labeled but doesn't specify what gets shorted. Are you supposed to short CLK to GND?
AFTVnews.com said:
The photo has the points labeled but doesn't specify what gets shorted. Are you supposed to short CLK to GND?
Click to expand...
Click to collapse
Yes, exactly.
I have updated the OP.
Wow, nice one @k4y0z. I'm so happy this little device can now have an unlocked bootloader; it's going to open up many possibilities on a device that is so inexpensive.
My Firestick 4k bootloops
Sir i have a serious problem with my Firestick 4k. I experimented to sideload google play services on my FS 4k and it installed successfully. But when i restart my device it bootloops on and on to Firestick logo. Any solution sir? Damn i must have not do that. Please sir help me. I think i must hard reset the Firestick 4k but how?
Will the Playing with Fire pack work without any changes?
Any chance a similar exploit can be done on the 1st gen stick (montoya)?
k4y0z said:
Yes, exactly.
I have updated the OP.
Click to expand...
Click to collapse
It looks like there is a test point attached to the trace that looks like it's going to what's labeled as CLK. Is that what you can use to short, or do you have to short the thing you are pointing to?
Have you modified anything, or is this the stock stuff that the original exploit used? Are these .bin files what I would get if I were to compile everything from the github?
Hello folks!
Its been a while since i posted here - i havent been flashing roms for an age (kids etc got in the way!)
Anyway, i've picked up a Pixel 4 XL, and it was running a custom ROM, i'm trying to move back to stock and have been able to follow all the guides i've found up to using the 'fastboot flashall' in shell.
The command works and delivers the
Bootloader Version...:
Baseband Version.....:
Serial Number........:
values, but then errors out with the following error "fastboot: error: ANDROID_PRODUCT_OUT not set"
I'm stumped what that means and how to fix. I'm doing all of this on my Pixelbook, and have updated fastboot and adb as per the initial steps for flashing.
Can anyone shed any light on what i still need to do to get flashall to work as expected?
Thanks in advance if you are able to help out!
ptm
Welcome Back
Could you post the exact command you are using for fastboot flash please? It sounds like fastboot is not finding the files to flash. Usually, depending on the configuration of the fastboot install, it's easier to place the firmware in the same directory as the fastboot binary.
Thanks! It turns out i've missed this place!
So the firmware files are all on the chromebook and I've used 'shell' to navigate to where I've unzipped. Here's the command line with the command i'm using: "[email protected] ~/Downloads/ota_file $ fastboot flashall"
Before trying a full flash, i was trying to sideload the OTA as per instructions here https://developers.google.com/android/ota#instructions but moving the file from my pixelbook to the 4XL fails at 47% every time.
So i reverted to a full flash as per these instructions - https://developers.google.com/android/images and that is where i'm coming a cropper with the 'not set' error.
Thanks for your help!
ktmom said:
Welcome Back
Could you post the exact command you are using for fastboot flash please? It sounds like fastboot is not finding the files to flash. Usually, depending on the configuration of the fastboot install, it's easier to place the firmware in the same directory as the fastboot binary.
Click to expand...
Click to collapse
I thinnk you may be merging several approaches.
You are using the full factory image downloaded from the https://developers.google.com/android/images page, right? Then, once downloaded, you are unzipping the file and cd into the new directory (from the unzip). The command then should be
Code:
./flash-all.sh
As far as the OTA install is concerned, you are using the command
Code:
adb sideload "ota_file.zip"
, and at 47%, what happens that it appears to fail? My memory on my P3XL is at that point it takes awhile.
If you are using a C to C switch to an A to C cable and try it. You'll want to remove the wipe from the flash-all before you flash the full image and it's the flash all you should be using to flash.
Yeah i think you're right - so now just concentrating on the Full Flash method shown on the Google Developers page, and yes doing it exactly as you'd described.
Ok - using
Code:
./flash-all.sh
now returns the error
Code:
bash: ./flash-all.sh: Permission denied
I have tried to prefix './flash-all.sh' with 'Fastboot' but no dice here either. Is that required at all?
ktmom said:
I thinnk you may be merging several approaches.
You are using the full factory image downloaded from the https://developers.google.com/android/images page, right? Then, once downloaded, you are unzipping the file and cd into the new directory (from the unzip). The command then should be
Code:
./flash-all.sh
As far as the OTA install is concerned, you are using the command
Code:
adb sideload "ota_file.zip"
, and at 47%, what happens that it appears to fail? My memory on my P3XL is at that point it takes awhile.
Click to expand...
Click to collapse
ptm said:
Yeah i think you're right - so now just concentrating on the Full Flash method shown on the Google Developers page, and yes doing it exactly as you'd described.
Ok - using
Code:
./flash-all.sh
now returns the error
Code:
bash: ./flash-all.sh: Permission denied
I have tried to prefix './flash-all.sh' with 'Fastboot' but no dice here either. Is that required at all?
Click to expand...
Click to collapse
You need to give the "flash-all.sh" script execution rights (that is why the permission denied error). Use this code:
Code:
chmod +x ./flash-all.sh
You may need super user/root rights:
Code:
sudo chmod +x ./flash-all.sh
The "flash-all.sh" script is a stand-alone script that sequentially flashes the entire factory package. As was mentioned in another repsonse in this thread, in cases where you want to update, but not lose your installed user apps and data, you would edit the script and remove the "-w" augment. In this case, you are returning to stock and you should perform the wipe (-w).
The dot slash (./) that preceeds the flash-all.sh tells the bash interpreter (what runs commands you give) that the file is right here, in this directory.
The flash-all.sh is a standalone script (series of written instructions) and calls fastboot from within it.
Thanks for sticking with me on this ktmom!
OK, i've used both
Code:
chmod +x ./flash-all.sh
and
Code:
sudo chmod +x ./flash-all.sh
but still getting the permission denied error when i launch ./flash-all.sh
I'll do a screencast vid walking through the entire process i'm following, so that you can see what i'm up too and in case it gives any further clues for a solution.
Thanks again!
ktmom said:
You need to give the "flash-all.sh" script execution rights (that is why the permission denied error). Use this code:
Code:
chmod +x ./flash-all.sh
You may need super user/root rights:
Code:
sudo chmod +x ./flash-all.sh
The "flash-all.sh" script is a stand-alone script that sequentially flashes the entire factory package. As was mentioned in another repsonse in this thread, in cases where you want to update, but not lose your installed user apps and data, you would edit the script and remove the "-w" augment. In this case, you are returning to stock and you should perform the wipe (-w).
The dot slash (./) that preceeds the flash-all.sh tells the bash interpreter (what runs commands you give) that the file is right here, in this directory.
The flash-all.sh is a standalone script (series of written instructions) and calls fastboot from within it.
Click to expand...
Click to collapse
@ptm, No worries, I'll do my best to help. I'm typing this on a chromebook that I also use to fastboot to a P3XL.
Edit 1:
Just to make sure:
1) The bootloader is unlocked?
2) "fastboot devices" returns the serial number of your device?
3) you are running ./flash-all.sh command as root or as the default user? In other words, the same way that fastboot devices returns the serial number. Either sudo fastboot devices or just fastboot devices.
4) if you enter the linux command: ls -al flash-all.sh do you get something like:
-rwxr-xr-x. 1 chronos chronos 957 Jul 18 2019 flash-all.sh
In this example -rwxr-xr-x is depicting the file permissions where there are three groupings; owner group everyone else. The first rwx means read, write and execute permissions for the file owner. Others in the same group and everyone else has read and execute permissions. Execute (x) is required in order for a script to run. If your file does not have three x so that all three groups have permission to execute it, then we need to revisit that.
Edit 2:
Another thought that could be affecting you is ADB and Fastboot are old. in your crosh shell, type:
Code:
[email protected] ~ $ adb --version
Android Debug Bridge version 1.0.41
Version 29.0.5-5949299
[email protected] ~ $ fastboot --version
fastboot version 29.0.5-5949299
Installed as /usr/local/bin/fastboot
If either returns a version older than the output above, then the easy way to update these is to use the script on Nathan Chance's Githuib. This might look a little overwhelming but it's pretty easy. I suggest you read the page, but the operative information is in section 4. Run the setup script:
To install, run
Code:
curl -s https://raw.githubusercontent.com/nathanchance/chromeos-adb-fastboot/master/install.sh | bash
in your shell prompt.
This script very nicely updates your ADB/Fastboot to the newest version which will be required for your P4XL
Are you guys sure you aren't making it too hard? You don't have to give any commands to install the full image. Download the full image and put it into an empty folder, go ahead and extract it in that folder. Create another new folder, Copy everything into it so you still have the full image in the first folder. Now download the tools and put those into a folder and extract them in that folder. Take the entire contents of that folder and add it to the folder you copied the extracted image into. What you should have now is one folder that still has the full extracted image, one that has the full extracted tools, and one that has both. If you have not already done so the phone should have debugging enabled and oem should be on. Go ahead and put it into bootloader mode and plug it in, type cmd in the path bar of the folder with both tools and image and check devices which will tell you if the tools can see the phone. If you get your serial the tools can see the phone. If you're going to wipe you can go ahead and click the flash-all and it will start the process, you do not give any commands. If you don't want to wipe the edit the flash-all to remove the-w, save it, and click on it. Again, no command is given, you just click and the flash-all does the rest.
Edit... And dont forget, A to C, not the provided C to C.
krabman said:
Are you guys sure you aren't making it too hard? You don't have to give any commands to install the full image. Download the full image and put it into an empty folder, go ahead and extract it in that folder. Create another new folder, Copy everything into it so you still have the full image in the first folder. Now download the tools and put those into a folder and extract them in that folder. Take the entire contents of that folder and add it to the folder you copied the extracted image into. What you should have now is one folder that still has the full extracted image, one that has the full extracted tools, and one that has both. If you have not already done so the phone should have debugging enabled and oem should be on. Go ahead and put it into bootloader mode and plug it in, type cmd in the path bar of the folder with both tools and image and check devices which will tell you if the tools can see the phone. If you get your serial the tools can see the phone. If you're going to wipe you can go ahead and click the flash-all and it will start the process, you do not give any commands. If you don't want to wipe the edit the flash-all to remove the-w, save it, and click on it. Again, no command is given, you just click and the flash-all does the rest.
Edit... And dont forget, A to C, not the provided C to C.
Click to expand...
Click to collapse
What Tools do you need to do this?
Same page as the images, scroll up from them and in the description of the process they have a link to the platform tools.
@krabman, Since this is using a chromebook, not a PC, things are flakier than normal. I just replicated the problems experienced by @ptm and some of it is due to old ADB/Fastboot as described in my previous post. Some is because ChromeOS made a change in an update that mounts nearly all of the partitions noexec, which means scripts can not execute and give the reported, "no permissions" error. There is a workaround since /usr/local is mounted executable. It's also possible to remount a partition with exec permissions.
@ptm, as the easiest route, I suggest making sure the ABD is current using the script I linked yesterday, and then going back to the OTA sideload method. I tanked my phone for a few hours yesterday trying to make fastboot get through the entire system image. I finally resorted to my full ubuntu install on my chromebook.
airmaxx23 said:
What Tools do you need to do this?
Click to expand...
Click to collapse
A general Fastboot/ADB tutorial is available here. If you are not using a chromebook, this thread's discussion will just add confusion.
If you are using a chromebook, then you need to enter a crosh shell, make sure adb and fastboot are updated as described in an earlier post and read the rest of the information I posted about the associated problems.
My understanding is the sh should flash on chrome with the latest tools as I described and you use the bat for PC. If the device is down he would have nothing to lose trying, if not I'd be leery of trying it since a partial flash will definitely result in a softie. Of course the possibility that I don't fully understand it may explain my puzzlement.
ktmom said:
A general Fastboot/ADB tutorial is available here. If you are not using a chromebook, this thread's discussion will just add confusion.
If you are using a chromebook, then you need to enter a crosh shell, make sure adb and fastboot are updated as described in an earlier post and read the rest of the information I posted about the associated problems.
Click to expand...
Click to collapse
Thanks, I know how to use ADB on the PC but I have a ChromeBook that I'd like to use as well. I already have it in Developer Mode.
I got it working, I just to run the script to update ADB and Fastboot.
airmaxx23 said:
Thanks, I know how to use ADB on the PC but I have a ChromeBook that I'd like to use as well. I already have it in Developer Mode.
When I open a Crosh Window, type shell, then adb devices my Pixel 4 XL shows up but I get: no permissions; see [http://developer.android.com/tools/device.html]
Click to expand...
Click to collapse
My bet is your ADB/fastboot are to old. Go back to post 9 and read the lower portion under edit2. You should also read forward from that point as there are additional issues that ChromeOS introduced with the noexec mounting of partitions. It will mean that without a workaround, you can not execute the flash-all.sh.
ktmom said:
My bet is your ADB/fastboot are to old. Go back to post 9 and read the lower portion under edit2. You should also read forward from that point as there are additional issues that ChromeOS introduced with the noexec mounting of partitions. It will mean that without a workaround, you can not execute the flash-all.sh.
Click to expand...
Click to collapse
Hey there,
SO i decided to try the OTA sideload method on a friends PC - i got the following response through CMD prompt
Code:
C:\Users\LYALL\Downloads>adb sideload ota-file.zip
Total xfer: 1.00x 1
However the phone is reporting a failure verifying the file signature and giving
Code:
E: Error code: 21
What do you think is causing that? I saw that Google has a new browser based flash tool to allow for AOSP builds to flash - would using that work better for me do you think?
ptm
ptm said:
Hey there,
SO i decided to try the OTA sideload method on a friends PC - i got the following response through CMD prompt
Code:
C:\Users\LYALL\Downloads>adb sideload ota-file.zip
Total xfer: 1.00x 1
However the phone is reporting a failure verifying the file signature and giving
Code:
E: Error code: 21
What do you think is causing that? I saw that Google has a new browser based flash tool to allow for AOSP builds to flash - would using that work better for me do you think?
ptm
Click to expand...
Click to collapse
Make sure you have downloaded the correct OTA and for crosshatch coral. Use the sha256 checksum provided in the download page and ensure the file is not corrupted. I check the integrity of the file before using it especially if I've moved it since the last verification.
You are rebooting to recovery (not rescue mode) and using the OTA sideload action from *within* recovery, before using the adb command, right?
The Google update and repair tool is an option.
ktmom said:
Make sure you have downloaded the correct OTA and for crosshatch. Use the sha256 checksum provided in the download page and ensure the file is not corrupted. I check the integrity of the file before using it especially if I've moved it since the last verification.
You are rebooting to recovery (not rescue mode) and using the OTA sideload action from *within* recovery, before using the adb command, right?
The Google update and repair tool is an option.
Click to expand...
Click to collapse
I think Pixel 4 XL is Coral, not Crosshatch.
I have downloaded the OTA file thats third from the bottom on this page (https://developers.google.com/android/ota) which is the rom number - 10.0.0 (QQ1B.200105.004, Jan 2020).
Yes, followed the instructions and booted to recovery, selected 'update from adb' from within recovery and then checked
Code:
adb devices
to ensure it showed 'sideload'. I then ran the command
Code:
adb sideload ota_file.zip
The transfer seemed to work fine, but then i got the error above showing on the device.
I cant seem to use the Google update and repair tool, as I'm in the UK and it says its not supported.
I can get it working with a VPN but the carrier i'm on doesnt show, although i do have the option of selecting 'other' as the carrier - I'm happy to give that a go, but wanted to get your thoughts on it first. Will selecting carrier as 'other' work ok for a UK based phone?
ptm