Android emulator on hidpi displayer?

Viewed 2367

I am running android emulator 26.1.3 on my laptop with KDE Neon installed. KDE Neon is distribution based on Ubuntu 16.04 with latest KDE. The screen resolution of my laptop is 14" 3840X2160. Physical DPI == 315. In KDE 'system settings'- > 'fonts' --> 'force font DPI' set to 196.

I launched a Nexus_5X_API_26 emulator instance in ADV manager. The device profile:

hw.lcd.width = 1080
hw.lcd.height = 1920
hw.lcd.depth = 16
hw.lcd.density = 420

The emulator display like this. How to correct this?

enter image description here

2 Answers

For anybody running from modern Android Studio (or IDEA Ultimate), you should go to the location of your android sdk e.g. /home/<user>/Android/Sdk/emulator/ and run the following from within that directory:

# Enter your calculated scale factor e.g. 0.45 here, if your KDE scale factor is e.g. 2.2, 1/2.2 =~ 0.45
read scale_factor
mv emulator emulator.base
echo -E "#!/bin/env bash\nQT_SCALE_FACTOR=${scale_factor} $(pwd)/emulator.base $*" > $(pwd)/emulator
chmod +x $(pwd)/emulator

Credits to Lilian for their original answer

Related