37

I started to develop in android with Android Studio IDE, I tested my apps on the emulator and works fine, but when I tried to test the apps directly in my device doesn't recognize it and the console shows next message:

Waiting for device. USB device not found

  • I configured "USB Device" in Run>Edit Configurations...> in tab "General", menu "Target Device"
  • I enabled the "Debug option" in my device
  • Plug/Unplug USB
Dave Zych
  • 21,581
  • 7
  • 51
  • 66
Miguel Ángel
  • 693
  • 1
  • 6
  • 10
  • 3
    Are you on Windows? You may need to install drivers for your device. Also, make sure to put your device in developer mode. – BVB Feb 22 '14 at 00:34
  • If you are using a Nexus you will need to download the drivers http://developer.android.com/tools/extras/oem-usb.html. It's likely you already downloaded them in (The Google USB Driver is located in \extras\google\usb_driver\ – fersarr Feb 22 '14 at 02:57
  • 1
    I'm on Windows 8.1, and I enabled the debug option. My device is a Motorola Razr D1 – Miguel Ángel Feb 23 '14 at 04:44

11 Answers11

29

I can run on my device at last, just I enabled the "USB debugging" and "Allow mock location" options from the Debug Menu of my device.

Miguel Ángel
  • 693
  • 1
  • 6
  • 10
  • 4
    I imagine that **Allow mock locations** is not necessary. – ki9 Jan 29 '16 at 16:27
  • 4
    Also we need to tick the check-box **Unknown Sources** that _allows installation of apps from unknown sources_. I found it in Settings->Security option in my device. – Atul Apr 04 '16 at 09:12
  • As additional information to @Miguel Angel and @Atul answers, `USB Debugging` is located at `Developer Options`, you can see @Zahoor Ahmad and @Mr. Stark answers to enable that option. And `Unknown Sources` is located at `Security` options, I had trouble finding that one. – Máster Oct 29 '18 at 17:02
23
  • First we have to enable the USB debugging mode. for that go to Settings -> Developer Options ->USB debugging in your phone checked it and allow it.
  • After it open android studio, click on SDK manager , check mark the Google USB Driver and hit install package.
  • After Installing Google USB Driver, close SDK Manager window, Connect your phone or tablet through USB cable to your laptop or PC.
  • Now click on My Computer (Windows 7) (or) This PC(Windows 8.1).Select Manage.
  • Select Device Manager –> Portable Devices –> Your Device Name
  • Right Click on Your Device Name and Select Browse My Computer For Driver Software.
  • Point it to C:\Users\YourUserName\AppData\Local\Android\sdk\extras\google\usb_driver. Hit Next and Finish.
  • Now Hit Run Button after selecting Your Project in Project Explorer in Android studio. Choose your device and press OK.
Let's help
  • 225
  • 2
  • 3
  • I would suggest restarting your PC once you are done with configurations. – Jay Jan 20 '21 at 00:30
  • With Android Studio Electric Eel | 2022.1.1 Patch 2 and Win10 you can skip Windows Device Manager steps, at least after installing Google USB Driver via Android Studio I was able to see/debugg on physical phone from Studio. – Nomik Mar 24 '23 at 06:48
12

I have a Nexus 4 and own a Thinkpad L430 Windows 8.1

My errors: "Waiting for device. USB device not found"

I went to: Device Manager > View > Drop to "Acer Device" > Right click on Acer Composite ADB Interface > Update it

Afterward, Reboot/Restart your computer. Once it turned on Plug Your USB Device onto the computer.

Go to: Setting > Enable "Developer options" > Check the "USB debugging" option > Check "Allow mock locations" > Check "Verify apps over USB".

Swipe down from the drop down menu of your phone where it Shows the USB Connection Icon. Tap on USB Computer Connection > Select the Check box "Camera (PTP)"

Run your Android Studio App and it should work

12

To test an android apps in a real device with Android Studio, You must keep two things in mind

  1. You should enable USB debugging option on your android phone.
  2. You must have driver installed on your computer.

Now , let me tell you how you can enable USB debugging on your android phone:

  1. Go to Settings on your android phone
  2. Scroll down to the bottom and click on About phone
  3. On this menu also scroll down to the bottom, you should see something Build number
  4. Click on Build number 7 times
  5. Now your Developer Option enables, once you done click on back button and you should see a new option on your android screen i.e. Developer Options
  6. Click On Developer Options
  7. Scroll down until you see USB Debugging
  8. Go ahead and click the check box next to the USB debugging
  9. Now your USB Debugging option enables.
  10. Connect your android device to your computer with the help of USB connector.

Now let me tell you how you can download the driver on your Windows PC:

  1. Your windows machine need a software called driver to communicate with your phone.
  2. Go To OEM USB Driver Website to install your appropriate driver
  3. Scroll down and select the driver appropriate for your device. Check the screen shoot
  4. Once you download it , you have to unzip your file
  5. After Installing Google USB Driver, close SDK Manager window, Connect your phone or tablet through USB cable to your laptop or PC.
  6. Now click on My Computer (Windows 7) (or) This PC(Windows 8.1).Select Manage.
  7. Select Device Manager –> Portable Devices –> Your Device Name
  8. Right Click on Your Device Name and Select Browse My Computer For Driver Software.
  9. Point it to C:\Users\YourUserName\AppData\Local\Android\sdk\extras\google\usb_driver. Hit Next and Finish.
  10. Now Hit Run Button after selecting Your Project in Project Explorer in Android studio. Choose your device and press OK.
PraneetNigam
  • 959
  • 9
  • 16
  • Thanks. Step 5 - Installing Google USB Driver - was what made the difference for me and the build & connection work on my physical device. Many are probably not aware of the fact, that they don't have that part installed in their Android SDK Manager. – themightyhulk Feb 19 '22 at 15:28
3

Step 1: Firstly, Go to the Settings in your real device whose device are used to run android app.

Step 2: After that go to the “About phone” if Developer Options is not shown in your device

Step 3: Then Tap 7 times on Build number to create Developer Options.

Step 4: After that go back and Developer options will be created in your device.

Step 5: After that go to Developer options and Enable USB debugging in your device as shown in figure below.

Step 6: Connect your device with your system via data cable and after that allow USB debugging message shown on your device and press OK.

Step 7: After that Go to the menu bar and Run app as shown in figure below.

Step 8: If real device is connected to your system then it will show Online. Now click on your Mobile phone device and you App will be run in real device.

Step 9: After that your Android app run in Real device.

Regards, Guruji Softwares (https://gurujisoftwares.com)

Paulo Mendonça
  • 635
  • 12
  • 28
  • With android vers 11+ there is no "developer options" unless you search for it. Click settings. Then click the search glass and type "developer" – John Henckel Jan 17 '21 at 01:51
2

if you are using IOS react native platform and want to debugging real android device you can use following code:

adb reverse tcp:8081 tcp:8081
npm start -- --reset-cache
react-native run-android
cinobili19
  • 451
  • 7
  • 10
1

For Android 7, Galaxy S6 Edge:

  1. Settings > Developer Options > Turn the switch ON > Debugging Mode (Turn On)

If Developer Options is not available then

  1. Settings > About Device > Software Info > Build number (Tap It 7 time)

Now perform step 1. Now it should work, if its still not working then perform these steps. It worked for me.

0

You have to Download the driver for your Device just go to device manager-->> your device-->update driver-->choose the usb driver path from sdk extras folder and click next. You can get the correct driver and you can run on real device

Pratik Gondil
  • 689
  • 1
  • 6
  • 17
0

If USB Debugging Mode is enabled and does not work, you should install your device driver.

For Nexus Devices;

  • Install Google USB Drivers on SDK Tools.
  • Go to Control Panel > Device Manager and check drivers status. (Probably you can see warning icon on ADB Interface Driver.) Select ADB Interface driver and click update. Choose "Browse my computer for driver software" and set folder path like "D:\Users\userName\AppData\Local\Android\sdk".

For Another Devices;

  • If you install the model's driver, it may work. For ex: Samsung Kies, LG PC Suite.

Hope it helps!

oyenigun
  • 587
  • 6
  • 15
  • For mac, non need to install device driver. For windows one will require to install necessary device drivers. – Beena Dec 29 '16 at 06:45
0

I tried @Mr. Stark answer. It didn't work. It failed to install the drive. I have Samsung S8 plus. I enabled the debugging mode on device then installed Android USB Driver for Windows from Samsung site, it works.

Mohammad Hammadi
  • 733
  • 2
  • 11
  • 34
0

Other 2 step solution could be for Android Studio;

  1. "After installing cellphone drivers" on your computer(if it is needed? and device is not detected already in windows, most cellphone are now a days plug and play or auto detected by the windows, u can use windows "settings->devices" or "settings->phone" or "control-panel->Devices & Printers" to see if your cellphone is detected). If not you need to install devices drivers for your cellphone possibly form its OEM or manufacturer website.

  2. Open Project you want to run in your cellphone; Click, Run -> Select Device... -> In popup menu select "Troubleshoot Device Connections" at the bottom of the list, it is a wizard and it'll guide you through all steps necessary to enable USB Debugging on your cellphone.

  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Nov 29 '21 at 05:18