The concept of simulators and emulators resemble something else in everyone’s mind.
A gamer may think about all the retro games they can play while a DevOps professional may think about virtualization.
For a mobile app enthusiast, however, it is a mobile OS running in a desktop environment, but it can be achieved both with simulation and emulation and there is a confusion on which is which thanks to Apple and Google’s different approaches towards the same subject.
What is an emulator?
The concept of an emulator is best known for running older applications on newer hardware with the compatible old hardware that is “emulated” (mimicked) at the software level.
With gaming and virtualization, emulation became more or less mainstream and people had a general idea that an emulator is a piece of software that mimics hardware.
What is a simulator?
Simulation, on the other hand, has been a more general concept that is also used out of the context of computing, which is basically an imitation of a system. In computing, it is also used in a similar meaning as an imitation of a software system, but not the underlying hardware.
Simulation and Emulation in the context of mobility
Then came the mobile devices and mobile apps and emulation and simulation became an indispensable part of the mobile developers’ and mobile app enthusiasts’ lives with the burning question of the difference of mobile device emulators and simulators.
The reason for this question being asked frequently is that Android Studio is shipped with Android emulators while Xcode is shipped with iOS simulators.
Though the difference is still the same universal difference. The Android emulators emulate actual Android hardware, so essentially you are running an actual mobile device with full access to hardware data.
This is more taxing on the host system, but it has higher compatibility both for the guest and the host, compared to the simulators. For instance, you can run binaries compiled for actual hardware.
The iOS simulators simulate an iOS device at the software level, so you are running a special version of iOS designed for Mac hardware.
This provides high performance with the sacrifice of compatibility. Running an app on the iOS simulator is not so different than running an app on macOS (there is of course still a visible performance impact), but it may cause compatibility issues. Not all apps and libraries have simulator-specific versions and you cannot run binaries compiled for actual hardware.
You may have encountered “in-browser simulators and emulators”, but these also work in the same way for iOS and Android with the only difference that the hosts are running in the cloud in high-performance environments. An online Android emulator is may be using the Android Studio emulator and an online iOS simulator may be using the Xcode simulator.
The architecture of mobile emulators and simulators
However, in both cases, x86 architecture is the common component due to the fact that the host systems run on x86 architecture. For the iOS simulators, this is a must due to the nature of the simulation. For Android, this is necessary for performance as well as to avoid ARM licensing issues.
From the iOS perspective, this is expected to change when Macs with ARM processors ship. As the host system will have the same architecture, the iOS apps will run on macOS natively, without simulation or Android-like emulation.
There is still limited information on this approach, but it is expected to be different from Android emulation, which has a separate emulation layer on top of the host even if it uses the same architecture with the host. macOS may contain a shared instruction set with iOS, eliminating the need for emulation.
Briefly, emulation is the mimicking of exact hardware while simulation is imitating at the software level. The difference between these two concepts in the context of mobility is observed between the difference between the Android emulators, replicas of actual Android hardware, and the iOS simulators, approximations of the iOS environment.
And technically, you can run an emulator in an emulator. Emulatorception!