Android Performance

Ubuntu: Adb Command Cannot Find Device

Word count: 532Reading time: 3 min
2014/03/25
loading

1. Problem Overview

Recently, while developing for a Nokia project, I encountered the following issue:

When I plugged in a Nokia X, the computer did not respond at all—it wasn’t recognized. My colleague’s Windows machine also failed to detect it. After searching Google for a long time, I finally found a solution. Since I didn’t record it originally and later forgot how to configure it when helping someone else, I decided to document it here for everyone.

2. Solution

If the adb command indicates that no devices are found, please ensure you have already completed these basic steps:

  1. Enable USB Debugging (Settings - Developer Options - USB Debugging). If you don’t see Developer Options, go to “About” and tap the Build Number several times.
  2. Restart Adb with Sudo: Try sudo adb kill-server and sudo adb start-server.

If it still doesn’t work, follow the steps below:

2.1. Run lsusb

Check the USB bus to find the device ID:

1
2
3
4
5
6
7
8
9
10
~ » lsusb                                                                  
Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 004: ID 1532:0016 Razer USA, Ltd DeathAdder Mouse
Bus 003 Device 003: ID 05d5:624c Super Gate Technology Co., Ltd
Bus 003 Device 033: ID 0421:06e8 Nokia Mobile Phones
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

2.2. Register udev Rules

Edit /etc/udev/rules.d/51-android.rules:

1
vim /etc/udev/rules.d/51-android.rules

Add the following rule (using the IDs found in lsusb, e.g., Vendor ID 0421):

1
SUBSYSTEM=="usb", ATTR{idVendor}=="0421", ATTR{idProduct}=="06e8", MODE="0666", GROUP="plugdev"

Save the file and run:

1
2
sudo chmod a+rx /etc/udev/rules.d/51-android.rules    
sudo service udev restart

The output should show udev restarting correctly.

2.3. Restart Adb with Sudo

Navigate to your SDK directory and restart the server:

1
2
3
cd ~/tools/android-sdk-linux_x86/platform-tools  
sudo ./adb kill-server
sudo ./adb start-server

Note: Usually, the above steps are sufficient. However, for specific devices like the Nokia X, you might need one more step:

2.4. Update adb_usb.ini

Open ~/.android/adb_usb.ini and add the Vendor ID (in hex):

1
2
3
4
5
6
# ANDROID 4th PARTY USB VENDOR ID LIST -- DO NOT EDIT.
# USE 'android update adb' TO GENERATE.
# 1 USB VENDOR ID PER LINE

# for nokia x
0x0421

After saving, adb devices should now correctly list your device. The process is similar on Windows.

About Me && Blog

Below is my personal intro and related links. I look forward to exchanging ideas with fellow professionals. “When three walk together, one can always be my teacher!”

  1. Blogger Intro
  2. Blog Content Navigation: A guide for my blog content.
  3. Curated Excellent Blog Articles - Android Performance Optimization Must-Knows
  4. Android Performance Optimization Knowledge Planet

One walks faster alone, but a group walks further together.

Scan WeChat QR Code

CATALOG
  1. 1. 1. Problem Overview
  2. 2. 2. Solution
    1. 2.1. 2.1. Run lsusb
    2. 2.2. 2.2. Register udev Rules
    3. 2.3. 2.3. Restart Adb with Sudo
    4. 2.4. 2.4. Update adb_usb.ini
  • About Me && Blog