741g / android-emulator-m1-preview

A place to store preview versions of Android Emulator on Apple Silicon and provide instructions/support.
Apache License 2.0
405 stars 26 forks source link

32 bit ARM support? #2

Open shatyuka opened 3 years ago

shatyuka commented 3 years ago

I know macOS does not support 32-bit apps after version 10.15. But do we have any chance to run 32-bit apps in the Android Emulator either native or emulating? Thanks.

741g commented 3 years ago

Hi, we haven't gotten any 32-bit ARM code to run natively on M1 yet. It's likely this would require a binary translation layer as 32-bit ARM code hasn't been supported by Apple hardware for a while.

However, 32-bit x86 should be supported via Virtualization.framework, which we also plan to integrate into the emulator as it will allow us to also run the existing x86 system images.

shatyuka commented 3 years ago

Hi, we haven't gotten any 32-bit ARM code to run natively on M1 yet. It's likely this would require a binary translation layer as 32-bit ARM code hasn't been supported by Apple hardware for a while.

However, 32-bit x86 should be supported via Virtualization.framework, which we also plan to integrate into the emulator as it will allow us to also run the existing x86 system images.

I think 32-bit arm support is more useful than x86 as most apps are target for mobile phones. So will you develop a translation layer like libhoudini?

741g commented 3 years ago

Hi, we haven't gotten any 32-bit ARM code to run natively on M1 yet. It's likely this would require a binary translation layer as 32-bit ARM code hasn't been supported by Apple hardware for a while. However, 32-bit x86 should be supported via Virtualization.framework, which we also plan to integrate into the emulator as it will allow us to also run the existing x86 system images.

I think 32-bit arm support is more useful than x86 as most apps are target for mobile phones. So will you develop a translation layer like libhoudini?

I can definitely check with folks internally. However, see https://android-developers.googleblog.com/2019/01/get-your-apps-ready-for-64-bit.html

From August of last year, we've required 64-bit in addition to 32-bit code when publishing apps to Google Play. IMO, going forward in supporting new hardware platforms such as M1, we should keep the 64-bit requirement in mind and not make ARM32 support as high a priority. The emulator needs to serve as a reference for Android app developers and it won't help the ecosystem if the emulator continues to default to or support 32-bit.

shatyuka commented 3 years ago

I think we need to enable 32-bit arm emulation for the QEMU arm64. However, I don't know how to achieve this. Or we could build the 32-bit arm emulator runs pure armv7 Android.

shatyuka commented 3 years ago

I think we need to enable 32-bit arm emulation for the QEMU arm64. However, I don't know how to achieve this. Or we could build the 32-bit arm emulator runs pure armv7 Android.

Update: I compiled the qemu-system-armel, it runs VERY SLOW just like emulate arm in x86. Maybe we need qemu user mode to load armv7 library under arm64 environment.

Tired about this. I'm absolutely support 64bit, however, some software provider does not think so.

For future viewer, here is the patch. Use it at your own risk. armeabi-v7a.patch.zip