Making ADB work in Linux (Debian/Ubuntu)
- Install Android Debug Bridge for GNU/Linux.
• for Debian & DEB packages:
sudo apt-get install android-tools-adb
• for Redhat & RPM packages:
sudo yum install android-tools-adb
- Connect android phone.
lsusb
Find the corresponding line for your android phone.Bus 001 Device 008: ID 058f:6366 Alcor Micro Corp. Android
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
The Vendor & Product ID will be inXXXX:XXXX
format. In our example the ID's is058f:6366
.
058f
= VendorID.
6366
= ProductID.
- Create Rules.
you can use
sudo gedit /etc/udev/rules.d/51-android.rules
vi
,nano
,pico
or any text editor in place of gedit.
append the code to the file.SUBSYSTEM=="usb", ATTR{idVendor}=="058f", ATTR{idProduct}=="6366", MODE="0666", GROUP="plugdev"
- Create adb file in home ( ~ ) folder.
( if not already created. )
mkdir ~/.android
touch ~/.android/adb_usb.ini
echo '0x6366' >> ~/.android/adb_usb.ini
- Restart udev.
sudo service udev restart
adb kill-server
adb start-server
- Reconnect the Phone.
- You may need to disconnect and reconnect the phone again. and wait for a couple of minute to get it detected.
adb devices
List of devices attached
19761202 device
45024745 device
- You may need to disconnect and reconnect the phone again. and wait for a couple of minute to get it detected.
# The short way.
Copy this code into the terminal (replaces id's) and run it.
echo 'SUBSYSTEM=="usb", ATTR{idVendor}=="6366", ATTR{idProduct}=="058f", MODE="0666", GROUP="plugdev"' | sudo tee -a /etc/udev/rules.d/51-android.rules && mkdir ~/.android/ && touch ~/.android/adb_usb.ini && echo '0x6366' >> ~/.android/adb_usb.ini && sudo service udev restart && adb kill-server && adb start-server && adb devices
No comments:
Post a Comment