Unable to use my Android device as Android emulator using Android studio

12,692
  1. Enable USB debugging on your device.

On most devices running Android 3.2 or older, you can find the option under

Settings > Applications > Development.

On Android 4.0 and newer, it's in

Settings > Developer options.

Note: On Android 4.2 and newer, Developer options is hidden by default. To make it available, go to Settings > About phone and tap Build number seven times. Return to the previous screen to find Developer options.

  1. Set up your system to detect your device.

If you're developing on Windows, you need to install a USB driver for adb. For an installation guide and links to OEM drivers, see the OEM USB Drivers document.

If you're developing on Mac OS X, it just works. Skip this step.

If you're developing on Ubuntu Linux,

you need to add a udev rules file that contains a USB configuration for each type of device you want to use for development. In the rules file, each device manufacturer is identified by a unique vendor ID, as specified by the ATTR{idVendor} property. For a list of vendor IDs, see USB Vendor IDs, below.

To set up device detection on Ubuntu Linux:

Log in as root and create this file:

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

Use this format to add each vendor to the file:

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

In this example, the vendor ID is for HTC. The MODE assignment specifies read/write permissions, and GROUP defines which Unix group owns the device node.

Vendor Ids:

  • Acer: 0502
  • ASUS: 0B05
  • Dell: 413C
  • Foxconn: 0489
  • Garmin-Asus: 091E
  • Google: 18D1
  • Hisense: 109B
  • HTC: 0BB4
  • Huawei: 12D1
  • K-Touch: 24E3
  • KT Tech: 2116
  • Kyocera: 0482
  • Lenevo: 17EF
  • LG: 1004
  • Motorola: 22B8
  • NEC: 0409
  • Nook: 2080
  • Nvidia: 0955
  • OTGV: 2257
  • Pantech: 10A9
  • Pegatron: 1D4D
  • Philips: 0471
  • PMC-Sierra: 04DA
  • Qualcomm: 05C6
  • SK Telesys: 1F53
  • Samsung: 04E8
  • Sharp: 04DD
  • Sony Ericsson: 0FCE
  • Toshiba: 0930
  • ZTE: 19D2

Note: The rule syntax may vary slightly depending on your environment. Consult the udev documentation for your system as needed. For an overview of rule syntax, see this guide to writing udev rules.

Now execute:

chmod a+r /etc/udev/rules.d/51-android.rules
Share:
12,692

Related videos on Youtube

Rahaman
Author by

Rahaman

Updated on September 18, 2022

Comments

  • Rahaman
    Rahaman over 1 year

    How can I have Ubuntu recognize my Android mobile device when it is connected via USB? (Analogous to the Windows action mycomputer-> manage->devices etc.)

    • MadMike
      MadMike about 9 years
      Welcome to Ask Ubuntu. Please tell us what you tried to do until now, what worked and what didn't work.
    • llan yort
      llan yort almost 7 years
      this helped me understand the UDEV linux.com/news/…