Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

"sudo apt-get install android-tools-adb" ... (then no device listed)

154 views
Skip to first unread message

Albretch Mueller

unread,
Sep 24, 2023, 3:50:07 PM9/24/23
to
$ uname -a
Linux debian 5.10.0-18-amd64 #1 SMP Debian 5.10.140-1 (2022-09-02)
x86_64 GNU/Linux

$ sudo apt-get update
...

$ date; sudo apt-get install android-tools-adb
Sun 24 Sep 2023 02:07:24 PM UTC
...

$ which adb
/usr/bin/adb

$ adb --version
Android Debug Bridge version 1.0.41
Version 28.0.2-debian
Installed as /usr/lib/android-sdk/platform-tools/adb

$ adb devices
* daemon not running; starting now at tcp:5037
* daemon started successfully
List of devices attached

$

As usual (being a TI makes your life so enjoyable!) I found similar
posts online and ways to solve such problems (some of them quite
voodoo-like):

https://stackoverflow.com/questions/21170392/my-android-device-does-not-appear-in-the-list-of-adb-devices
~
Basically, I need to transfer selected data (whatsapp, messages,
phone calls, ...) off my phone to my computer's hdd.

How can you troubleshoot that problem or, do you know about any other
way to transfer your data to a drive off your phone?

lbrtchx

Marco M.

unread,
Sep 24, 2023, 4:10:06 PM9/24/23
to
Am 24.09.2023 um 19:45:11 Uhr schrieb Albretch Mueller:

> How can you troubleshoot that problem or, do you know about any other
> way to transfer your data to a drive off your phone?

On most Android phones, you need to explicit allow data transfers.
Did you do?

Michel Verdier

unread,
Sep 24, 2023, 4:40:06 PM9/24/23
to
On 2023-09-24, Albretch Mueller wrote:

> Basically, I need to transfer selected data (whatsapp, messages,
> phone calls, ...) off my phone to my computer's hdd.
>
> How can you troubleshoot that problem or, do you know about any other
> way to transfer your data to a drive off your phone?

If you use USB you need a cable allowing data, some allow only power.
Then you have to enable USB debug in developpement options (which you
have to enable using some magic specific to your model, search internet
for it). And USB must be accepted in MTP mode on your phone (usually by
default). If all this is done your device should be listed.

There is also some applications that can do transfer, like syncopoli
using rsync without USB. Or syncthing. Or termux on which you can use
subversion or git or other unix tools.

Albretch Mueller

unread,
Sep 24, 2023, 6:20:05 PM9/24/23
to
On 9/24/23, Marco M. <m...@dorfdsl.de> wrote:
> On most Android phones, you need to explicit allow data transfers.

What do you functionally mean? I need for you to talk to me like
this: a) go "Settings"; b) ...

Thank you,
lbrtchx

Marco

unread,
Sep 25, 2023, 1:00:07 AM9/25/23
to
Am 24.09.2023 22:13 schrieb Albretch Mueller:

> What do you functionally mean? I need for you to talk to me like
> this: a) go "Settings"; b) ...

According to the Google documentation:
With a USB cable, connect your device to your computer.
On your device, tap the "Charging this device via USB" notification.
Under "Use USB for," select File Transfer.

Roland Mueller

unread,
Sep 25, 2023, 6:30:06 AM9/25/23
to
As far as I remember adb requires debugging to be enabled on the Android device.

For newer androids following - slighly obscure - process has to be used:

Enabling USB Debugging on an Android Device
- On the device, go to Settings > About <device>.
- Tap the Build number seven times to make Settings > Developer options available.
- Then enable the USB Debugging option.

David Wright

unread,
Sep 25, 2023, 11:10:06 AM9/25/23
to
On Sun 24 Sep 2023 at 22:13:20 (+0000), Albretch Mueller wrote:
> On 9/24/23, Marco M. <m...@dorfdsl.de> wrote:
> > On most Android phones, you need to explicit allow data transfers.
>
> What do you functionally mean? I need for you to talk to me like
> this: a) go "Settings"; b) ...

On bullseye I have android-file-transfer installed. I connect the
phone to the PC with USB, and run this function:

samsungd ()
{
sudo mkdir -p /media/samsungd || true;
sudo chown "$USER" /media/samsungd;
aft-mtp-mount /media/samsungd
}

whereupon the phone will ask:

Allow access to phone data?
… …
[Deny] [Allow]

Tapping Allow makes the contents of the phone appear under
/media/samsungd. I use mc to transfer files in each direction.
When I've finished, I run:

unsamsungd ()
{
###;
fusermount -u /media/samsungd;
sudo rmdir /media/samsungd || true
}

and disconnect the cable (the one that came in the box with the phone).

Actually, the ### is really a call to a function that runs a flavour
of updatedb, and generates a compressed ls -lAR (for mc) and a
compressed custom listing of all the files (date/size/name).
BTW the d distinguishes my own phone from our other one when they're
both connected (there's no daemon involved).

As for (android-tools-)adb, I read that unless
android-sdk-platform-tools-common is installed, you need to run adb
as root. I don't know what extra things adb buys you, compared with
android-file-transfer. I'm mainly interested in pictures, movies,
audio, and stuff like that, rather than screwing around the phone's
internals.

Cheers,
David.

Albretch Mueller

unread,
Sep 25, 2023, 1:50:06 PM9/25/23
to
On 9/24/23, Michel Verdier <mv...@free.fr> wrote:
> If you use USB you need a cable allowing data, some allow only power.

The USB cable I have been using to charge the battery of that phone
visually seems to be the same exact one being advertised as doubling
as a data cable, but running:
$ sudo lsusb
Before and after plugging in the phone doesn’t show any difference.
Is there a way to test for sure that cable is the right one?
~
On 9/25/23, Marco <m...@dorfdsl.de> wrote:
> According to the Google documentation:

which I found:

// __ Transfer files between your computer and Android device

https://support.google.com/android/answer/9064445?hl=en-GB
~
doesn’t really explain what to do. They apparently want for you to
transfer your files to google drive and all that non sense.

I also tried mtp fs utility, but I am getting the error message:
detect failed: no MTP devices found

go-mtpfs -android "<path to directory>"
2023/09/25 12:10:10 detect failed: no MTP devices found
~
I also tried jmtpfs:

$ which jmtpfs
/usr/bin/jmtpfs

$ jmtpfs --version
jmtpfs version: 0.5
FUSE library version: 2.9.9
fusermount version: 2.9.9
using FUSE kernel interface version 7.19

$ sudo jmtpfs
No mtp devices found.
~
Most probably there is a setting in that phone I haven’t been able to find.

lbrtchx

Anssi Saari

unread,
Sep 25, 2023, 2:10:06 PM9/25/23
to
David Wright <deb...@lionunicorn.co.uk> writes:

> On Sun 24 Sep 2023 at 22:13:20 (+0000), Albretch Mueller wrote:
>> On 9/24/23, Marco M. <m...@dorfdsl.de> wrote:
>> > On most Android phones, you need to explicit allow data transfers.
>>
>> What do you functionally mean? I need for you to talk to me like
>> this: a) go "Settings"; b) ...
>
> On bullseye I have android-file-transfer installed. I connect the
> phone to the PC with USB, and run this function:
>
> samsungd ()
> {
> sudo mkdir -p /media/samsungd || true;
> sudo chown "$USER" /media/samsungd;
> aft-mtp-mount /media/samsungd
> }

Does this android-file-transfer provide a working and reliable MTP
implementation for Linux then? I think I'll stick with rsync and adb but
would be good to know if MTP is working on Linux these days.

Albretch Mueller

unread,
Sep 25, 2023, 3:30:06 PM9/25/23
to
On 9/25/23, Albretch Mueller <lbr...@gmail.com> wrote:
> Most probably there is a setting in that phone I haven’t been able to
> find.

Android awakens when I unplug the cable from the computer; so,
something is being somehow detected.

lbrtchx

Nicolas George

unread,
Sep 25, 2023, 3:50:08 PM9/25/23
to
David Wright (12023-09-25):
> On bullseye I have android-file-transfer installed. I connect the
> phone to the PC with USB, and run this function:

If we are sharing how we do file transfer to and from an Android phone:

My favorite solution is tu install Termux and run sshd in it. Then I can
use rsync or anything I want to do the transfer. Add Tinc to get a
stable reachable IP.

Regards,

--
Nicolas George
signature.asc

Michel Verdier

unread,
Sep 25, 2023, 7:10:06 PM9/25/23
to
On 2023-09-25, Albretch Mueller wrote:

> Android awakens when I unplug the cable from the computer; so,
> something is being somehow detected.

android also awakens on power on/off

Michel Verdier

unread,
Sep 25, 2023, 7:20:05 PM9/25/23
to
On 2023-09-25, Albretch Mueller wrote:

> Is there a way to test for sure that cable is the right one?

Usually the original cable furnished with the phone is a data cable. My
only test was to successfully use adb then change cable and see that I
have some power only cables.

Jeffrey Walton

unread,
Sep 25, 2023, 10:20:07 PM9/25/23
to
On Mon, Sep 25, 2023 at 7:05 PM Albretch Mueller <lbr...@gmail.com> wrote:
>
> On 9/24/23, Michel Verdier <mv...@free.fr> wrote:
> > If you use USB you need a cable allowing data, some allow only power.
>
> The USB cable I have been using to charge the battery of that phone
> visually seems to be the same exact one being advertised as doubling
> as a data cable, but running:
> $ sudo lsusb
> Before and after plugging in the phone doesn’t show any difference.
> Is there a way to test for sure that cable is the right one?

It sounds like you are using a charging cable, or a cheap data cable.
I would try a quality data cable before going down the rabbit hole.

You should also state which USB protocol your phone uses. Different
USB standards have different requirements. For example, USB 1.0 and
2.0 only need a 4-wire data cable (PWR, GND, D+ and D-). USB-C needs a
24-pin data cable and must implement the USB-PD protocol.

Also see <https://www.google.com/search?q=usb+cable+pinouts>.

Jeff

Jeffrey Walton

unread,
Sep 25, 2023, 11:00:06 PM9/25/23
to
And one other thing I've found, but I have no explanation for...

Sometimes you cannot use an intermediate USB hub. I have a Dell XPS
8930 and Pixel 4a. I also bought a USB 3.0 Hub with power ports for
charging from my desktop,
<https://www.amazon.com/gp/product/B075NMVGP7>.

When I want to use adb, I have to plug the phone directly into the
computer. When the phone is directly plugged into the computer, 'adb
install <apk>' works as expected. I can also transfer pictures.

When plugged into the hub, I can only install small apk's. If the apk
is too large, then I get an error when running 'adb install <apk>'.
You may experience the same or a similar problem with large file
transfers.

Like I said, I have no explanation for it. I just know it happens.
When I experience it, I plug the phone directly into the computer.

Jeff

David Wright

unread,
Sep 26, 2023, 12:00:06 AM9/26/23
to
On Mon 25 Sep 2023 at 17:41:13 (+0000), Albretch Mueller wrote:
> On 9/24/23, Michel Verdier <mv...@free.fr> wrote:
> > If you use USB you need a cable allowing data, some allow only power.
>
> The USB cable I have been using to charge the battery of that phone
> visually seems to be the same exact one being advertised as doubling
> as a data cable, but running:
> $ sudo lsusb
> Before and after plugging in the phone doesn’t show any difference.
> Is there a way to test for sure that cable is the right one?

You should see lines appear in the kern.log (or wherever you have
configured your logs) like:

kernel: usb 2-2: new high-speed USB device number 15 using xhci_hcd
kernel: usb 2-2: New USB device found, idVendor=04e8, idProduct=6860, bcdDevice= 4.04
kernel: usb 2-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
kernel: usb 2-2: Product: SAMSUNG_Android
kernel: usb 2-2: Manufacturer: SAMSUNG
kernel: usb 2-2: SerialNumber: ABCDEF123GH
kernel: cdc_acm 2-2:1.1: ttyACM0: USB ACM device

when you connect it and

kernel: usb 2-2: USB disconnect, device number 15

when you disconnect.

On Mon 25 Sep 2023 at 19:21:53 (+0000), Albretch Mueller wrote:
> On 9/25/23, Albretch Mueller <lbr...@gmail.com> wrote:
> > Most probably there is a setting in that phone I haven’t been able to
> > find.

That's possible. I tried to think back to when I first connected up
the phone and, searching diligently, I recalled that when the phone
is connected (data cable, obviously), swiping down the Notifications
screen shows an entry "USB for file transfer". Tapping that changes
it to:

Android System
USB for file transfer
Tap for other USB options

Tapping the last gives another screen with "radio" options to:

Control USB by This/Connected device
Use USB for FileTransfer/Tethering/MIDI/ImageTransfer/ChargingOnly

plus a "slider" to transcode exported video. I selected both the
first options. You might have a phone still set to charging only.
On this phone, the selected options stay as selected, though I have
to change the second set when I tether (only done that in the UK).

> Android awakens when I unplug the cable from the computer; so,
> something is being somehow detected.

Typically that would only indicate that the phone was switched on
and being charged. It could be a data cable, or a power-only one,
like those ones with a bunch of different connectors on the end.

On Mon 25 Sep 2023 at 17:41:13 (+0000), Albretch Mueller wrote:
> On 9/25/23, Marco <m...@dorfdsl.de> wrote:
> > According to the Google documentation:
>
> which I found:
>
> // __ Transfer files between your computer and Android device
>
> https://support.google.com/android/answer/9064445?hl=en-GB
> ~
> doesn’t really explain what to do. They apparently want for you to
> transfer your files to google drive and all that non sense.

That's not the way I read Option 2: Move files with a USB cable.
My method is very similar to option 2's Mac computer:

1 Download and install Android File Transfer on your computer.
4 With a USB cable, connect your device to your computer.

Just the same.

5 On your device, tap the 'Charging this device via USB' notification.
6 Under 'Use USB for', select File transfer.

As outlined above.

2 Open Android File Transfer. The next time that you connect your device, it opens automatically.

That's when I run my samsungd command.

3 Unlock your device.

That's when I tap "Allow". (Using the term "unlock" is confusing to me.)

7 An Android File Transfer window will open on your computer. Use it to drag files.

Perhaps linux DEs do that too, IDK. I just use mc, cp, or anything
else you'd use for a mounted filesystem. (And tools like find,
du and df etc.)

Before their final step, I unmount (with fusermount -u) the
filesystem, but that step is a convenience for the PC side,
taking listings, and removing the mount point.

8 When you've finished, unplug the USB cable.

This is safe to do at any time.

I don't know anything about clouds etc, and have only used Google
on the phone (AFAIK) for regular searches, maps, and navigation.
I archive my photos, along with those from all the other cameras
of mine, on spinning rust.

> I also tried mtp fs utility, but I am getting the error message:
> detect failed: no MTP devices found
>
> go-mtpfs -android "<path to directory>"
> 2023/09/25 12:10:10 detect failed: no MTP devices found
> ~
> I also tried jmtpfs:
>
> $ which jmtpfs
> /usr/bin/jmtpfs
>
> $ jmtpfs --version
> jmtpfs version: 0.5
> FUSE library version: 2.9.9
> fusermount version: 2.9.9
> using FUSE kernel interface version 7.19
>
> $ sudo jmtpfs
> No mtp devices found.

I've no experience with using them, and don't know the pros and cons,
not having had the need. They're mentioned in:

https://wiki.archlinux.org/title/Media_Transfer_Protocol

Cheers,
David.

David Wright

unread,
Sep 26, 2023, 12:00:06 AM9/26/23
to
You'd have to specify a set of criteria to test. I just treat
/media/samsungd like any other filesystem, copying files in the
usual manner. As mentioned in:

https://en.wikipedia.org/wiki/Media_Transfer_Protocol

the phone screens are operable while connected (though I haven't
tested making calls), file modification timestamps are only preserved
phone→PC, not the other way, and you don't have to worry about pulling
the plug before unmounting.

In contrast, older phones that use MSC are inoperable as the screen is
locked, with a warning not to physically disconnect until a button has
been tapped.

Cheers,
David.

Anssi Saari

unread,
Sep 27, 2023, 8:10:06 AM9/27/23
to
David Wright <deb...@lionunicorn.co.uk> writes:

> You'd have to specify a set of criteria to test. I just treat
> /media/samsungd like any other filesystem, copying files in the
> usual manner.

Well, when I last tried MTP in Linux I got maybe half of a directory
listing and then it hung there. Concluded it doesn't work but to be sure
it's been a minute.
0 new messages