Android Emulator AVD closes on Mac as soon it is opened. How to check the error logs? In which location is it stored to examine the issue?
Edit: I happened to fix the issue myself. Answer below. In my case, I had to quit Docker.
To see the logs when launching the emulator, I had to use the terminal directly.
First,
$ANDROID_SDK_HOME/tools/emulator #device_name. For me it was /Users/rakshakhegde/Library/Android/sdk/tools/emulator #Nexus_5X_API_O.
In the logs it said that emulator: Failed to sync vcpu reg. So from this SO post I realized that any other running VM can interfere to open the emulator. In my case, it was Docker running in the background. After I killed it, got my emulator running.
adb logcat works for me while running the emulator from AVD Manager in Android Studio 3.2.1
Related
I'm very new to Android Studio. I have been using it on Windows but the machine was too old to run any of the emulators so I installed it (via Ubuntu Software store) on a laptop running Unbuntu 18.04.
It all seems to work OK except the Logcat does not show anything. Sometimes, after cold starting the emulator, I get some output to the Logcat but then it just halts and nothing I do (see below) causes it to output anything else.
I cannot get ANY output when running an app.
I have searched extensively here and via Google and tried the following:
restarted the Studio
restarted logcat
killed and restarted adb
invalidate caches and restart AS
deleting and recreating AVDs
use logcat via AS built in terminal and external shell :
./adb -s emulator-5554 logcat
and get:
Unable to open log device '/dev/log/main': No such file or directory
NB: When using an attached phone e.g. Moto G. the logcat works fine. I get all the system output and the app output works as expected.
Thanks in advance
2019-12-14 UPDATE: when the emulator is running it shows the active processes (see screenshot) in the drop down, including my app but NO entries. Not sure if this gives anyone a clue? It is clearly communicating with the emulator in some way.
2019-12-16 UPDATE: Started in from scratch. Installed MX Linux 19 and fresh Studio install. Created new AVD. EXACTLY THE SAME!!! This is so ridiculous. Anyone, please?
sometimes you might be trying to use a gun to kill a fly. For a try, ensure that the emulator you have run is actually selected in logcat like in this screen shot
.
I'm creating an application in android studio but I am um able test it on the virtual emulator because the adb process won't start. It's giving this error.
I tried manually starting adb and all other things but this happens.
I tried reinstalling android studio and platform tools. I downloaded a separate adb and ran "adb start-server"/"kill server".
It just doesn't seem to work. So i constantly have to build the entire thing and generate apk to run it. Please help me guys!!!
Also regarding the virtual emulator i have intel haxm installed if that information was necessary.
It's may be because your emulator adb not allow the android studio to run on it and android studio try to stop and re-run but this process fail.
Me also the same problem. So i always follows this step and it's work for me.
1. Open android studio.
2. Try to run your app without opening your emulator(It will start your adb).
3. Then open your emulator and run your app.
It's working for me. May solve your problem.
adb server didnt ack. This issue will resolve ussually when you kill all instances of adb.exe and restart server again.
Open Task manager and kill all adb instances and start server again.
Try the following:
Close Studio.
End adb.exe process in taskmanager.
Issue kill and
Run adb kill-server
Run adb devices
Then start the emulator and try adb devices again. This should list your emulator-device.
Run you apk in studio.
If your are using Genymotion,try to link your Android Studio 's SDK to Genymotion Android SDK Path.Then try to type with adb devices, I hope this will help for you.
I'm trying execute my application, but it occurs the following problem:
Failed to start Emulator console for 5554
I've already done:
Clean and Build Project and restart
Check:
if you have downloaded all of the emulator files from the SDK Manager for the version you're trying to use.
if you have enough RAM left to use for the emulator (remember that you define it in the device config)
if there's not another emulator already running.
Another way to know what's the problem is to check the LogCat, it provides very useful information about errors and all the stuff running, if you can't figure the problem reading it, try to ask a question with the error message FROM the LogCat, not only the one from the windows in your screen.
I had the same problem.
Finally I launched the emulator in command line. use "sudo ./emulator #(your device name)", and it can work properly with port 5554.
While installing the android application in the emulator I am getting the following error.
Please help me to resolve this error.
Error message:
emulator.exe -avd avd_name
adb wait-for-device
adb install path-to.apk
could not access the package manager. is the system running while installing android application....
You need to wait for the emulator to full start - takes a few minutes. Once it is fully started (UI on the emulator will change), it should work.
You will need to restart the app after the emulator is running and choose the running emulator when prompted.
As other have said, this error occurs because the emulator is still in the process of launching. An attempt to access the package manager, for the device, at this time causes an error.
It's just a simple timing issue. Here are the steps to avoid this error:
Wait until the emulator 'lock screen' is showing.
Run the 'app' again (^R in most IDE's).
Choose the running device (Should be the same emulator).
App should install without error.
In my case it was just that the emulator took 9 minutes to start. Wait until you see the lock icon on the emulator LCD. Or use actual tablet or phone.
Facing Same issues following Link helped solving the problem. The above solutions were not helpful for me.
deployment-failed-could-not-access-the-package-manager-is-the-system-running
By restarting server using CMD application was back to work. Open cmd (Run as administrator), open this
cd C:\Program Files (x86)\Android\android-sdk\platform-tools
(this path must specify your android-sdk installation folder )
Now, first write,
adb kill-server and then adb start-server.
Kill the process/server and restart it.! It worked.
You can avoid the error by setting default device before launching application. Launch the AVD before starting the app.
Once you see this error, wait for emulator to show lock screen. And then relaunch the app in your IDE and check the emulator again. It works for me always.
In Android studio, you can relaunch by clicking the green play button or ctrl + r.
If this error is gotten when using a rooted device's su prompt and not from emulator, disable SELinux first
setenforce 0
You may need to switch to shell user first for some pm operations
su shell
then re-run your pm command.
Same applies to am commands unavailable from su prompt.
The solution for me was to restart the IDE. I suspect that a slow emulator was hiding from view, blocking installation on my device.
Check your project build is in Debug mode not Release, I had some problem for debugging always I forget to change Release mode to Debug (Xamarin Users)
I Got this type of error when Run a program on emulator.
ERROR: the user data image is used by another emulator. aborting
Exit from eclipse and ADB , and watch your task manager that how much emulator is running. is there anymore then one then close it and restart the eclipse and start ADB.
reboot your computer, this happens when the ADB bridge crashes sometimes.
I've found that stopping and restarting the emulator (and perhaps Eclipse) will fix it - less drastic than rebooting.