Table of contents
What would you prefer to use during your tests? An emulator or a real device? When trying to test a certain feature on your new software, you may find that the software app does not run well on your device. But what if you can’t afford (or don’t want) to buy many different devices? What if you only have an Android phone…? A simulator will allow you to easily test your app on various devices with just one computer.
There are basically two major reasons why one might choose to test on a simulator instead of an actual device.
1) Testing extra hardware.
Sometimes you are testing something that requires extra hardware like the accelerometer.
2) Limited processing power.
Often the devices are slow and have limited processing power. (While this may seem strange, it usually takes hours to download and install all the new apps that I look at.) Using an emulator lets you test quickly on a virtual device connected to the same computer.
Emulators can also be used for testing game mechanics. For example, suppose you want to make sure that your objects are properly translated on different devices. An emulator will let you test your translations with different languages without having to go through the hassle of downloading, preparing and uploading the app for each device. You can even put each language’s text in separate folders and only need to add code that translates it from one language to another.
Emulators are useful not only for games but also for other purposes like if you need to test a themed interface or something as complex as running Linux on your phone (the Android Emulator).
Factors to consider for when to use emulators instead of real devices for testing
- Testing screen rotation or other sensor-based features? – Use a simulator if your device doesn’t have those sensors.
- Testing Android features? – If it is a feature that requires specific hardware on your device, use a real device. Otherwise, use an emulator.
- Test on multiple devices? – Use an emulator if you don’t own all the devices, or don’t want to spend the time and money to buy them.
- Low end or high end devices? – If your device is slow and has low processing power, use a simulator instead of a real device.
- Testing translations? – Use a real device if you tested your app on several different devices and the translations are different. (Android does not keep the translations upon user uninstall.)
- Testing something else? – If it is something that does not require specific hardware on your device or the device is too slow, use a simulator.
When developing your app you need to know what type of android users will be running it. An audience consisting of both high-end and low-end android phones is unlikely because most businesses want to target high-end Android users in order to get the best app ratings, while indie developers are more likely to target low-end devices because they are cheaper than mid or high-end phones.
Do emulators give accurate results compared to real devices?
There are lots of reasons for the differences between an actual device and an emulator.
- Real devices run on specific versions of the Android operating system. Emulators run on a version of Android that has been compiled from the source code which may include different features. There are also different builds of each version of the OS (e.g. you may test your app on a device running Android 2.1 but several newer builds have come out since then). All these factors can give you differences in behavior between emulators and real devices.
- Emulators can use different hardware which can be faster or slower than real devices.
- Emulators can have different screen resolutions and often have lower processing power. (They aren’t always slower, some emulators are faster than real devices, sometimes the emulator will only show a small part of your application instead of the whole screen.)
- Emulator skins may not display system UI elements correctly. (For example, an app may not receive notifications from the system properly because the skin doesn’t display them in their proper location as well as it would in a real device.)
So the short answer is no, emulators are fairly accurate for the most part but they will not give you the exact same results as a real device.
What are the most popular emulators to use?
- GenyMotion Looks like a real Android phone, simple interface and can run on Windows, Linux and Mac OS X
- AVD (Android Virtual Device) Free software made by Google that lets you run Android inside Windows
- BlueStacks Based on the Android open source project, lets you run Android apps on Windows, Mac or Linux
As you can see from the above recommendations, using a simulator is recommended when testing features because you can use the same app on several different devices and still get accurate results. But if you are testing screen rotation or other sensor-based features, don’t make a decision based on speed alone; also look at the features to be tested.
Read an interesting article about the major levels of software testing.