Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to test android apps in a real device with Android Studio?

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
like image 823
Miguel Ángel Avatar asked Feb 22 '14 00:02

Miguel Ángel


People also ask

How can I run Android apps on my real phone?

Run the app on your device as follows: In Android Studio, select your app from the run/debug configurations drop-down menu in the toolbar. In the toolbar, select the device that you want to run your app on from the target device drop-down menu.

Can Android Studio run on Android device?

When you are set up and plugged in over USB, you can click Run in Android Studio to build and run your app on the device. You can also use adb to issue commands, as follows: Verify that your device is connected by running the adb devices command from your android_sdk /platform-tools/ directory.


2 Answers

  • 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.
like image 23
Let's help Avatar answered Oct 11 '22 01:10

Let's help


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.

like image 106
Miguel Ángel Avatar answered Oct 11 '22 02:10

Miguel Ángel