📜 ⬆️ ⬇️

Emulator Bluestacks + Eclipse: accelerates debugging and testing of Android applications

About the Android emulator called Bluestacks on Habré already written. But they wrote, or in general , or little , or dry . Meanwhile, the project has grown and is now quite suitable for use in testing and debugging Android applications. Why do this? And then, that Bluestacks works much, no, not even much, much faster than the standard emulator from the Android SDK. Under the cut, I will talk about the nuances of using Bluestacks, setting up debugging from under Eclipse, give a couple of measurements of the speed of work and talk about a few spoons of tar in a barrel of honey.

Installation


Everything is standard - download , set. I warn you right away, as the emulator is installed on Win7, it hangs on me, and this is true with Windows. This, of course, spoiled the first impression a bit, but after restarting Bluestacks worked fine. In general, you can take this all as a forced reboot during the installation - close important programs before running the installer.

Launch


It is launched by a shortcut on the desktop or from the context menu of the tray icon. Running on my computer takes 25 seconds, and the standard emulator takes 58 seconds. Running, of course, a trifle - occurs a maximum of a couple of times a day. But still a nice little thing.


')

Debugging in Eclipse


If you start Bluestacks first and then Eclipse, then Eclipse will find the emulator itself (this can be checked on the “Devices” tab).



If you restart the emulator and \ or Eclipse - the connection may be lost. You can restore it with a command
adb connect 127.0.0.1 

The adb utility is included in the Android SDK (I have it located in the C: \ Users \% MyUser% \ android-sdk \ platform-tools folder)

Now when you start your Android application, it will be installed and launched not on a standard emulator, but on Bluestacks.

Work speed (subjectively)


After months of working on a standard brake emulator, it will seem like magic to you. Instant response. Opening a new screen (by the handler on the button) occurs even before your finger freezes after the mouse button is released. Any asynchronous requests to the network there, in the course of work on which a progress bar has been spinning for a long time on an ordinary emulator, now raise doubts that the progress bar appears at all. And most importantly - now during the debugging process, you can open the Variables tab in Eclipse with fifty properties of objects and see them all at once, instantly, and not watch the animation of their update from the top to the bottom for 10 seconds. In general, you can finally work.

Work speed (objectively)


Installing and running Hello World

The first deployment test, with the emulator running, from “Run” in Eclipse to “Hello World” on the screen.

Standard emulator - 28 sec
Bluestacks - 7 sec


Cycle

The execution time of this code has been measured:

 long startTime = System.currentTimeMillis(); long a = 0; Random rnd = new Random(); for (int i = 0; i < 10000000; i++){ a += rnd.nextLong(); } long estimatedTime = System.currentTimeMillis() - startTime; Log.d(Long.toString(a), Long.toString(estimatedTime)); 


Standard emulator - 41 sec
Bluestacks - 2.3 sec


Request static page from a web server on the local network


Standard emulator - 4 seconds
Bluestacks - 0.8 sec

FAQ


He paid, or what?
Nope For now, at least.

Where is the fly in the ointment?
During the use of Bluestacks (a couple of weeks), I found three embarrassing points:
  1. It sometimes freezes. Just as when installing - along with Windows. Sometimes - it is somewhere 1 time in 2-3 days when used for 10 hours a day. Since the reboot takes me 1 minute maximum, and the time and nerves of the Bluestacks saves just the car, I found it an acceptable sacrifice.
  2. He puts some of his applications into the emulator and displays them on a special panel “Recommended”. Maybe someone pays him for them (although the site says no). In any case, it's just a little extra traffic and a couple of icons. Nobody forces to start these programs.
  3. When running Bluestacks in the parent OS, the arrow keys sometimes stop working (left, right, up, down). Why is this happening and how to fight, I have not figured it out yet.


Does Linux and Mac work?
Under Mac - yes , under Linux - not yet .

Screen size and orientation change?
Partially. There are several configurations between which you can switch . Choose an arbitrary size is not yet possible.

Please ask questions in the comments. What I can answer - add here.

Related Links


Bluestacks himself
Forum
FAQ on the home site

Source: https://habr.com/ru/post/148512/


All Articles