Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why Android Emulator is Way Slower than iPhone Simulator? [closed]

Just Curious. Did Apple do an awesome job with their iPhone simulator?

When Compared,The android Emulator running on i7 and iPhone simulator on i3. The iPhone simulator is faster than the real iPhone.

Did I fail to set things up right?

like image 200
user4951 Avatar asked Nov 28 '22 21:11

user4951


1 Answers

It's a matter of architectural decisions:

  • iOS simulator runs native code, directly on your CPU - the project has to be recompiled for x86 architecture to be used with simulator. The simulator itself simply emulates all the iOS APIs.

  • Android emulator, on the other hand, uses QEMU to run ARM (or x86, but ARM is more popular) CPU virtual machine, with all the software stack on top of it - Linux kernel, Android system image, etc. Think of it as an emulated hardware.

It's a sort of trade off - the way iOS does it is much faster, but it is harder to make it 100% compatible with the target system. For Apple it was perhaps a bit simpler, as iOS and Mac OS have many things in common.

For Android it makes a lot of sense to emulate the whole stack - it is easier to build cross-platform SDK, easier to test some system level components with it, etc. It's simply a different ecosystem, with different goals. Don't forget, that Android emulator can be used e.g. to test native ARM libraries compiled with Android NDK.

Today the Android emulator performance is more or less acceptable, but it was just a disaster in the early Android days. That said, personally I think that fast, API-level native simulator for Android would be a great addition to the SDK, making it possible to test less demanding projects much faster.

Interesting reading: http://logic-explained.blogspot.com/2011/09/why-is-there-no-x86-native-emulator-for.html

like image 171
Code Painters Avatar answered Mar 11 '23 17:03

Code Painters