A practical guide on CPU architectures for Flutter developers

Roman Ismagilov
4 min read5 days ago

--

In this guide, we are not going to go deep on a hardware level, only practical information every mobile developer should know.

1. Android ABI

Different Android devices have different CPUs, which support different instruction sets. Each combination of a CPU and its instruction set has its own Application Binary Interface (ABI). NDK-supported ABIs are listed below.

arm64-v8a:

The arm64-v8a architecture is commonly used in modern Android devices because it supports 64-bit processing, which improves performance and allows for larger memory addressing.

Mostly every modern Android smartphone runs on arm64-v8a.

armeabi-v7a

  • The armeabi-v7a architecture refers to a 32-bit ARM architecture commonly used in many Android devices, especially those that are mid-range, budget, or older flagship models.
  • Devices using armeabi-v7a typically feature processors such as the Qualcomm Snapdragon 400 series, MediaTek MT65xx series, and Exynos 3 and 4 series.

Some examples:

  • Samsung Galaxy A01, A02, A10, J7
  • Xiaomi Redmi 9A, 9C
  • LG G2, G3

x86_64

The x86_64 ABI in Android refers to the 64-bit version of the x86 architecture, primarily used in Intel and AMD processors. x86_64 is still relevant mostly for Android emulators on desktop environments, because it aligns with the CPU architecture of Intel and AMD processors on a lot of development machines, making emulation faster. However, if you are developing on an Apple Silicon machine, it’s way better to use an arm64 emulator. Also, Intel-based Chromebooks can install and run Android apps compiled to x86_64 target.

x86

Device examples:

  • Lenovo K900
  • Asus Zenfone 5 A500CG
  • Acer Liquid C1

Is not supported by Flutter and not planned to be. It is highly recommended to exclude this ABI in your Gradle file, so Play Store won’t allow devices running on 32-bit x86 to install the app. Add this to your android/app/build.gradle file:

android {
...
defaultConfig {
...
ndk.abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86_64'
}
}

This way you can also decrease APK file size, given that unnecessary binaries won’t be included. However, this won’t have any effect on users who would install the app from the Play Store if you have uploaded an app bundle. What they install is already optimized for their device and settings.

Additionally, you can build separate APKs for each ABI. To do so, run flutter build apk --split-per-abi command. This might be useful for some testing scenarios or if you publish your apps in a store that does not support app bundles (F-Droid, Aptoide). Otherwise, it is generally a better solution to use the bundles.

Also, such ABIs as ARMv5 (armeabi), 32-bit and 64-bit MIPS were supported by Android NDK in the past, but now they are deprecated. Devices running on that could be found mostly in museums (HTC Dream, LG Optimus GT540)

2. iOS CPU Architectures

  • arm64 is the current 64-bit ARM CPU architecture, as used since the iPhone 5S and later (6, 6S, SE and 7), the iPad Air, Air 2 and Pro, with the A7 and later chips. Also used in Apple Silicon Macs and iOS Simulators running on them.
  • x86_64 (i.e. 64-bit Intel) is optionally available starting with iOS 7.0. You can encounter it when running an iOS Simulator on an Intel Mac.

Flutter currently compiles only to arm64 or x86_64 on iOS, as Apple requires all apps to be 64-bit. You don’t need to worry about 32-bit support. Historically, there have been some other architectures:

  • armv7s being used in Apple's A6 and A6X chips on iPhone 5, iPhone 5C and iPad 4.
  • armv7, an older variation of the 32-bit ARM CPU, as used in the A5 and earlier. Excluded from Flutter since 2.10
  • i386 was the only option on iOS 6.1 and below.

You can configure the target architectures in XCode. If you’re developing using an Apple Silicon computer, then you don’t need anything, but arm64.

You can find this in Build Settings / Architectures

However, if you or someone in your team is using an Intel machine, you can add x86_64 architecture.

Make sure that you exclude unwanted architectures in cases where you don’t need them to ensure adequate build time and archive size. For example, you can exclude arm64 architecture for the iOS Simulator when using an Intel machine. Or on an Apple Silicon machine when some of your plugins do not support arm64. Then, the app would be run using Rosetta.

Hope you’ve found this article useful. I will update it with more information whenever I find something useful. Follow me on Twitter to get the latest updates.

--

--

Roman Ismagilov

Covering some non-obvious nuances of Flutter development in my articles