Linux adb not finding device

adb pull -> device not found

I have a rooted phone and running adb in root mode. I used adb shell to successfully access the phone. I can browse directorys, even those who require root. When i try to use:

adb pull /data/data/my.app.path/databases/mydatabase.db /home/admin/Desktop/ 

The adb shell stays connected and i can go on browsing the sdcard. Can anyone tell me where this error comes from and how i can fix it to pull the file?

5 Answers 5

Stay out of shell during adb pull .

Seems that nobody provided an explanation yet.

The error has no relation to adb running as root. Running adb pull from inside a shell in Android expects an Android device (running adb server) connected to primary Android device as slave, which of course doesn’t exist, and so comes the error.

However, you can run that command successfully from inside an Android, if you connect your primary Android device via OTG to another device and that one starts charging (becomes a slave). In that way, you can in fact do adb shell from inside your primary Android.

Otherwise, you can run ADB on your device or the other device in TCP mode and do adb connect from inside the primary device’s shell to connect to localhost or the other device’s shell.

Even then, your command adb pull /data/data/my.app.path/databases/mydatabase.db /home/admin/Desktop/ is bound to fail because there is no /home directory concept in Android and so, the destination simply doesn’t exist in Android.

Though you already know, you’ve to come back to your PC’s shell so that your primary device can be treated as a slave or a server, and your command would run successfully (readers: root is required for this command to work).

Источник

adb shell error: device not found (Ubuntu)

I am complete novice on adb. When it comes to Android I could be classified as «dumb user» — trying however to get one level up, hence playing with adb:

$ ./adb shell error: device not found $ ./adb devices * daemon not running. starting it now on port 5037 * * daemon started successfully * List of devices attached
  • the device is visible and I can copy files to/from it
  • I went through the steps suggested below and still no luck
  • I tried connecting the phone to different USB ports — my comp has 2 USB controllers — one USB 3.0 and one USB 2.0

Steps to enable USB debugging on my device with 7.0 Nougat Android:

  1. Go to «Configuration«
  2. Go to «About Telephone / Android 7.0«
  3. Click several times «Build Number» until message «You’re now developer» appears
  4. Go back to «Configuration» — «<> Developer options» are now visible — go inside
  5. A number of fabulous options appear — switch-on «USB Debugging«

I am using Linux and I would prefer to stay away from Windows.

Still no luck — device not found

2 Answers 2

Check adb devices . If no device shows up follow the steps below.

First, check to make sure USB Debugging is enabled. On most devices:

  1. Go into ‘About Phone’, ‘About Device’, or ‘About Tablet’
  2. Find ‘Build Number’. It’s location varies from devices to device, but look for menus such as ‘Software Information’
  3. Tap ‘Build Number’ until you see a message saying ‘You are now a developer’. If you see a message saying something along the lines of ‘This option has been disabled by your administrator’, I’m sorry to say you will need to reset your device to use ADB. You could also talk to your administrator.
  4. Go back to the main settings page. At the bottom, you should now see ‘Developer Options’. Tap it.
  5. A warning may display. Read it carefully, and decide at your own risk.
  6. Scroll until you find ‘USB Debugging’. Tap it. You will see another warning. Read. Decide.
  7. Connect your device to your computer. Run adb shell. A dialog box will pop up asking if you trust your computer. Tap yes.
Читайте также:  Linux alias with parameter

Congrats! It should now work.

If that doesn’t work, try different cables, phones, computers, and try to find what is the problem. Google is, as always, your friend.

OK, I did it. Apparently I was using some old adb binary that came with app I wanted to use. After I installed the one available in repo, as suggested by this website, It now sees the device:

$ sudo add-apt-repository ppa:phablet-team/tools [sudo] password for admin: More info: https://launchpad.net/~phablet-team/+archive/ubuntu/tools Press [ENTER] to continue or ctrl-c to cancel adding it -- ciach $ sudo apt-get update Hit:1 http://pl.archive.ubuntu.com/ubuntu xenial InRelease -- ciach $ sudo apt-get install android-tools-adb android-tools-fastboot Reading package lists. Done Building dependency tree Reading state information. Done -- ciach $ adb devices adb server is out of date. killing. * daemon started successfully * List of devices attached $ adb devices List of devices attached 0123456789ABCDEF unauthorized -- click "Authorize" on the device $ adb devices List of devices attached 0123456789ABCDEF device

Источник

How do I get my device detected by ADB on Linux?

I just got my shiny new Wileyfox Swift – and before putting it to use I want to oem unlock and root it (as I usually do with new devices 😉 Trouble is, though usb-debugging is enabled on the device, and a corresponding line in /etc/udev/rules.d/51-android.rules exists, the device is not seen by adb devices . I know there are several answers scattered around this site, but they are either hard to find, just cover a specific device, or don’t cover all steps I finally needed. So I take this as a chance for a canonical, device-independent question and give it a detailed answer below: How can I get my Android device seen and used by adb on Linux?

3 Answers 3

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 driver make module

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 sudo service udev restart or sudo /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).

Читайте также:  Линукс информация о процессах

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 

Источник

ADB is not detecting my android device on Ubuntu

Q: Is USB debugging turned on on the Android? R: Yes.

OS: Ubuntu 15.04 (64 bit)

$ lsusb Bus 004 Device 003: ID 8086:0189 Intel Corp. Bus 004 Device 005: ID 1004:6300 LG Electronics, Inc.  

Update 1

51-android.rules file changes:

SUBSYSTEM=="usb", ATTR=="1004", MODE="0666", GROUP="plugdev" 
$ lsusb Bus 004 Device 004: ID 8086:0189 Intel Corp. Bus 004 Device 003: ID 1004:6300 LG Electronics, Inc.  

But, "adb" don't detect my device: 🙁

$ adb devices List of devices attached 

Update 2

Reference

The second solution (creating adb_usb.ini file) in the link posted in your "Update 2" worked for me. 🙂

Hi, I had the same issue with Ubuntu 18.04 LTS for an LG tablet, I added "SUBSYSTEM=="usb", ATTR=="1004", ATTR=="6300", MODE="0666", " to 70-android.rules then rebooted and ran every adb command with sudo. It did work somehow.

7 Answers 7

from lsusb output I see that your device connected to Bus 004 as a device 005

Here it is Bus 004 Device 005: ID 1004:6300 LG Electronics, Inc.

I see that you did not create any group.You need to create a group (if permission denied prepend "sudo" following commands):

2) add your username to plugdev group (useradd -G username):

3) restart udev (you may need to log off and log back in to update user group):

 sudo service udev restart 

4) Now reload the rules with the following commands:

 sudo udevadm control --reload-rules sudo service udev restart sudo udevadm trigger 

5) Verify device is now allowing plugdev user group access

It should give something like that:

 crw-rw-rw- 1 root plugdev 189, 329 Jul 3 18:23 074 

6) Run adb devices to confirm permissions are correct and enjoy!

I know your issue was solved, but for everyone in the future make sure you don't have two versions of adb running. Android Studio comes with adb and I installed adb through yum. The instances were interfering with each other and caused lots of issues including not being able to see my device.

@m47730 I wrote my answer poorly. I edited it to explicitly include removing the extra adb instance was the solution that solved the posted question for me.

My phone thought it was connected to the computer, but the computer wouldn't recognize it. On my phone I tapped the notification for 'USB Debugging Enabled', scrolled to 'USB Debugging', and toggled the setting off and on again. adb then saw my phone.

On Ubuntu 16.04, I had to install the latest android sdk, rather than the one that comes with apt-get , and finally I could see the devices from adb.

Use apt-get install to install the android-tools-adb package.

This gives you a community-maintained default set of udev rules for all Android devices.

Make sure that you are in the plugdev group. If you see the following error message, adb did not find you in the plugdev group:

error: insufficient permissions for device: udev requires plugdev group membership 

Use id to see what groups you are in.

Use sudo usermod -aG plugdev $LOGNAME to add yourself to the plugdev group.

The following example shows how to install the Android adb tools package. apt-get install android-tools-adb

Источник

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