2
votes

I have updated android studio to Android Studio v2.3.3 (June 2017) and adb stopped showing logs when I launch app on android studio emulator

The log shows:

07/11 13:08:17: Launching app

$ adb push C:\Users\1\AndroidStudioProjects\Don'tWakeMeApp4\app\build\outputs\apk\app-debug.apk /data/local/tmp/oleksandr.ivanets.dontwakemeapp $ adb shell pm install -r "/data/local/tmp/oleksandr.ivanets.dontwakemeapp" Success

$ adb shell am start -n "oleksandr.ivanets.dontwakemeapp/oleksandr.ivanets.dontwakemeapp.MainActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER Client not ready yet..Waiting for process to come online Connected to process 4429 on device Nexus_5X_API_26 [emulator-5554]

2
does adb logcat launched from the command line show anything?pskink
where is the command line?Karlsson Makhno
Thank you, I have found the problem, it works but through Android Monitor.Karlsson Makhno

2 Answers

4
votes

Click on below link

http://adbshell.com/downloads

and download the first link with name ADB Kits ( contains adb.exe and necessary .dll files).

After downloading replace these files with the ones in the path

Android/Sdk/platform-tools/

Now click on adb.exe and it will open cmd and will start the adb server.

Now it will detect the device and no problem. OOOOOllllaaaaa.....

If the Problem persists again then do the same... save the folder somewhere.... just replace files... it will detect the device automatically then

1
votes

Preface: Although my answer focuses on Android Studio's perspective of ADB errors, I'm sure it is helpful for Windows ADB debugging in general!

@sHaRkBoY 's answer helped me look in the right direction. I used to get "Unable to detect adb version, adb output:" on Android Studio while trying to "run" the app onto the phone... and no devices showed up when phone was connected to PC.

I had tried all these (from different SO answers) but none of them worked!!!:

  • "Invalidate cache and restart" from File toolbar.
  • Turn off and turn on USB debugging on phone multiple times
  • Experimented with "MTP", "PTP", "Midi" and "Charging" modes to see if ADB detects something...
  • Checked my anti-virus software to see if adding exceptions to the adb directory works...
  • Installed various unnecessary C++ re-distributables
  • Tried a different USB cable (and USB port)
  • Restarted Android Studio and PC
  • and even uninstalled and re-installed Android studio!

The problem finally was that the platform_tools\adb.exe file downloaded by the official SDK tool manager was corrupted! So I used to get windows error code 0xc0000142 on launching adb.exe from command prompt! :(

SOLUTION:

For future readers (and victims xD) of the above ADB problem, please do the following:

  1. Firstly, add the platform_tools\ directory into the system path environment variable.

  2. Go ahead and replace the following 3 files in your platform_tools (C:\Users\{YourAccount}\AppData\Local\Android\Sdk\platform-tools) directory. (Please backup the same folder before, just in case.)

ADB kit (internal version number: 32)


Note: Please prefer this ADB kit (exe and dll files), compared to @sHaRkBoY 's ADB kit (2.0.0.0), since it has an updated version of AdbWinUsbApi.dll (2.0.0.1), where a race condition issue has been fixed!

I hope my answer saves your from the traumatic experience I went through while troubleshooting magical ADB for an entire day! :)