Run Android Studio Apps on a Hardware Device

Ubuntu Linux: Use apt-get install to install the android-tools-adb package. This gives you a community-maintained default set of udev rules for all Android devices.

Make sure that you are in the plugdev group. If you see the following error message, adb did not find you in the plugdev group:

error: insufficient permissions for device: udev requires plugdev group membership

Use id to see what groups you are in. Use sudo usermod -aG plugdev $LOGNAME to add yourself to the plugdev group.

source:

https://developer.android.com/studio/run/device

 ….. (atau cara di bawah)

Log in as root, create a file /etc/udev/rules.d/51-android.rules and add a line like this to give permissions to anyone in the plugdev group:

SUBSYSTEM=="usb", ATTR{idVendor}=="0bb4", MODE="0666", GROUP="plugdev"

In this example, the vendor ID is HTC. You need to use the vendor ID for your device, which can be obtained by running lsusb and searching for a line like

Bus 002 Device 009: ID 2a47:9e18

In this example your vendor ID would be 2a47, so you would have to replace 0bb4 with 2a47. The correct line would thus read:

SUBSYSTEM=="usb", ATTR{idVendor}=="2a47", MODE="0666", GROUP="plugdev"

Now assign read permissions on the files, reload udev and reload the adb daemon:

sudo chmod a+r /etc/udev/rules.d/51-android.rules
sudo udevadm control --reload-rules
adb kill-server
adb start-server

You may have to disconnect and connect again your device to the USB port.

source:

https://developer.android.com/studio/run/device

 

Published by

berbagilentera

saya hanya ingin berbagi lentera ilmu, sekedar apa yang saya tahu...

Leave a comment