adbfs-rootless icon indicating copy to clipboard operation
adbfs-rootless copied to clipboard

Does not handle multiple devices

Open jdtimmerman opened this issue 4 years ago • 1 comments

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:

  • Prevent/undo the mounting things upon an error; to prevent the mount-directory to become inaccessible
  • Either support a device-flag or document the usage of $ANDROID_SERIAL

jdtimmerman avatar Aug 25 '21 09:08 jdtimmerman

ping @spion

Mannshoch avatar Nov 21 '22 09:11 Mannshoch