10

When I open my emulators they are always mostly off screen to the left Like so:

enter image description here

It's frustrating not to be able to have them open somewhere in the centre of the screen like so:

enter image description here

There are these questions:

None of those questions' answers work for me to set the default start position. I've also tried exploring the AVD settings, and this:

open the file emulator-user.ini and set window.x and window.y to 0.

window.x = 0  
window.y = 0

In fact I have tried altering many of the files in the .android/avd/<image name> to see if would make a difference.

I understand how to move the emulator once it has started. I do not want to resize the emulator.

In short, is there a way to change the default start up position of the emulator on the screen?

Community
  • 1
  • 1
  • Are solutions that use some scripting (are you using Windows?) to position the window automatically, when it opens, valid for you? – Eduardo Poço Dec 29 '15 at 04:51
  • have you tried the new emulator in Android Studio 2.0? – headsvk Dec 29 '15 at 10:27
  • @MsYvette it's dramatically faster, at least. Plus it might have some bugfixes, so definitely worth to try – Konstantin Loginov Dec 29 '15 at 13:12
  • Have you tried setting window.x,y to another values different than 0? If yes, does the window of the emulator change a little its position? If the modify date of the emulator's **emulator-user.ini** file is not changing when you close the emulator, i think some misconfiguration is not allowing read/write. For me, it worked. I'll keep trying some scripting. – Eduardo Poço Dec 29 '15 at 14:00
  • 1
    @MsYvette I don't want to steal it from headsvk, as he was the first who suggest it, so I'll wait couple of hours if he shows up. If not - I'll do it :-) – Konstantin Loginov Dec 29 '15 at 14:56
  • I just tried Android Studio 2.0 once when it was released and I experienced bugs so I switched back to 1.5. @KonstantinLoginov You can write the answer if you know more about it. – headsvk Dec 29 '15 at 16:29
  • 1
    @headsvk well. I'm not sure, if it can be counted as "more", I've just posted some manuals i found useful, when I just started & some personal observations throughtout last month. So if it's not, just post one more answer and I'll delete mine – Konstantin Loginov Dec 29 '15 at 17:06

3 Answers3

3

Ok, as we figured out - the workaround is to update to Android Studio 2.0 with its new emulator. @headsvk was the first who suggest it, so kudos to him.

To make this post a bit more comprehensive, here're instructions, how to ramp up with new Android Emulator 2.0:

Known issues (according Google) :

  • Emulating inbound phone call freezes emulator.
  • Screenshot feature crashes emulator in certain conditions
  • If an AVD has been opened in a previous version of the emulator, it may not boot in the new emulator, therefore create a new AVD.
  • OSX - screen doesn't go black when you sleep the device
  • Linux - segfault on exit in some conditions
  • "-gpu mesa" option not supported
  • "-net*" option not supported
  • "-no-window" option not supported
  • Remote desktop not supported
  • Emulated hardware "recents" key doesn't work in older system images
  • Multiple DNS servers not supported

From my personal experience - works fine(apart from degrading after a while, so has to be restarted) on OS X, works with rebooting once in an hour in Windows 10. Every ≈10th time freezing in DEVICE SHELL COMMAND: pm install -r "/data/local/tmp/<package name> state

Though, it still huge step forward for Android Development and it's not that painful, as it sounds to be an early adopter.

Community
  • 1
  • 1
Konstantin Loginov
  • 15,802
  • 5
  • 58
  • 95
2

I had to write some c code:

#include <windows.h>

int main() {
    for (;;) {
        HWND janela = FindWindowA(NULL, "Calculator");
        if (janela) {
            SetWindowPos(janela, HWND_TOP, 400, 200, 0, 0, SWP_NOSIZE);
        }
        Sleep(2000);
    }
}

It will try to move the window to x=400 and y=200 once every 2 seconds, but you can change those values. Also, change "Calculator" to the exact emulator window title, compile it and run. When you are finished, close the console window. Sorry, but my scripted answer used 3rd party tools that I don't know if can be published here without authorization.

Eduardo Poço
  • 2,819
  • 1
  • 19
  • 27
2

I think problem is that you are not comfortable using emulator that comes by default. Use genymotion as an emulator. It is quite easy to use and is very light weight. You can download it from here :

https://www.genymotion.com/#!/download