Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Emulator appearing offline on M1 Mac after the last update of arm64-v8a

Yesterday the emulator was working perfectly. The system image was arm64-v8a. I don't exactly remember the Release name of the working system image but, yesterday there was an update for the ARM 64 system image which I accepted and the release name is "S".

I can start the emulator from my AVD Manager, the emulator also starts when I press the 'Run app' button however, the app isn't loaded on the emulator and the emulator appears offline if I check through "adb devices" or if I click on "Troubleshoot Device connections" it shows:

"emulator-5554 - Device is currently in the offline state"

I have tried most of the suggestions found on StackOverflow like:

  • adb kill-server, adb start-server

  • Remove and re-create AVD device

  • Invalidate Caches/Restart

  • Enable USB debugging inside the emulator

  • Wipe data and cold boot from AVD manager

    I am using Android Studio 4.1.3

    Build #AI-201.8743.12.41.7199119, built on March 10, 2021 Runtime version: 1.8.0_242-release-1644-b3-6915495 x86_64 VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o macOS 10.16 GC: ParNew, ConcurrentMarkSweep Memory: 1981M Cores: 8 Registry: ide.new.welcome.screen.force=true, external.system.auto.import.disabled=true Non-Bundled Plugins: org.jetbrains.kotlin

AVD:

Name: Pixel_4_API_S
CPU/ABI: Google Play ARM (arm64-v8a)
Path: ~/.android/avd/Pixel_4_API_S.avd
Target: google_apis_playstore [Google Play] (API level S)
Skin: pixel_4
SD Card: 512M
fastboot.chosenSnapshotFile: 
runtime.network.speed: full
hw.accelerometer: yes
hw.device.name: pixel_4
hw.lcd.width: 1080
image.androidVersion.codename: S
hw.initialOrientation: Portrait
image.androidVersion.api: 29
tag.id: google_apis_playstore
hw.mainKeys: no
hw.camera.front: emulated
avd.ini.displayname: Pixel 4 API S
hw.gpu.mode: auto
hw.ramSize: 1536
PlayStore.enabled: true
fastboot.forceColdBoot: no
hw.cpu.ncore: 4
hw.keyboard: yes
hw.sensors.proximity: yes
hw.dPad: no
hw.lcd.height: 2280
vm.heapSize: 256
skin.dynamic: yes
hw.device.manufacturer: Google
hw.gps: yes
hw.audioInput: yes
image.sysdir.1: system-images/android-S/google_apis_playstore/arm64-v8a/
showDeviceFrame: yes
hw.camera.back: virtualscene
AvdId: Pixel_4_API_S
hw.lcd.density: 440
hw.arc: false
hw.device.hash2: MD5:6b5943207fe196d842659d2e43022e20
fastboot.forceChosenSnapshotBoot: no
fastboot.forceFastBoot: yes
hw.trackBall: no
hw.battery: yes
hw.sdCard: yes
tag.display: Google Play
runtime.network.latency: none
disk.dataPartition.size: 6442450944
hw.sensors.orientation: yes
avd.ini.encoding: UTF-8
hw.gpu.enabled: yes

Any idea what has gone wrong? Or how to tackle this issue?

like image 508
alex Avatar asked Apr 23 '21 12:04

alex


People also ask

Does emulator work on M1 Mac?

Native Apple Silicon Emulators Are Now Available. When the M1 chip first launched in 2020, very few emulators had native Apple Silicon versions available.

Which Android emulator is best for Mac M1?

Nox App Player Nox App Player is another Android emulator which supports the Apple M1 processor. It's the most popular way to experience mobile gaming on the desktop without installing any operating system. The emulator works more effectively than BlueStack. If you have low-end PCs then it can be run smoother.

How do I resolve Android emulator 5554 offline?

Go to cmd and type adb kill-server. Go to task manager and find adb in processes. If you find one, right click on it and click on end process tree. In eclipse, go to Window>Android Virtual Device Manager, click on the AVD you want to launch, click on start and uncheck "Launch From Snapshot" and then click on launch.

How do I uninstall offline emulator?

Show activity on this post. Restart adb by issuing adb kill-server followed by adb start-server in a command prompt. Disable and re-enable USB debugging on the phone. Rebooting the phone if it still doesn't work.

What is the best Android emulator for M1 Mac?

If you are a mobile gamer and looking for an Android emulator just for gaming on your M1 Mac then Nox App Player is easily one of the best options for you. It is a lightweight and very smooth app, that is specially designed for gaming. The user interface is quite effortless so anyone can install it on their M1 MacBook.

Is it possible to use QEMU to emulate the Apple M1?

You can get much of the way of emulating the CPU itself using qemu. qemu already supports emulating various aarch64 CPUs, but it doesn't emulate the M1 and its Apple-specific instructions (yet), nor does it emulate the rest of the SoC or the rest of the Mac's peripheral units. Last there's the question of legality.

What is the release name of the arm 64 system image?

I don't exactly remember the Release name of the working system image but, yesterday there was an update for the ARM 64 system image which I accepted and the release name is "S".

Is it possible to emulate a macOS machine with RISC/ARM architecture?

Is it possible to emulate a macOS machine with RISC/ARM architecture on a physical x86 macOS machine? I suspect this is of value for those hoping to test the viability of their workflows on Apple silicon. In such cases, a performance penalty is of no consequence.


Video Answer


2 Answers

Replace the avd system images you have downloaded with the r02 images. r03 is broken for me but reverting to r02 saved the day!

Update: It appears r03, r04, and r05 all don't work on m1

Google Play ARM 64 v8a System Image (revision: 2)

Google APIs ARM 64 v8a System Image (revision: 2)

With the latest android (4.1.3) on macOS, the directory you want to put the unzipped images in is probably something like ~/Library/Android/sdk/system-images/android-S.

For example, the path for the google play image is ~/Library/Android/sdk/system-images/android-S/google_apis_playstore/arm64-v8a

like image 93
AndrewPK Avatar answered Oct 14 '22 01:10

AndrewPK


AndrewPK's answer is really helpful.
if you are not use api level S,you can try this (My api level is "31")

1.download from https://dl.google.com/android/repository/sys-img/google_apis_playstore/arm64-v8a-S_r02-darwin.zip

2.Create a new folder as shown below, unzip the downloaded file and place it in it
enter image description here path:/ Users / $ user_name / Library / Android / sdk / system-images / android-S / google_apis_playstore / arm64-v8a

  1. Launch Android Studio and click configure> AVD Manager

  2. Click create virtual device ..., select any device, press the Next button and confirm that API level S has been added.

  3. add it to your devices and verify it works with VS Code
    enter image description here

That's it, I spent 3 hours on this> <

like image 10
Tatsuhiko Mizuno Avatar answered Oct 14 '22 01:10

Tatsuhiko Mizuno