Android Studio not showing logcat for EMULATOR - android-studio

If I run my app in a device I can see the logcat for my app with no problems.
However, When I run the app on the emulator the logcat remains empty. I have changed the device to use emulator:
The emulator doesn't show actually anything, not only for my app. I enabled the developer mode expecting this to solve the problem but logcat remains empty.
Is there an additional configuration to do?

Ok, this may be a problem with adb inconsistancy. Try restarting it with :
adb kill-server && adb start-server

Related

No connected devices found; please connect a device, or see flutter.io/setup for getting started instructions

i am using the Android Studion 3.3 on Windows 10. i have created a emulator and it is running manually for the AVD manager but when i Click on Run Button the fallowing messageBox sappers
> No connected devices found; please connect a device, or see flutter.io/setup for getting started instructions.
I would try to restart your adb deamon first. Adb is the program that runs in the background to install your application to the simulator. You can do that by using the following command:
adb kill-server
Then you can run adb devices. If should start adb again and if it shows your emulator, it means that the simulator is sucessfully connected to adb, which means you are ready to try to install the application again from Android Studio.
If that still does not work, you can also restart Android Studio and the emulator, which often solves this kind of problems for me. (It's also useful if you run flutter doctor, it will tell you if any devices are connected).

Device emulator-5554 disconnected (with no Emulators on Android Studio)

I get an error while trying to run any app on a physical device.
Device emulator-5554disconnected, monitoring stopped.
Error while Installing APK
It works after trying at least 3 times, but sometimes it gets frustrating.
I tried to delete all the emulators and reinstall Android Studio but it didn't help. and the set deployment target is always flashing like so:
flashing emulator error
In my case it looks like Docker interferes with adb.
I tried restarting Android Studio, adb kill-server && adb start-server, and anything else I could think of.
Then I tried killing all docker containers and quitting the docker app, and everything works nicely again! Edit: Killing the containers is enough
I'm wondering if this is a newly introduced issue in Android Studio/adb/Docker - I updated to AS 3.4 recently, and I don't remember having this problem in the past, but it could have just been a coincidence.
I tried the suggestion but it didn't work, after a few days of work on it, I found out that a vpn software (SoftEther) that I had installed was causing the problem, uninstalling it solved everything.
it seems adb was interfering with a network bridge the software was trying to create.
Try restarting the adb.
Use the following command to restart adb
adb -d kill-server && adb -d start-server
Use command -d for real device and command -e for emulator in case both are connected
Also if that doesnot work clean the project and reset connected emulator.
Run Emulator and wait for the home screen of the Emulator to load
Click Window > Open Perspective > DDMS
In Devices Panel, click on drop down menu > Reset adb
Run project

Android Studio detects device only after running it the second time

I have Android Studio 2.3.2 installed on my Windows 10. These are the steps I have to undergo to get my code working.
Open Android Studio.
Android Monitor doesn't detect any device.
I type adb start-server in the Terminal.
Close Android Studio.
Reopen Android Studio
Now the Android Monitor initializes and detects my device.
Now, I don't want to go through the first 4 steps. What should I do?
P.S I have tried running the adb start-server from command prompt before doing the first step, but that changes nothing.

Android Studio Debugger Port Error - "handshake failed - connection prematurely closed"

When I try to attach the Android Studio Debugger to a process, I get the following error:
Error running Android Debugger (8603):
Unable to open debugger port (localhost:8603): java.io.IOException "handshake failed - connection prematurally closed"
Kudos to whoever spelled prematurely that way.
Anyway, how do I get around this problem?
I'm using Android Studio 1.2.2 on Ubuntu.
This did not help.
The best and one solution for me was just to restart Android Studio.
Before I tried to restart adb server from command prompt or disable and enable adb integration from tools->Android->Check/Unchek the line, unplug and plug device , but nothing helped.
For me these didnt work: Restart Android Studio,adb kill start server, restart phone.
Worked for me: Tools->Android->Disable and Enabled ADB Integration.
On Windows, restarting Android Studio didn't work. I instead killed the "adb.exe" process then retried.
I didn't need to restart my device, only restarting android studio fixed it ( clean your project if needed).
If doesn't work then restart your device.
Maybe you should consider retaining only one device or a emulator, because Android Studio or Intellij IDEA only accept one device or emulator when debugging. It works well for me. I hope this can help.
Restarting the ADB server worked for me:
$ adb kill-server
$ adb start-server
* daemon not running. starting it now at tcp:5037 *
* daemon started successfully *
$ adb devices
List of devices attached
ce0217127216c0220c device
I had to restart both my android device and android studio. That seemed to work for me.
In my case, often the reason is bad USB cable. Just replace another, better USB cable will work.
It shows that your previous debbugger was not closed. You should click stop (red button) to stop your attach previously, and rerun your debbugger. It would attach again

Command line Logs in Android Studio

I'm using Android Studio to build an Android app. Is there a windows to show up which adb command lines the Android Studio are currently using? For example, when the Android Studio is launching the app to the device or the emulator, the windows will show up the adb commands to launch the app.
I notice that there is an "ADB logs" windows which show the logs, but I hope to see the command lines that AS is calling.
Thanks!
I finally figured out the way to inspect the adb commands. When launching the app, we can inspect those commands in the Run tap at the bottom of the Android Studio, though these commands are mixed with some other logs.

Resources