NetBSD-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: ADB and MTP not working for Android phone on NetBSD



I was able to solve the problem.

Noticing /dev/ugen0.00 and /dev/ugen0.01 as last items in the output I
tried:

$ doas chown user:users /dev/ugen0.00
$ doas chown user:users /dev/ugen0.01
$ adb kill-server
$ adb devices
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
List of devices attached
_redacted_	offline


It made the device appear in the list, but it appears as "offline".
Trying something like adb shell doesn't work.

So I did something drastic:

$ doas chown user:users /dev/ugen0.*


This time it worked:

$ adb kill-server
$ adb devices
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
List of devices attached
_redacted_	device


I found <https://wiki.netbsd.org/scanner/> which had something more
"drastic" than I did, changing permission for all /dev/ugen* for a
scanner device. So I felt more comfortable applying permission to
all /dev/ugen* now.

I have my non root user already in the wheel group:

$ groups
users wheel operator


So didn't see any point in creating a new group. I finally decided to
make it work but keep it close to default NetBSD setup:

$ doas chown root:wheel /dev/ugen0.*  # restore my changes
$ doas chmod g+rw /dev/ugen*  # add group read write permission


Now I can enjoy ADB and MTP without root priv. Problem solved!

Haven't tried more modern Android versions yet.

Also found
<https://www.netbsd.org/docs/guide/en/chap-rmmedia.html#cdrom-users>
which I can use to (un)mount using USB storage mode without root priv.

Thanks for the help.



Home | Main Index | Thread Index | Old Index