Introduction
Often there is a need to check the work of the newly written application on the device. But it may well be that the device is not at hand. Or not a device with certain parameters (although this is more related to the size / resolution of the screen). What to do in this case?
Fortunately, there are alternatives. Android community and different companies offer a choice of several options for replacing android-devices for different purposes.
I will briefly talk about the following:
- Emulator in the SDK
- Genymotion
- Android x86
- Bluestacks
If interested - welcome under the cat (carefully, a lot of pictures)
Emulator in the SDK
')
Website: http://developer.android.com/sdk/index.html
The most obvious way to replace the device. If you are engaged in the development of Android - the emulator is definitely there.
Using
To use it, just open the AVD Manager from the eclipse or in the console.
/path/to/sdk/tools/android avd
create your AVD (Android Virtual Device) and run. I will not describe the process in more detail, everything is quite simple.
However, it was not without features. ARM emulators are terribly slow. It is almost impossible to check something normally, especially on a not very strong hardware (because emulating a processor with a different architecture). Here
Intel HAXM technology can come to the rescue, however it is fraught with the fact that the platform-specific code (which should work under ARM) may not work, since x86 is used.
ScreenshotsAVD manager
Launch parameters
Emulator itself
pros
- Cross-platform solution
- Included in the SDK, do not need third-party Tula
- Configurable (memory size, camera connection, etc.)
- Telnet access to configure network settings, battery, etc.
- Eclipse plugin, easy access via adb
- Updated immediately after the release of the new version of Android
Minuses
Genymotion
Website: http://www.genymotion.com/
Proprietary implementation that grew out of the AndroVM project.
In fact, a virtual machine on VirtualBox with additional features like its controls, advanced settings, etc.
It is convenient enough, fast, a lot of possibilities, commandline tools, Java API for tests.
When creating a device, its image is downloaded from the network.
APK can be installed by dragging them onto the virtual box.
ScreenshotsWindow working device
Creating a virtual device
Main application window
pros
- Cross-platform solution
- Fast
- Many extras (charge control, accelerometer, test API, etc.)
- Eclipse plugin, easy access via adb
Minuses
- Paid for companies, and this is the main disadvantage
- Not ARM
- Enough long output of current versions of Android
Android x86
Website: http://www.android-x86.org/
Project for porting Android to the x86 platform. It is distributed as an iso image, you can run / install it in a virtual machine, with a strong desire, you can even put it on a live machine with an x86 processor (on a laptop, for example).
It works fast, but there are a lot of problems due to the fact that this is a virtual machine. For example, mouse bindings inside the virtual box, access to adb via network only, etc.
To use in VirtualBox, you need to disable Mouse Integration, otherwise the cursor in the virtual machine is not visible.
To connect adb need to run
adb connect ip.add.res.s
The IP address can be found by pressing Alt + F1 in the machine and entering netcfg. Return to graphics mode - Alt + F7.
ScreenshotsMain window:
Console with IP Address:
pros
- Cross-platform solution (wherever there is VirtualBox)
- Fast
Minuses
- Inconvenient access to adb
- VM-related drawbacks - mouse bind, for example
- Not ARM
- Very long release of current versions.
Bluestacks
Website: www.bluestacks.com
Positioned as a player application for Windows, Mac and TV. Able to run applications, has access to the market. Inconvenient for development and testing - apk is installed using the kit, but adb access is available. However, it can be useful to launch applications.
To connect via adb:
adb connect 127.0.0.1
ScreenshotsRun:
Main window:
pros
- Cross-platform solution (true, only Mac and Windows)
- Fast
Minuses
- Inconvenient to install applications
- It is not clear that with android versions (2.3 under OS X, under Windows it was installed 4.0)
- No under linux
Conclusion
It turns out that for some situations you can do without a device. However, one should not forget that in many cases the emulator hardware is different from the real one, and the firmware of real devices can also throw surprises. Therefore, emulators are just for initial testing.