Linux fastboot no devices

ADB device list doesn’t show phone

I’ve enabled debugging in the phone settings. I think am doing it wrong— I don’t know. Please explain me the correct process. Using Ubuntu 16.01. Device: Yu Yuphoria Update edit: After all the frustrating attempts It’s still not detected in adb . However in fastboot mode, adding the vendor id command for my device, fastboot -i 0x2a96 devices as found mentioned here works

fastboot -i 0x2a96 devices 

Other commands in fastboot mode, as instructed in the same page mentioned above, works too when vendor id command option was added.

When you enable USB debugging in the phone, then attach it via USB, you should get a prompt asking if you want to allow the PC to debug the phone, and it will show you the PC’s RSA key to identify it.

9 Answers 9

Finally got the device detected in adb under adb devices command by restarting adb server with root privilege as mentioned here in the Troubleshooting adb section.

sudo adb kill-server sudo adb start-server 

After this adb devices returned

with a prompt on device for RSA authorize. After authorizing

Also note that it might be necessary to unplug and plug the USB again. And if you don’t get the initial authorization prompt on your phone, it won’t work.

-1 to this answer, just adds noise. Just check, perfect answer: android.stackexchange.com/a/144967/110742 There’s no need to repeat everything, considering this is a very requested issue and there’s dozens of questions about it.

You installed the adb program correctly. The Android Debugging isn’t activated by default. The activation option is hidden. You’ll have to reveal it with these steps:

Goto Settings -> About phone -> (scroll to) Build number -> (Tap on it about 7 times) -> (You should get a notice You have enabled the development settings)

Now you will have a new menu item in settings called Developer options.

Go into this option and turn on the USB debugging option.

Now when you plug in the USB cable to the computer, you’ll get the prompt to Authorize the connected computer.

After the debugging is turned on you may have to restart the server. You can do that with these commands:

$ adb kill-server $ adb start-server 

I’ve already turned on the ‘USB debugging’ option — but not getting any prompt on connecting to the computer

@red_speck When you connect your device, do you get a usb file browser of the content, or the option to view the content? Also, try starting restarting the adb server with the kill-server and start-server added to my answer.

I don’t get this clearly «do you get a usb file browser of the content, or the option to view the content?» but if I guess what you mean, I think it’s the usb file browser (I can browse through the files of the phone — I’ve used all three available options to connect USB for my device — MTP, PTP and charge only). I’ve tried restarting the adb with your said commands.

To set up device detection on Ubuntu Linux:

Using sudo , create this file: /etc/udev/rules.d/51-android.rules .

Читайте также:  Create sudo users linux

Use this format to add each vendor to the file:

SUBSYSTEM=="usb", ATTR=="0bb4", MODE="0666", GROUP="plugdev" 

In this example, the vendor ID is for HTC. The MODE assignment specifies read/write permissions, and GROUP defines which Unix group owns the device node.

If you do not know your vendor ID, you can get this from lsusb , it is the string after ID. If lsusb doesn’t report your device, try checking grep USB /var/log/kern.log | less for vendor ID (for example, a line New USB device found, idVendor=1bbb, idProduct=0167 ).

Once you have created/updated the 51-android.rules file, execute:

sudo chmod a+r /etc/udev/rules.d/51-android.rules 

Then restart udev with sudo service udev restart or sudo /etc/init.d/udev restart

I did all this, (vendor id for my device 2a96) and also created adb_usb.ini file in .android from this post

To help others — the vendor ID is the first 4 characters i.e. ID 18d1:4ee7 vendor ID is 18d1 Also — You may think it has not worked but it took a minute after restarting the server before my phone was detected. And finally, I found a list of vendor codes here -. gist.github.com/jdamcd/6054951

The best way to detect the vendor ID is to run lsusb twice : with and without the mobile phone connected and then compare what’s missing.

Make sure you have a good USB cable and are plugged into a good port. This was always the problem I experience when using ADB and fastboot. Also make sure you update and have the latest ADB drivers.

Agreed, after an entire day spent getting frustrated with my computer and phone, it turned out that the cable was the reason they weren’t talking.

Gilberto Albino gave me a clue.
Nobody tells you that some usb cables are only good for charging devices, not for transferring data. You have to figure out which you have for yourself.
I think the charge-only cables are thinner.

I had the same problem, and after trying all voodoos available on the internet, I found out by myself that the device is only recognizable by the vendor USB cable that accompanies the device.

I’m not yet sure why this happens, but with my test device, it’s only recognized if I accept temporarily the debugging request. If I check the «always allow from this computer» it will vanish from adb devices .

In my case, I solved the problem changing the USB cable.

It is a surprise, but I noted device not showing windows after USB connection and just a message «connected for charge«. The device connect only for energy charge. The device not was showing the device folder in computer too. I changed the cable and the problem dissappear instantaneously. I use Debian (Linux).

Enable USB debugging on the device

This is done in Settings › Development. If you don’t have that entry in your settings menu, go to Settings › About, scroll to the «Build number», and hammer it like a monkey until your device congratulates you having become a developer. Go back to the main page of the Settings menu, and close to the bottom you should see the «Development» (or «Developers») settings now. Enter it, and enable USB Debugging here.

Identify the device

First we need to know how the device identifies on the USB bus. For that, with the Android device NOT connected, grab a shell and run the command lsusb . Then connect the device and run the command again. Spot the new line. For the Wileyfox Swift this is a «nameless device»:

Bus 004 Device 003: ID 2970:2282 

Setting up the rules for ADB

We now need the numbers at the end of the above line: 2970:2282 . These specify the vendor (2970) and the device itself (2282). Having those details, we need a root shell on our Linux machine to edit (or create, if it doesn’t yet exist) the /etc/udev/rules.d/51-android.rules file. In there, add a line for your device. Following example line shows how it looks for the Wileyfox Swift:¹

SUBSYSTEMS=="usb", ATTRS=="2970", ATTRS=="2282", MODE="0666" GROUP="androiddev", SYMLINK+="android%n" 

If you have a different device, replace the vendor and product IDs with what you’ve found above when running lsusb . A short explanation of the line:

  • SUBSYSTEMS==»usb» : obviously this rule is for USB only 😉
  • ATTRS==»2970″ : the vendor ID of the device this rule is for
  • ATTRS==»2282″ : the device ID
  • MODE=»0666″ : permissions the device node shall get. 0666 is quite lax, giving every user on your system read and write permission – so if you’re concerned, you might try replacing that with a 0660 (giving only owner and group read-write, and deny everything to others).
  • GROUP=»androiddev» : which group the device node should belong to. This should be a group the users intended to work with the device belong to.
  • SYMLINK+=»android%n» : just to give the node a nice name, so you can find it easier in /dev (in my case, it later showed up there as /dev/android5 )
Читайте также:  Linux mint mate оболочка

That rule entered in /etc/udev/rules.d/51-android.rules , we must tell udev to make use of it. Safest way (next to a reboot 😉 is restarting the udev service. Depending on your Linux distro, this can be done either via service udev restart or /etc/init.d/udev restart .

Done that, leave the root shell. Disconnect and reconnect your Android device, try adb devices again. Most devices showed up now, but not the Wileyfox Swift – which obviously wants some extra cuddles. If you’re in that situation, open (or create if it doesn’t exist) the file ~/.android/adb_usb.ini and add a single line to it, naming the vendor you’ve found out with lsusb above; for the Swift that would be 0x2970 (yupp, here you need to prefix it by 0x to point out it’s a hexadecimal number). Then restart the ADB server: adb kill-server && adb start-server . Disconnect and reconnect the device again. Now adb devices should see it.

Connecting the device

You might have noticed adb devices told you something like 0123456789ABCDEF unauthorized . That’s OK and for your (devices) safety: your computer must be authorized first to be able to access the device. So simply issue adb shell now – which will be quit with an error: device unauthorized. Please check the confirmation dialog on your device. Follow that advice (optionally mark the check-box to permanently authorize your computer), and you’re done: Now you can use adb to access your device.

Updates:

¹ Note that in later Linux versions, syntax for the UDEV rules has slightly changed, as e.g. jcomeau_ictx pointed out in his comment. For the values we found above that would be:

SUBSYSTEM=="usb", ATTR=="2970", ATTR=="2282", MODE="0666", GROUP="plugdev", SYMLINK+="android%n" 

Two differences: it’s now SUBSYSTEM (no plural), and the group has changed from androiddev to plugdev (the former does not exist on recent systems, the latter does and usually is assigned at least to the first user).

Читайте также:  Pdf parser kali linux

Additionally, you might need to add the vendorID to your ~/.android/adb_usb.ini (one ID per line, in hex notation):

# ANDROID 3RD PARTY USB VENDOR ID LIST # 1 USB VENDOR ID PER LINE. 0x2970 

Источник

fastboot doesn’t work anymore in Ubuntu 21.10?

I’m having trouble flashing my smartphone via fastboot. The smartphone in fastboot-mode is recognized:

sudo fastboot devices BH905FBU9E fastboot 
sudo fastboot flash recovery twrp-3.5.0-0-20210117-lilac.img 
Sending 'recovery' (33824 KB) FAILED (Write to device failed (No such device)) fastboot: error: Command failed 

adb on the other hand is working fine! What might be going wrong? Ubuntu 20.04 on another machine works fine! Thanks in advance for ideas, pheidrias

3 Answers 3

Could be your driver as an ADB device. Download and install the latest USB drivers with SDK manager on your Ubuntu machine.

Have you done this process yet?

After sudo apt-get dist-upgrade

After sudo apt-get install android-tools-fastboot

fastboot devices fastboot reboot 

Have you also turned on USB debugging? What processor of the computer that has Ubuntu vs the computer that it works on? Is it an AMD processor? Try a different port or a different cable on the machine too.

Hello CraigslistCesium, all packages are/were up-2-date. I also tried different cables and different ports. Both machines are Intel-bases (working: z20t-b, not working: Thinkpad X1 yoga carbon 4th). And yes: USB debugging was turned on. Otherwise, all the other things wouldn’t have worked.

I went to the official xda site and looked up your Sony Xperia compact, there seems to be a different twrp img that provides hot fixes. twrp.me/sony/sonyxperiaxz1compact.html which is 3.5.2-liliac, maybe try a different image, where is your image located?

I tried different versions of twrp, too. And I don’t see, how this could influence the (not even starting!) fastboot process? The above referenced twrp was suggested by the LineageOS developer for the correspondig ROM on xda.

Since fastboot can discover the device but not flash the image it was worth a try. Try a manual flashing by «fastboot boot «The place of the image file»» This will yield an error, disconnect the usb. Then reboot the phone, after connect the usb. Then try the command again.

When using «fastboot boot twrp. «, I do at least get «Sending ‘boot.img’ (33824 KB)» but nothing more. I have to disconnect the cable, to stop the command. The following error message is: «FAILED (Write to device failed in SendBuffer() (Cannot send after transport endpoint shutdown))» But «reboot the phone, after connect the usb.» is not possible, as fastboot mode is entered by connecting the USB-cable while pressing VolumeUp. Or do you mean something else?

You say that it works on 20.04 but not 21.10 and all packages are up to date. It looks like you have different versions of fastboot with apt delivering version 1:8.1.0+r23-5ubuntu2 for 20.04 and version 1:10.0.0+r36-7 for 21.10. I would recommend downloading the SDK Platform-Tools directly, where fastboot is currently version 31.0.3-7562133 . https://developer.android.com/studio/releases/platform-tools

I’m not sure how the binaries in the repos are versioned, but I have found that, for example, fastboot 1:8.1.0+r23-5ubuntu2 does not support dynamic partitions (i.e. fastboot delete-logical-partition product ) while the the version from platform-tools does.

Источник

Оцените статью
Adblock
detector