Fastboot [Ubuntu]? - Nexus 5 Q&A, Help & Troubleshooting

Alright not really a question as much of a just wondering why. I've asks before and got 0 replies but I'm still hopeful as to an answer. When using fastboot for anything other than fastboot devices which will properly display the connected device I must run sudo ./fastboot. From there it doesn't matter whether it sudo ./fastboot flash recovery...or sudo ./fastboot flash system...what I'm getting at is why must I type sudo ./fastboot before every command as opposed to just typing fastboot flash. It also doesn't matter which directory I'm in I can use fastboot from anywhere in the terminal as long as I use sudo ./fastboot it will work without the sudo ./ it will not work regardless if I'm in the fastboot folder or not.

Beamer9408 said:
Alright not really a question as much of a just wondering why. I've asks before and got 0 replies but I'm still hopeful as to an answer. When using fastboot for anything other than fastboot devices which will properly display the connected device I must run sudo ./fastboot. From there it doesn't matter whether it sudo ./fastboot flash recovery...or sudo ./fastboot flash system...what I'm getting at is why must I type sudo ./fastboot before every command as opposed to just typing fastboot flash. It also doesn't matter which directory I'm in I can use fastboot from anywhere in the terminal as long as I use sudo ./fastboot it will work without the sudo ./ it will not work regardless if I'm in the fastboot folder or not.
Click to expand...
Click to collapse
If I understand well, you are asking why you have to use sudo. "Under GNU/linux systems (and specifically under Ubuntu systems), regular users can't directly access USB devices by default. The system needs to be configured to allow such access."
https://source.android.com/source/initializing.html check "Configuring USB Access"

I see what you're saying I've done that during my build environment setup. I should go on to say I have to use sudo for every command its not a insert once put password in and then run with it deal so it would go something like this
sudo ./fastboot flash recovery
Insert superuser password
Command done.
Now I can't go on to do
fastboot flash radio
fastboot flash system....and so on.
I must still
sudo ./fastboot flash....
sufo ./fastboot flash...
All the way down the line which I find odd. It does however work its just something I was wondering I could eliminate somehow.
Also this is all being done in same terminal I'm not running command closing opening new terminal.

Beamer9408 said:
I see what you're saying I've done that during my build environment setup. I should go on to say I have to use sudo for every command its not a insert once put password in and then run with it deal so it would go something like this
sudo ./fastboot flash recovery
Insert superuser password
Command done.
Now I can't go on to do
fastboot flash radio
fastboot flash system....and so on.
I must still
sudo ./fastboot flash....
sufo ./fastboot flash...
All the way down the line which I find odd. It does however work its just something I was wondering I could eliminate somehow.
Also this is all being done in same terminal I'm not running command closing opening new terminal.
Click to expand...
Click to collapse
What error message you get when you just use fastboot instead of sudo ./fastboot?

No error just waiting on device. I believe I get a toast message error on the phone but I'm not positive what it says.

Beamer9408 said:
No error just waiting on device. I believe I get a toast message error on the phone but I'm not positive what it says.
Click to expand...
Click to collapse
I've never seen a toast message in bootloader. Are you booted into the OS when running fastboot commands or in bootloader?

Errr.. I don't use Ubuntu, but I sure as hell don't need sudo to run fastboot commands.

Beamer9408 said:
No error just waiting on device. I believe I get a toast message error on the phone but I'm not positive what it says.
Click to expand...
Click to collapse
Well if that so, then you did not give permission for your user name on ubuntu to access the usb device.
I used this guide to give permission http://forum.xda-developers.com/showthread.php?t=921169

I don't think I have to use fastboot as sudo either and I'm running Ubuntu 14.10 64 bit. It may be a permissions thing on your system only.

Related

[Q] Root Xoom with linux ?

i ditched windows ages ago and i will never look back i am sick and tierd of waiting on moto uk to push ics. i use to have the dell streak and i rooted that but i was on windows then how do i root my xoom with linux mint is it possible and can any point me in the right direction please
Stand by, I will give you all the tools and options you need to do so, I could draft something tomorrow morning.
Sent from my PG86100 using Tapatalk
Thank you megabiteg Still learning linux but i Love it
megabiteg said:
Stand by, I will give you all the tools and options you need to do so, I could draft something tomorrow morning.
Sent from my PG86100 using Tapatalk
Click to expand...
Click to collapse
well, it isn't that hard since everything you really need on your computer ist fastboot and a way to push a file to an sdcard (fat formatted)...
Just go here, download and install the android sdk from there. Make sure the commands adb and fastboot are in your path. (test by issuing adb devices, shold return a list of attached android devices with usb debugging turned on)
After that, just follow these instructions. I am not sure if you need to run fastboot as root, but you'll see
Cheers for the info just by any chance do you know the commands still learning Linux
llama-power said:
well, it isn't that hard since everything you really need on your computer ist fastboot and a way to push a file to an sdcard (fat formatted)...
Just go here, download and install the android sdk from there. Make sure the commands adb and fastboot are in your path. (test by issuing adb devices, shold return a list of attached android devices with usb debugging turned on)
After that, just follow these instructions. I am not sure if you need to run fastboot as root, but you'll see
Click to expand...
Click to collapse
elsworth1983 said:
Cheers for the info just by any chance do you know the commands still learning Linux
Click to expand...
Click to collapse
thought you ditched windows ages ago?
anyhow... don't have linux set up atm, so this will from memory and might contain some errors... Also, never tried mint, I always stuck to debian or debian-derivates...
anyhow, lets try this:
first, use your package management-system to install a jre (java runtime environment.
If that is set up, install the android sdk:
Code:
$ cd ~
$ wget http://dl.google.com/android/android-sdk_r17-linux.tgz
$ sudo su
[enter your su-password]
# cd /usr/local
# tar xfzv ~[yourusername]/android-sdk_r17-linux.tgz
# ./android-sdk-linux/tools/android
a window should open up and list some files available for download. Just select "Android SDK Platform-tools" and hit "Install 1 package...".
once that's finished (might take a while), close the Android SDK Manager and you should get back to your shell.
Code:
# ln -s /usr/local/android-sdk-linux/platform-tools/adb /usr/local/bin/adb
# ln -s /usr/local/android-sdk-linux/platform-tools/fastboot /usr/local/bin/fastboot
# exit
$ rm android-sdk_r17-linux.tgz
now, connect your xoom to your computer and enable usb debugging in the settings of your xoom. If you issue adb devices, you should get something like
Code:
List of devices attached
043c12343456476547 device
if you receive something like bash: adb: command not found, something went wrong somewhere. Try the same using sudo: sudo adb devices if that doesn't fix it please write another post.
Also, if you encounter an error after entering any of the comments above, please do not continue until you resolved that error. (For example ask for a solution here)
And, since you are still learning to use linux: whenever instructions contain a $ or # at the beginning of a line, DO NOT ENTER THESE. They are just there to tell you to issue that command as normal user ($) or superuser (#)
/EDIT: btw: there may be an easier way to do this if you just want to use adb/fastboot this once: you could try to simply download the adb and fastboot- binaries and put these into the folder with your recovery.img-file. Might work, not sure about that, though. Also, since I don't have linux installed on my machine atm, I can't provide you with a link to these binaries.
cheers for all your help will give this a go "Dont want to back to windows
Android SDK manger log
Error Stopping ADB server failed (code-1)
Connected the xoom and did adb devices and it listed the xoom with no errors in the terminal Thank you again ? Were do i go from here now
glad to read it's working
just follow the instructions in this thread That will help you to install a custom recovery and root your xoom. It will not, however, install a custom rom. To do that, you'd also need to download a custom rom (usually comes in a flashable .zip-file), place that on an acutal sd-card which you're gonna put into your xoom, and install that file from within the custom recovery. Just make sure you grab a rom that works with your xoom (for example, you shouldn't put a us-4g-rom onto a wifi-only-xoom and vice versa)
have i done something wrong
god-WE174AA-ABU-s5306uk god # adb reboot bootloader
god-WE174AA-ABU-s5306uk god # fastboot oem unlock
fastboot: command not found
The problem i seem to be having is when the xoom is on i type <adb reboot bootloader> The xoom reboots to the fastboot screen after that no commands work and when i do ADB devices in the terminal the device list is empty ?
elsworth1983 said:
have i done something wrong
god-WE174AA-ABU-s5306uk god # adb reboot bootloader
god-WE174AA-ABU-s5306uk god # fastboot oem unlock
fastboot: command not found
Click to expand...
Click to collapse
have you done the # ln -s /usr/local/android-sdk-linux/platform-tools/fastboot /usr/local/bin/fastboot? The error you're getting seems to suggest that it can't find the fastboot application? What happens if you type /usr/local/android-sdk-linux/platform-tools/fastboot oem unlock?
elsworth1983 said:
The problem i seem to be having is when the xoom is on i type <adb reboot bootloader> The xoom reboots to the fastboot screen after that no commands work and when i do ADB devices in the terminal the device list is empty ?
Click to expand...
Click to collapse
that is expected. adb is only available while android is booted up, fastboot is the protocol to use while in bootloader mode. As indicated before, I suspect that your computer can't find the fastboot application (on the computer).
Cheers for all the info i went back and started all from the top again only thing i am struggling with is Flashing the recovery now lol i get
god-WE174AA-ABU-s5306uk god # adb reboot bootloader
god-WE174AA-ABU-s5306uk god # fastboot flash recovery recovery-solarnz-100611-1150.img
error: cannot load 'recovery-solarnz-100611-1150.img'
I have it on a memory card which i checked which was working
elsworth1983 said:
Cheers for all the info i went back and started all from the top again only thing i am struggling with is Flashing the recovery now lol i get
god-WE174AA-ABU-s5306uk god # adb reboot bootloader
god-WE174AA-ABU-s5306uk god # fastboot flash recovery recovery-solarnz-100611-1150.img
error: cannot load 'recovery-solarnz-100611-1150.img'
I have it on a memory card which i checked which was working
Click to expand...
Click to collapse
The recovery image needs to be on your pc. It doesn't matter where on your pc as long as you can access it and know where it is.
Fastboot works by sending the image over the usb cable. Once you start flashing roms, those will need to be on your sd card within the xoom.
all i can say is thank you for all the information every 1 is giving me my head is mashed lol so if i put recovery-Tiamat-R4c-100611-1150-cwm.img on the desktop what would the terminal code be
kofrad said:
The recovery image needs to be on your pc. It doesn't matter where on your pc as long as you can access it and know where it is.
Fastboot works by sending the image over the usb cable. Once you start flashing roms, those will need to be on your sd card within the xoom.
Click to expand...
Click to collapse
depends on where your desktop is If it is in ~/Desktop/, then the correct command should be
Code:
fastboot flash recovery ~/Desktop/recovery-Tiamat-R4c-100611-1150-cwm.img
error: cannot load '/root/Desktop/recovery-Tiamat-R4c-100611-1150-cwm.img'
ARRRR i am really loosing the will to live ;-)
What am doing so wrong its lucky am not bold yet been trying this all day
elsworth1983 said:
error: cannot load '/root/Desktop/recovery-Tiamat-R4c-100611-1150-cwm.img'
ARRRR i am really loosing the will to live ;-)
Click to expand...
Click to collapse
if the graphical interface, where do you see the file located?
elsworth1983 said:
error: cannot load '/root/Desktop/recovery-Tiamat-R4c-100611-1150-cwm.img'
ARRRR i am really loosing the will to live ;-)
Click to expand...
Click to collapse
Sounds to me like you are running the commands as root. You likely have also downloaded the recovery image as a normal user. This means the '~' shortcut for the home directory is pointing you to someplace where the file is not.
Try using "fastboot flash /home/Your username/Desktop/recovery-Tiamat-R4c-100611-1150-cwm.img"
I have put the file on the desktop ? is that what u mean

ADB not recognized

So I finally undated my PC from Ubuntu 12.04 to 16.04. The good new is I have full MTP access to my G3 now. However, ADB is no longer recognized. ADB and Fastboot are located on a separate drive from the OS, so I am trying to run the same file from the same HD. Any suggestions?
You need to run adb in root. Are you doing that?
Sent from my SM-T530NU using XDA-Developers mobile app
How are you trying to use ADB? It doesn't work when your phone is on fastboot mode
Tel864 said:
You need to run adb in root. Are you doing that?
Sent from my SM-T530NU using XDA-Developers mobile app
Click to expand...
Click to collapse
I did try that without success even though I successfully ran ADB without root with 12.04. Only Fastboot needed root.
For some reason the file is not recognized as an executable file. Below is a screen copy:
Code:
$ ls
adb fastboot twrp-osprey-3.0.0-r2.img
commands.txt twrp-osprey-2.8.7-r5.img twrp-osprey-3.0.2-r1.img
$ adb
The program 'adb' can be found in the following packages:
* adb
* android-tools-adb
Try: sudo apt install <selected package>
$
Henriquefeira said:
How are you trying to use ADB? It doesn't work when your phone is on fastboot mode
Click to expand...
Click to collapse
I have not even got that far. See post above, "adb" is not recognized. I would rather not install the adb development package if I can avoid it.
Its fastboot flash recovery not adb flash
Henriquefeira said:
Its fastboot flash recovery not adb flash
Click to expand...
Click to collapse
The commands is not my issue. I have a list of commands I have run successfully many times. My issue is with the new OS (in the same PC) not recognizing adb. When I boot to the old OS, no issue, back to the new OS, command is not recognized..
My list of commands is as follows:
Code:
adb devices
adb reboot bootloader
sudo fastboot devices
sudo fastboot boot twrp-osprey-3.0.2-r1.img
Henriquefeira said:
Its fastboot flash recovery not adb flash
Click to expand...
Click to collapse
Re-reading your reply, I think you mis-read my code box. Next to the dollar sign my command "ls". Below is the OS response. Next $, command is "adb", and below the OS response.
I figured it out. So in Ubuntu 16.04 my command needs to be:
"./adb"
where in 12.04 "adb" worked.
MrTooPhone said:
I figured it out. So in Ubuntu 16.04 my command needs to be:
"./adb"
where in 12.04 "adb" worked.
Click to expand...
Click to collapse
This implies execution from the current directory... Are you sure you don't have multiple 'adb' executables installed? Check the command 'which adb' to see.
Sent from my MotoG3 using Tapatalk
acejavelin said:
This implies execution from the current directory... Are you sure you don't have multiple 'adb' executables installed? Check the command 'which adb' to see.
Sent from my MotoG3 using Tapatalk
Click to expand...
Click to collapse
Pretty sure I had multiple 'adb' executables in 12.04.
i really could use some help friends im having problems with adb on windows when my device is on adb can see it of course
C:\adb>adb devices
List of devices attached
ZY22236P94 device
the problem is when its in bootloader mode adb cant seem to see it i have all drivers installed and i cant understand why im getting this error i want to install a recovery and i cant i currently have know recovery installed and i really need to rest my phone cause of a lot of software issus this is the message that get when bootloader mode
C:\adb>adb devices
List of devices attached
it shows nothing attached on windows devices manager it shows motorola adb interface connectad and running fine so i cant understand what im doing wrong please i really need some help here mates
steffano said:
i really could use some help friends im having problems with adb on windows when my device is on adb can see it of course
C:\adb>adb devices
List of devices attached
ZY22236P94 device
the problem is when its in bootloader mode adb cant seem to see it i have all drivers installed and i cant understand why im getting this error i want to install a recovery and i cant i currently have know recovery installed and i really need to rest my phone cause of a lot of software issus this is the message that get when bootloader mode
C:\adb>adb devices
List of devices attached
it shows nothing attached on windows devices manager it shows motorola adb interface connectad and running fine so i cant understand what im doing wrong please i really need some help here mates
Click to expand...
Click to collapse
adb doesn't work in bootloader mode, that is when you use fastboot... I think you should review the process involved in installing recovery.
Sent from my MotoG3 using Tapatalk

(SOLVED) sudo fastboot devices tablet not found in fastboot.

I am trying to flash the battery.dtb file to this shield tablet. It charges so slow. With a 2.0 charger it depletes the battery faster than you can charge it. I am using Linux Mint. I just started using Linux about a week ago. Before that I have never used any form of it. So, I am very new to this. In Windows I used to be able to flash stuff in fastboot no problem. However, I no longer have a Windows PC.
I have everything installed correctly. I can see the device with adb devices. The problem is when I reboot in the bootloader. I type sudo fastboot devices and I get nothing. If I go into recovery and type it I get a response. However, if I try to flash it there it fails. Can someone please help me get this file flashed. I have been working on this for about 13 hours straight and I 100% cannot figure it out. I have searched up about a million pages. I cannot find anything to fix this.
I figured it out.
In software manager install.
android-tools-adb
android-tools-fastboot
Download unzip it in your downloads folder.
Download your battery dtb file unzip and pit it in the platform-tools folder.
Enable USB debugging on your phone or tablet.
In terminal type sudo cd /home/rocky/Downloads/platform-tools
Type sudo adb devices. You should see a device number.
Type sudo adb fastboot reboot bootloader
Type sudo fastboot devices
Type sudo fastboot flash dtb xxxxx.zip. xxxxx.zup is the name of your batty dtb file.
You should see your file being transferred.
Once complete type exit and reboot phone or tablet.

I need help with ADB/Fastboot commands from a powers shell window

i am very new so please speak to me like i have 50 IQ points (im actually not far off). i can get the powershell to open on my pc then when i try
PS C:\platform-tools> adb devices
List of devices attached
R9WN113HXVJ device
it works, but when i try any commands that start with fastboot, the window just hangs. Do i need to be in the bootloader for fastboot? does TWRP need to be installed first?
#2. I am trying to get an image off of my tablet and the tutorial says i need to enter....
" adb pull /sdcard/Download/magisk_patched.img " I am assuming its supposed to mean....
"adb pull /sdcard/Download/NAME OF FILE ON TABLET.tar"... which is "magisk_patched_ZRwve.tar"
if i am trying to "pull" from the tablet, where does it put this file on my PC?
scampo77 said:
i am very new so please speak to me like i have 50 IQ points (im actually not far off). i can get the powershell to open on my pc then when i try
PS C:\platform-tools> adb devices
List of devices attached
R9WN113HXVJ device
it works, but when i try any commands that start with fastboot, the window just hangs. Do i need to be in the bootloader for fastboot? does TWRP need to be installed first?
#2. I am trying to get an image off of my tablet and the tutorial says i need to enter....
" adb pull /sdcard/Download/magisk_patched.img " I am assuming its supposed to mean....
"adb pull /sdcard/Download/NAME OF FILE ON TABLET.tar"... which is "magisk_patched_ZRwve.tar"
if i am trying to "pull" from the tablet, where does it put this file on my PC?
Click to expand...
Click to collapse
No worries friend, everyone starts somewhere and IQ is not a real scientific measurement. Now let's clear some things:
You're not in fastboot mode if you didn't recognize it immediately. To enter fastboot from adb, use:
Code:
adb reboot fastboot
and no you don't need twrp to access fastboot mode.
The correct way to use pull looks like this:
Code:
adb pull <path of file to pull> <path of destination on pc>
for example:
Code:
adb pull /sdcard/Download/YOURFILENAME C:\platform-tools\
Also from context of your question, i assume you want to root your phone. Something helpful to remember, you don't need to flash TWRP to root, you can just boot into it without permanently changing your recovery by using this command in fastboot:
Code:
fastboot boot nameoftwrp.img
from there flash magisk and you're done
Slim K said:
No worries friend, everyone starts somewhere and IQ is not a real scientific measurement. Now let's clear some things:
You're not in fastboot mode if you didn't recognize it immediately. To enter fastboot from adb, use:
Code:
adb reboot fastboot
and no you don't need twrp to access fastboot mode.
The correct way to use pull looks like this:
Code:
adb pull <path of file to pull> <path of destination on pc>
for example:
Code:
adb pull /sdcard/Download/YOURFILENAME C:\platform-tools\
Also from context of your question, i assume you want to root your phone. Something helpful to remember, you don't need to flash TWRP to root, you can just boot into it without permanently changing your recovery by using this command in fastboot:
Code:
fastboot boot nameoftwrp.img
from there flash magisk and you're done
Click to expand...
Click to collapse
i am being told that there is no fastboot for Samsung devices, however your commands within powershell all worked, i managed to drag my file over. thank you!
you said "now flash magisk" like its something everyone knows. I have magisk manager on my tablet now and I have a magisk.zip on my PC. I am using a program called ODIN for flashing Samsung devices but i cant seem to put all of these pieces together to root or flash my phone.
any advice?

Question All kinds of errors when flashing a rom

I use the command fastboot -w update insert rom.zip or fastboot -w also fastboot update rom name.zip does not work. I use minimal adb fastboot I can't seem to sideload any roms even with the current build. What is going on? I get invalid sparse then failed within 20 seconds. Yes, I am in the bootloader screen and my phone is bootloader unlocked. Ones like StagOS for example or the more recent roms. I have no problem with Graphene OS or Caylx OS though.
UltimateGamer83 said:
I use the command fastboot -w update insert rom.zip or fastboot -w also fastboot update rom name.zip does not work. I use minimal adb fastboot I can't seem to sideload any roms even with the current build. What is going on? I get invalid sparse then failed within 20 seconds. Yes, I am in the bootloader screen and my phone is bootloader unlocked. Ones like StagOS for example or the more recent roms. I have no problem with Graphene OS or Caylx OS though.
Click to expand...
Click to collapse
Because you're not supposed to use "Minimal ADB and Fastboot". The binaries inside that package are years old. No wonder you're getting all those errors and have issues while trying to flash a ROM that is straightforward.
Download the latest platform-tools from Android's website (google).
Also, make sure that you're not using Windows PowerShell, but the actual CMD.
ekin_strops said:
Also, make sure that you're not using Windows PowerShell, but the actual CMD.
Click to expand...
Click to collapse
What is the reasoning behind this? I pretty much always use PS, guess I'll have to stop?
It being PowerShell or cmdline is irrelevant. Anyways..
Well, you should be using the latest platform-tools and have it added to PATH. A lot of unofficial drivers floating around on the internet install outdated adb/fastboot along with the drivers. Please refrain from installing these as well as minimal adb & fastboot; Use the official google driver and official platform-tools instead.
Alternatively you can prefix each adb/fastboot cmd with ./ while in the platform-tools folder via powershell or bash, etc.
For example:
./adb sideload ./rom.zip
Or
./fastboot -w update ./rom.zip
This tells the shell "Hey, I want to execute this local file, not the one in PATH".

Categories

Resources