Running `adbd` as non-root user

Which system do you use? Android, Ubuntu, OOWOW or others?

Ubuntu

Which version of system do you use? Please provide the version of the system here:

22.04 Fenix 1.7.3

Please describe your issue below:

How to run adbd as none-root user account?

Post a console log of your issue below:

I tried to tweak /usr/local/bin/usb-gadget script but failed.

Hello @yfliu2008

You can try su khadas to switch normal user.

I tried that to run adbd as khadas but it seems that the /dev/usb-ffs/adb/ep1 didn’t show up. The systemctl status usb-gadget-khadas also shows that echo $UDC > $GADGET/UDC line failed with IO Error. Note this occured when I dropped the root group from khadas account here to make it a normal account.

Previously khadas was a member of root group and I was able to run adbd as khadas:

$ adb shell whoami
khadas
$ adb shell id
uid=1000(khadas) gid=1000(khadas) groups=1000(khadas),0(root),4(adm),5(tty),6(disk),20(dialout),24(cdrom),27(sudo),29(audio),30(dip),44(video),46(plugdev),50(staff),60(games),100(users),101(systemd-journal),106(input),109(render),110(netdev),113(bluetooth),118(i2c),125(pulse-access)

Maybe you can drop the root group for khadas account and see if adbd still works?