The first step of making an android application is to install a suitable IDE for the development. Android Studio powered by intelliJ is one of the most popular choices. This article provides 10 possible solutions to troubleshoot when an android device is not detected by the Android Studio.
Note: This article was written based on Windows operating System. But some of the solutions will work with any other operating system as well.
A major step of the app development is to run your application and test it. For this, you need follow one of the two possible approaches, use your own device or run the app on an android virtual device (AVD — AKA an emulator).
In my opinion, the former option is more feasible, as running the emulator can be a tiring task. The emulator takes a lot of time to start, and also feeds on your own RAM. Thus, running the app on your own device is preferable most of the time. This article is written based on the Windows-7 operating system. But these steps would work in any other similar windows versions, 8, 8.1, or 10.
Most of the developers face the major issue of Android studio not recognizing your device, for the first time. Presented below are some of the approaches that can be followed in order to solve this problem.
How to check whether my device is identified
Go to your SDK installed location. Usually it will be something like, C:\Users\Dodan\AppData\Local\Android\sdk
Go to platform-tools directory and start your command prompt from there,
(Shift+Right click -> Open Command window here)
then type “adb devices” and press enter.
If your device is identified, you will see a message similar to the following
List of devices attached
If you cannot see a device there, try the following possible solutions. Remember to re-do this step after trying each solution to identify whether your device was identified.
1) Make sure USB Debugging is enabled in your device
This option is usually available under settings -> developer options menu of your phone. Make sure the tick is on.
2) Make sure you have installed the android sdk
You can find the sdk from the following link. If you have not installed it, download and install it from here, http://developer.android.com/sdk/installing/index.html
Usually this takes about 3GB of space from your hard disk
3) Install the Android USB drivers for your phone
Make sure to download the installer from the original manufacturer. Most other alternatives will make your life even harder.
For example, for samsung devices, you can install the original software from the from the following link.
4) Install Google USB Driver
For this first you have to start the SDK manager from your computer. It will be installed usually in the following location.
C:\Users\<User Account>\AppData\Local\Android\sdk\SDK Manager.exe
In the “Extras” section of the SDK manager, you will find an option named, “Google USB Driver”. Select it and install it.
5) Install a device software
This is not the same as the Android USB drivers. For samsung, it is the Kies software. For HTC, it will be the HTC Sync Manager. Similarly, install the software related to your device brand.
Usually your device connects to the computer as an MTP device. Sometimes, changing it to Camera(PTP) or Mass Storage(USM) solves the issue.
6) Configure/Change Media Mode
Right click “My Computer” and click “Manage”.
From the Computer Management window, select, “Device Manager”
You will see your device under “other devices”, “Portable devices” or “Universal Serial Bus Controllers”.
Right click and select the update driver option.
8) Configure Knox security settings
If your device is a samsung s6, you should additionally enable knox configurations listed under, settings->Security
9) Try Swapping USB ports and cables
Sounds weird! But this has proven to be the problem many people had. Try plugging your device to different ports, or try using different cables. Some cables may either be incompatible or damaged.
I know that sounds bad. But, if any of those options does not work, you can either try restarting your machine, or reinstalling all the software, including android studio and the sdk, well may be, a different version.
Originally published at simplifycs.blogspot.com on November 22, 2015.