I was trying to run Android Studio Emulator on my old 13-inch Mid 2012 MacBook Pro (Mac OS X Catalina, version 10.15.7). Every time I tried to start a Virtual Device it failed to start, it crashed all the time. Checking the idea.log
, which located at $HOME/Library/Logs/Google/AndroidStudio2023.1/
, give me some hints.
The log tells me that the current installed emulator was build for the newer version of MacBook Pro and newer Mac OS, in this case the Mac OS X 11.1. So to make the Android SDK Emulator run again on my MacBook Pro, I need to downgrade my Android emulator version.
Here are the clues from the log file:
2024-02-11 07:30:14,110 [7595298] INFO - Emulator: Medium Phone API 27 - /Users/wayan/Library/Android/sdk/emulator/emulator -netdelay none -netspeed full -avd Medium_Phone_API_27 -qt-hide-window -grpc-use-token -idle-grpc-timeout 300
2024-02-11 07:30:14,200 [7595388] INFO - Emulator: Medium Phone API 27 - Android emulator version 33.1.24.0 (build_id 11237101) (CL:N/A)
2024-02-11 07:30:14,200 [7595388] INFO - Emulator: Medium Phone API 27 - Found systemPath /Users/wayan/Library/Android/sdk/system-images/android-27/google_apis_playstore/x86/
2024-02-11 07:30:15,424 [7596612] INFO - Emulator: Medium Phone API 27 - dyld: Symbol not found: _vmnet_e
2024-02-11 07:30:15,428 [7596616] INFO - Emulator: Medium Phone API 27 - nable_isolation_key
2024-02-11 07:30:15,429 [7596617] INFO - Emulator: Medium Phone API 27 - Referenced
2024-02-11 07:30:15,429 [7596617] INFO - Emulator: Medium Phone API 27 - from: /Users/wayan/Library/Android/sdk/emulator/qemu/darwin-x86_64/qemu-system-i386 (which was built for Mac OS X 11.1)
2024-02-11 07:30:15,429 [7596617] INFO - Emulator: Medium Phone API 27 - Expected in: /System/Library/Frameworks/vmnet.framework/Versions/A/vmnet
2024-02-11 07:30:15,429 [7596617] INFO - Emulator: Medium Phone API 27 - in /Users/wayan/Library/Android/sdk/emulator/qemu/darwin-x86_64/qemu-system-i386
2024-02-11 07:30:15,430 [7596618] INFO - Emulator: Medium Phone API 27 - Process finished with exit code 134 (interrupted by signal 6: SIGABRT)
2024-02-11 07:30:15,431 [7596619] SEVERE - Emulator: Medium Phone API 27 - Emulator terminated with exit code 134
java.lang.Throwable: Emulator terminated with exit code 134
at com.intellij.openapi.diagnostic.Logger.error(Logger.java:202)
at com.android.tools.idea.avdmanager.EmulatorProcessHandler$ConsoleListener.onTextAvailable(EmulatorProcessHandler.kt:89)
at jdk.internal.reflect.GeneratedMethodAccessor40.invoke(Unknown Source)
So these are the steps that I need to do to downgrade it:
- Download an older version of Android Emulator, here is the link to Android Emulator archive: https://developer.android.com/studio/emulator_archive.
- I download version
30.7.4
. - Locate the current emulator directory, which is under my Android SDK installation directory at
$HOME/Library/Android/sdk
. - Rename the existing emulator directory from
emulator
toemulator_original
. - Next, I unzip the downloaded emulator,
emulator-darwin_x64-7324830.zip
, and copy it to the same location where the original emulator was located. - In the SDK installation directory, run the following command
xattr -dr com.apple.quarantine emulator/
from the terminal app to clear the quarantine attribute on the emulator package. - Copy the
package.xml
file from theemulator_original
directory to theemulator
directory. - Change the emulator version in the
package.xml
file, it located at the end of the file. It should look something like:
<revision><major>30</major><minor>7</minor><micro>4</micro></revision>
After downgrading the emulator, I restarted the Android Studio, and I can now start the emulator successfully and able to run and test my application in the old MacBook Pro again.