40

First thing first,

Using Android Studio 2.3.3

Problem:

My emulator screen is covering the only partial amount of screen available for emulator, i.e top left of the emulator and rest part is just a black screen.

See the pic I have attached.

enter image description here

Things I tried:

1) Restarting emulator

2) trying different emulator

3) changing pixels, density of emulator device,

4) run -> edit configuration ..blah blah blah...

Nothing helped!!

Note:

My issue is not emulator's size but effective screen size.

please help if somebody could have come across this issue :(

IMPORTANT EDIT: I guess, this issue has something to do with the laptop I am using, DELL Latitude, touch screen (14-inch QHD touch display (2,560×1,440 resolution). Because the same emulator works properly in other display laptops.

Harsh
  • 243
  • 3
  • 20
eRaisedToX
  • 3,221
  • 2
  • 22
  • 28
  • check this https://stackoverflow.com/questions/29737499/how-to-resize-the-avd-emulator-in-android-studio – Salman500 Aug 01 '17 at 10:29
  • I saw that...didn't help , I don't see any emulator tab in run->edit configuration – eRaisedToX Aug 01 '17 at 10:30
  • rotate screen from given rotation function in menu bar . – Kevan Aghera Aug 03 '17 at 11:21
  • @kevanaghera , "rotate" ???? No man !! that has nothing to do with it. I had tried all basic stuff. – eRaisedToX Aug 03 '17 at 13:33
  • It happen a few times to me and closing and re-opening the emulator fixed the problem. It usually happend when I closed my laptop lid without putting it to sleep first. I know that restarting it didn't fixed your problem, but maybe you can find a similar pattern. – Iulian Popescu Aug 11 '17 at 11:09

12 Answers12

28

*Software rendering is very slow to be usable


Better Fix

You can fix the scaling issue when using the Hardware rendering by simply making windows override the scaling setting. How?, it's very easy. Simply locate the .exe file for the emulator that you are using, (e.g. "qemu-system-armel.exe" for ARM and "qemu-system-x86_64.exe" for x86). To make sure which .exe file, just run the emulator then use task manager to locate the .exe file is running, see the screenshot. locate the .exe file using task manager

In my case it was in this location: "C:\Users[Username]\AppData\Local\Android\Sdk\emulator\qemu\windows-x86_64\qemu-system-x86_64.exe"

Now just right click on the file then click on properties then choose the "Compatibility" tab. Under "Settings" at the bottom, click on "Change high DPI settings". A new window will open. Tick the last checkbox "Override high DPI scaling behavior." under "High DPI scaling override". Then select from the drop down below it "System" (this is very important or it will not make any difference!), see the screenshot below. Now just hit OK and OK. And that's it, problem solved :)

override scaling settings for the .exe file

Pavel Chuchuva
  • 22,633
  • 10
  • 99
  • 115
Wael
  • 381
  • 1
  • 3
  • 4
13

I was having the same problem too. I think it started happening when I updated to Android Studio 3.0 Beta 1, but I'm not 100% sure of that.

FIX: Anyway, to fix this, you can use Software Graphics in the emulator options, rather than Hardware. Slower, but at least it works.

eRaisedToX
  • 3,221
  • 2
  • 22
  • 28
Knuckles the Echidna
  • 1,716
  • 3
  • 17
  • 22
  • hi, yeah it worked that way ,so +1, but it is too slow.... any other work around? I mean it is that slow that one can't use it , so the core problem remains the same that I am forced to use real device. (earlier , because it was too small and now because it is too slow). I am using studio 2.3.3 , should I change that? – eRaisedToX Aug 11 '17 at 05:12
  • Unfortunately I haven't found any other way to fix this. I also have a Dell laptop btw, just not the same model (I have a Mobile Precision 5520). I guess we'll have to wait till they fix this, because I'm positive this started happening recently. I don't think this is a matter of Android Studio, since we're using different version, so maybe it's another update to a different component that they introduced which you and I happened to download. – Knuckles the Echidna Aug 11 '17 at 20:16
  • Your's is the closest answer , so I accept it, but since the bounty has expired and given to some other answer by community , I cant give you that. thanks! – eRaisedToX Aug 13 '17 at 04:16
  • 2
    No, no this can't be a solution, it's incredibly slow!! – Gamal Mohamed Apr 21 '18 at 12:50
9

I have this similar issue. It happened after using an external monitor that has lower resolution (1440 x 900) than my laptop (2160 x 1440) has. There are couple of ways you can fix it until Google fix the issue.

  • if you match your PC's resolution to your external monitor's resolution. Then you can return back to your PC's resolution.
  • If you lower the scaling of your PC ( mine was 150% > 125% or 100%) from Display Settings. Run the emulator. Again, you can return back to your original scaling, emulator screen won't change. This is the one I prefer.

Note: this is not a permanent solution. You may need to change scaling/resolution again if you change your scaling or resolution to the one you had issue with. I have tested this only on Windows 10 Pro, but this approach might work on Mac as well.

Before scaling After scaling

Benazir
  • 240
  • 4
  • 6
8

I am running Archlinux and I had exactly the same problem because I have $QT_SCALE_FACTOR set to 2 by default. Setting it back to 1 for the emulator fixed the problem:

env QT_SCALE_FACTOR=1 Android/Sdk/emulator/emulator -avd api25 
dvim
  • 2,223
  • 1
  • 17
  • 17
  • Changing this settings works, but for me correct value was 0.667. So better way would be playing with it to check which value is good for your environment. – Konstantin Labun Jul 09 '18 at 06:03
  • 2
    For people using Android Studio find your installation folder and add `export QT_SCALE_FACTOR=1` to your `studio.sh` somewhere in the beginning. Note that in KDE that factor must be `1 / `. E.g `0.5` when you scaled your display by 2. – Machisuji Sep 17 '18 at 22:01
  • I wonder if there's a way to set a similar ENV variable in Windows – Ivan Semkin Jan 27 '19 at 04:53
5

Open the Emulator and press Ctrl+Up_Key to increase the scale and Ctrl+Down_Key to scale down. (Cmd+KUp / Cmd+KDown if you are on mac)

aaron0207
  • 2,293
  • 1
  • 17
  • 24
  • I dont know what do you mean by "Right Click the Project Folder"... What I have tried is --- Run ->Edit Configuration->target select as emulator,,, but then there is NO option for scale and all.. can you post some screen shots – eRaisedToX Aug 03 '17 at 13:52
  • yeah bro..I tried...all those..that increases the size of device plus the screen but ratio remains same (screen covering only 30% of device)No clue what's wrong...! – eRaisedToX Aug 04 '17 at 07:53
  • Worked for me for Nexus 4 simulator, on 15.6 inch mac. – Martin Berger Jan 22 '19 at 13:22
3

Try this and hopefully it works for you -

  1. Go to Tools in Android Studio and open AVD Manager

  2. It will open all your virtual devices. Click on the Virtual device you want to edit and click the Pencil icon which will enable you to edit the device.

  3. Click on Change where it lists the device name. For example, for me my device name is Nexus 5X and lists the resolution of the device.

  4. In the Select a Device screen, click on New Hardware Profile and change the resolution to 1080 x 1920 px.

  5. Save the changes and run it again. If it still doesn't work, change the skin of the device.
  6. If still doesn't work, then make a new hardware profile with a new device.
Ankit Sharma
  • 663
  • 1
  • 5
  • 17
  • If you look at the question, I had asked it 2 days back and since then I have tried all these basic stuff which everyone knows ..! So , Unluckily , I have tried all those so called "still" from your answer . and you know what it "still" does not work.. Believe me, bounty awarded to the question (by me) is worth it. – eRaisedToX Aug 03 '17 at 17:14
1

Have you already tried other emulator? I suggest Try bluestacks

 go the tab Emulator (next to the General tab), and in Additional command line options, write

-scale 100.X

Press alt + space + M

Pls. see landscape also and revert back to portrait

user8256287
  • 177
  • 15
  • 1
    Which Emulator Tab you are talking about , If I go to Run -> Edit Configuration I see some tabs , but no emulator tab .. pls post screen shot if you can. – eRaisedToX Aug 10 '17 at 08:48
1

This looks like an incompatibility with windows scaling. Try setting scale to 100% in display settings of Windows (right click on desktop).

Rish K
  • 664
  • 7
  • 14
1

In case someone ran into this issue on Linux, here is a fix:

QT_AUTO_SCREEN_SCALE_FACTOR=0 emulator -avd <Name of your virtual device>
qed
  • 22,298
  • 21
  • 125
  • 196
0

I ran into this issue a while ago and have been struggling for it until now. Solution seems to be:

Go to C:\Users\YourUser\AppData\Local\Android\Sdk\emulator

Here, right click on emulator.exe, click Properties and go to Compatibility. Here, check: "Override high DPI scaling behavior. Scaling performed by: APPLICATION".

This should fix the issue on any Windows 10 machine with display scaling activated.

akseli
  • 1,416
  • 14
  • 22
0

Just go to display setting and change it to 100%.this normally happens if you have a fourteen inch laptop and below

tarus
  • 11
  • 1
  • 2
0

Best and simplest way to do it on Windows 10:

  1. Close your Android Emulator if it is open
  2. Right-click desktop
  3. Click Display Settings
  4. Set Scale and layout to 100%
  5. Open Android Emulator
  6. Revert your Scale and layout to the (Recommended) percentage
dkea
  • 690
  • 1
  • 9
  • 24