flowkey/UIKit-cross-platform

Build Swift for x86 Android (also to support Android Emulator)

Closed this issue · 1 comments

Motivation

At the moment we can only build for armv7a. While this covers the great proportion of Swift devices on the market today, it'd be great to build for x86 devices as well for two main reasons:

  • x86 Devices make up about 10% of the total Android market, which is about 200 million devices.
  • The Android Emulator only really works with x86-built libraries. The ARM CPU emulation is so slow that it's basically unusable. This isn't a huge issue, but would be interesting particularly for things like automated tests.

Proposed solution

"Somebody" needs to make a PR on Apple's Swift repo adding support for Android x86. I suspect this won't be anywhere near as involved as the original port, but it would be a non-trivial piece of work that as far as I know has not been attempted yet.

Potential alternatives

  • Wait for x86 devices to lose market share (if this happens to be the trend over time?)

An update on this: x86 support is "done". We currently have a toolchain that builds for x86_64 at least, which is enough to support the Android Emulator at full speed. I will leave this Issue open until we update swift-android-toolchain with updated instructions