spion / adbfs-rootless

Mount Android phones on Linux with adb. No root required.
Other
908 stars 73 forks source link

Does not handle multiple devices #54

Open jdtimmerman opened 3 years ago

jdtimmerman commented 3 years ago

Adbfs does not know how to handle multiple connected devices.

joost@laptop: ~ $ mkdir droid          

joost@laptop: ~ $ ls -l | grep droid
drwxr-xr-x  2 joost joost      4096 25 aug 10:45 droid

joost@laptop: ~ $ adb devices
List of devices attached
XXX device
YYY device

joost@laptop: ~ $ adbfs ~/droid
--*-- exec_command: adb shell "ls"
adb: more than one device/emulator

It does however tries to mount something, making the ~/droid directory inaccessible.

joost@laptop: ~ $ ls -l | grep droid
ls: cannot access 'droid': No such file or directory
d?????????  ? ?     ?             ?            ? droid

joost@laptop: ~ $ mount | grep droid
adbfs on /home/joost/droid type fuse.adbfs (rw,nosuid,nodev,relatime,user_id=1000,group_id=1000)

I cannot find a flag in the adbfs --help to select the device (like adb's -s-flag). Through reading the adb --help, however, i did learn about the existence of the $ANDROID_SERIAL variable. Using this also applies to adbfs and i was able to mount my device correctly.

joost@laptop: ~ $ ANDROID_SERIAL=XXX adbfs ~/droid
--*-- exec_command: adb shell "ls"

joost@laptop: ~ $ ls ~/droid
acct  bin         config  data           default.prop  etc         mnt  oem   product  sdcard   sys     system_ext
apex  bugreports  d       debug_ramdisk  dev           lost+found  odm  proc  res      storage  system  vendor

So there are two parts to this issue-report:

Mannshoch commented 1 year ago

ping @spion