Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot load APK on device because non existing emulator appears and disappears in Android Studio 3.3

After installing Android Studio 3.3, the "Select deployment target" toggles between no connected devices and a non-existing emulator.

Every time when trying to install the App on an emulator or a real device, it shows below error message:

02/01 18:05:26: Launching app
$ adb push /Users/jimclermonts/Documents/Android-Code/sources/app/build/outputs/apk/acceptance/debug/app-acceptance-debug.apk /data/local/tmp/nl.mycompanyname.acc
Device emulator-5556disconnected, monitoring stopped.
Error while Installing APK

Here is a video showing the strange toggling:

 in

I tried killing it programmatically but it keeps booting itself:

Mac-van-Jim:~ jimclermonts$ adb devices
List of devices attached
emulator-5556   offline

Mac-van-Jim:~ jimclermonts$ adb devices
List of devices attached

Mac-van-Jim:~ jimclermonts$ adb devices
List of devices attached

Mac-van-Jim:~ jimclermonts$ adb devices
List of devices attached
emulator-5556   offline

Mac-van-Jim:~ jimclermonts$ adb devices
List of devices attached

Mac-van-Jim:~ jimclermonts$ adb -s emulator-5556 emu kill
Mac-van-Jim:~ jimclermonts$ adb -s emulator-5556 emu kill
Mac-van-Jim:~ jimclermonts$ adb -s emulator-5556 emu kill
Mac-van-Jim:~ jimclermonts$ adb devices
List of devices attached

Mac-van-Jim:~ jimclermonts$ adb devices
List of devices attached

Mac-van-Jim:~ jimclermonts$ adb devices
List of devices attached
emulator-5556   offline

it just keeps starting and stopping adb...

enter image description here

Update:

Deleted Android Studio 3.3,

Deleted these directories:

users/jimclermonts/library/Android users/jimclermonts/.android users/jimclermonts/.gradle users/jimclermonts/Library/Application Support/AndroidStudio3.3

Removed all Android emulators, Genymotion and .Genymobile directory as well.

Updated from High Sierra to Mojave, same problem.

Reverted back to AS 3.2.1 and added SDK. Same problem.

like image 456
Jim Clermonts Avatar asked Feb 01 '19 17:02

Jim Clermonts


People also ask

How do I fix the emulator process for AVD has terminated?

1. Create any Emulator configuration in Device Manager, start it, won't start and terminates immediately. 2. Uninstall Android Emulator tools from SDK Manager, re-install the same tools, create emulator configuration, start the same, won't start and terminates immediately.

Can I install an APK on Android Studio emulator?

You can ofcourse just run the application from the UI which will automatically install it. “To install an APK file on the emulated device, drag an APK file onto the emulator screen. An APK Installer dialog appears. When the installation completes, you can view the app in your apps list.


2 Answers

I have struggled with this from yesterday on my Mac. Port 5556 is taken by an other app and that causes a fake emulator to be shown (in my case it was Videostream app)

Solution (in terminal):

  1. sudo lsof -i:5556 // or any other port that is shown as emulator name, you will get PID
  2. ps ax | grep [PID] It gave me the file that used the port (it was one of the files in Videostream app)
  3. I used AppCleaner app to uninstall Videostream (but simple removal is sufficient)
  4. I killed the PID with: kill -QUIT [PID]
like image 104
Wiktor Wardzichowski Avatar answered Nov 15 '22 06:11

Wiktor Wardzichowski


Have you tried killing adb and restarting it?

 adb kill-server
 then
 adb start-server
like image 32
AzraelPwnz Avatar answered Nov 15 '22 07:11

AzraelPwnz