Android Studio Unknown Emulator running and can't be terminated - android

I have one emulator actively running at the moment but I see two emulators running when I run the app. One of them is an Unknown Emulator.
When I choose the Unknown emulator, the console shows this error:
Error: Could not access the Package Manager. Is the system running?
How do I terminate this Unknown Simulator? I think it's using my system's resources and degrading the performance.

Well, it was the BlueStacks emulator running in the background. Android Studio automatically detects it. The unknown simulator was there because BlueStacks was running in the background at the Notification Tray in my windows 8.1
When I closed BlueStacks from the Notification Tray, the Unknown emulator vanished for good.

First reason if your emulator in offline.
To resolve this you need to run command kill-server from adb.
Open Command prompt->navigate to android sdk-> go to platform-tools-> adb kill-server -> adb start-server
You need to run above command to remove unknown
Second reason if your project configuration not match with emulator configuration
Change your emulator configuration with your project requirement. May be your application version not match with emulator configuration

It was very simple to fix for my case :) Just need to type the following 2 commands using CMD:
adb kill-server
adb start-server
Make sure that the windows PATH variable contains "adb.exe" file's directory location. Normally, it should be:
YOUR_PATH_TO_SDK\platform-tools
//For example: D:\sdk\platform-tools

Related

adb socket not working and daemon

I am getting this type of error
error: could not install smartsocket listener: cannot bind to
127.0.0.1:5037: Only one usage of each socket address (protocol/network address/port) is normally permitted. (10048) 1:34:26
PM could not read ok from ADB Server 1:34:26 PM * failed to start
daemon * 1:34:26 PM error: cannot connect to daemon 1:34:26 PM
'C:\Users\MITESH
SUTHAR\AppData\Local\Android\Sdk\platform-tools\adb.exe,start-server'
failed -- run manually if necessary 1:38:14 PM Unable to obtain result
of 'adb version'
my genymotion device is running but it shows me that no device
I came across the same error. I provided the below command and the issue got solved.
COMMAND :- taskkill /f /im adb.exe
Close Eclipse or Android Studio if either is running (Optional).
Open Command Prompt.
Go to the Android SDK platform-tools directory.
Type adb kill-server.
Type adb start-server.
If no error message is thrown while starting ADB server, then adb is started successfully.
OR
Go to Task Manager, open the Processes tab, and end the adb.exe process.
Then restart Android Studio.
This may work if there is any problem with adb.
In my case, none of the above solution worked. I solved it strangely maybe it can be a bug.
Do not run Genymotion emulator before Android Studio. Firstly, I opened android studio then I clicked run project and select deployment target windows appeared. Then I run genymotion emulator and now the emulator is shown in the select deployment target windows in Android Studio. Then deployed to the emulator without errors. Done!
As another way, you can try to set Genymotion sdk to the same as Android studio sdk. To do this, first find your sdk location. You can find it by right clicking the Android Studio project -> Open Module Settings-> Select SDK location -> under Android SDK location, it is shown. Then open Genymotion -> Settings -> ADB tab -> Click Use custom Android SDK tools radio button -> navigate to SDK folder used by Android studio -> Restart Genymotion virtual device
If none of the above worked for you, just make sure that you have closed Genymotion emulator as it caused this issue with me.
Easiest Way! I just ran into this issue trying to connect a React-Native App to an Android Studio emulator. If you read the error message it tells you that "Only one usage of each socket address (protocol/network address/port) is normally permitted." So you can assume that something other than React-Native is also attempting to connect to the emulator.
Terminate The Connections:
Leave the emulator running.
Close out of and uninstall any Android Studio/Eclipse Apps you have on the emulator. This terminates apps trying to connect.
Close Eclipse or Android Studio if either are running. Android Studio doesn't have to be open in order for the emulator to work (This is important). This terminates software trying to connect.
After doing so I went back into my React-Native App and connected to Expo no problem.
All you have to do is terminate all connections. However you so choose.
I came across the same error, it worked simply after restarting the AS on windows, of course, it asked for SDK update.
Android Studio 4.1.3 with API 30 installation has this error
01-04-2021
09:56 'C:\Users\ranja\Android\Sdk\platform-tools\adb.exe start-server' failed -- run manually if necessary
Tried C:\Users\ranja>adb start-server
daemon not running; starting now at tcp:5037
**could not read ok from ADB Server
failed to start daemon
error: cannot connect to daemon**
Note: I have added 'C:\Users\ranja\Android\Sdk\platform-tools' in %PATH% environment variable on Windows 10
i've encountered same error in my ionic 2. i just uninstall and reinstall ionic. and it works fine again..
npm uninstall -g ionic
npm install -g ionic

Android app is not launching in Emulator

When I am trying to launch an app in the emulator through Eclipse, the app is not launching and I am not getting any error also.
WHen I check in the target section of project properties, I can't see any AVD in the list even though I created a new AVD and it is running.
Your android emulator might fails to connect eclipse DDMS tool and ask for adb to start manually. In that case you can start or stop the adb using the command prompt.So, I recommend running in a single command line:
sudo adb kill-server && sudo adb start-server
If not works please switch To Android Studio .Eclipse is dead .

Error when launching .apk on android studio emulator

I am building an app with ai2 but I have spend hours trying to get their emulator to work, so I have exported myapp.apk and I am trying to launch it on android studio emulator.
I have followed several tuto included the answer proposed by Tarek on that thread But I am getting and error on cmd.
Here is what I tried:
run android studio as administrator, run the emulator via the AVD manager, waited until it's started.
move myapp.apk in the sdk/platform-tools folder
created a run.bat file in this folder and wrote CMD in it5. copy your desired apk to the same folder
double click on run.bat and wrote: adb install r- "myapp.apk"
Here I am getting an error on CMD: error device not found -waiting for device-. I don't understand because my emulator is running.
I have also tried to launch the emulator without starting android studio with this command emulator -avd <avd_name> [<options>] but I get this message "the system cannot find the file specified".
The error message appears because adb cannot connect to the device although it is running. This is not supposed to happen, but it does from time to time.
You can always check if adb can see the emulator by running adb devices, which should result in a list of devices it can see. If this list is empty, the device is not found. You can resolve this by adb kill-server, waiting a couple of seconds and then running adb start-server. Try running adb devices again, and the device should be listed, and the installation should succeed.
Starting an emulator can be done by running emulator #<device-name> [options]. The device name can be found by running android list avd. This will result in a list of devices of which the <device-name> will also be listed.

I/O Error Connection refused android studio

WhenI run a project in android studio, I get this error - I/O Error: Connection refused
The emulator starts fine but doesn't pull in/reflect my project
Device connected: emulator-5554
Device is online: emulator-5554
Target device: Nexus4 [emulator-5554]
Uploading file
local path: /Users/martinsjolte/AndroidStudioProjects/FirstAPP1/Firstapp1/build/apk/Firstapp1-debug-unaligned.apk
remote path: /data/local/tmp/dk.first.Firstapp1
Installing dk.first.Firstapp1
DEVICE SHELL COMMAND: pm install -r "/data/local/tmp/dk.first.Firstapp1"
Device disconnected: emulator-5554
Launching application: dk.first.Firstapp1/dk.first.Firstapp1.MainActivity.
DEVICE SHELL COMMAND: am start -n "dk.first.Firstapp1/dk.first.Firstapp1.MainActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER
I/O Error: Connection refused
My platform is a mac osx ver.12.9.1
Ok, I don't know if i got "the" answer. but here is how I've solved the same issue on my environnement ( Windows 8/Android Studio, but same error with ADT or eclipse) :
Context of my issues :
I've got an Asus PC, and with all the application suite installed by default.
So I've found that one of this Asus app ( currently "Asus sync") was using adb and in fact, it was taking control of the emulator over my adb in the AndroidSDK directory.
How to fix as a PC user :
Go to Task manager ( right click on task bar) , and look for "adb.exe" . Then right click on it and select "Open the directory". This will bring you to the responding adb. In my case it was Asus Sync, so I just had to unistall this software and everything works fine !
How to fix as a Mac user :
Go to Activity Monitor (/Applications/Utilities/), and look for "adb". Then try to kill the process. Then look if it solve your "Connection refused" in Android studio/ADT or eclipse
If still not working you can try :
Start a emulator ( with your AVD manager)
when finished loading, Open DDMS panel (in android studio : Menu Tools > Android > Monitors DDMS)
Look if you see your current running android emulator ( listed on the Device panel)
See if this line is kind of "flashing" ( connect/disconnect).
If so, you have probably a other adb instance running in conflict
If not, you can restart adb or reinstall your SDK
Hope this could help someone !
This issue occurs when Android Debug Bridge aka ADB is not responding to the request from Android Studio. I killed the process adb.exe and started it again. This solved my problem.
If you are using a real device :
Just reconnect your device, make sure your cable are workable and you installed the proper drivers.
I had the same problem, and my problem fixed by restarting the android-studio. Hope, that will help you too.
For me the following worked(after I tried the above points mentioned by others):
I tried debugging/running anther application. It was okay. So this pointed me to the direction that the current application has some problem
if (point 1 == true) {I uninstalled the application from my phone manually }
Then re-make/rebuild the application and debug/run worked

could not access the package manager. is the system running while installing android application

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)

Categories

Resources