[GH-ISSUE #56] Wrong resolution and dpi for Samsung emulator #43

Closed
opened 2026-03-01 15:39:37 +03:00 by kerem · 4 comments
Owner

Originally created by @QAutomatron on GitHub (Dec 28, 2017).
Original GitHub issue: https://github.com/budtmo/docker-android/issues/56

Steps:

Use butomo1989/docker-android-x86-7.0 image
Start container: docker run --privileged -d -p 6096:6080 -e DEVICE="Samsung Galaxy S6" --name android-container2 butomo1989/docker-android-x86-7.0
Go to VNC, open terminal inside container and check screen info using command: adb shell dumpsys display | grep mBaseDisplayInfo

Output: 474 x 839 and density 240

Expected: If use Nexus 5 device emulator, output would be: 1080x1920 and density 480 which is looks correct.

Originally created by @QAutomatron on GitHub (Dec 28, 2017). Original GitHub issue: https://github.com/budtmo/docker-android/issues/56 **Steps:** Use `butomo1989/docker-android-x86-7.0` image Start container: `docker run --privileged -d -p 6096:6080 -e DEVICE="Samsung Galaxy S6" --name android-container2 butomo1989/docker-android-x86-7.0` Go to VNC, open terminal inside container and check screen info using command: `adb shell dumpsys display | grep mBaseDisplayInfo` **Output:** `474 x 839 and density 240` **Expected:** If use `Nexus 5` device emulator, output would be: `1080x1920 and density 480` which is looks correct.
kerem 2026-03-01 15:39:37 +03:00
Author
Owner

@budtmo commented on GitHub (Jan 3, 2018):

Hi @QAutomatron ,

Thank you for opening the issue. Could you maybe help to fix it? It would be great.

<!-- gh-comment-id:355052181 --> @budtmo commented on GitHub (Jan 3, 2018): Hi @QAutomatron , Thank you for opening the issue. Could you maybe help to fix it? It would be great.
Author
Owner

@JoeSSS commented on GitHub (Jul 9, 2018):

I tried to fix this issue and gave up in the end.. the whole skin/profile relationship is more than weird. To get correct screen resolution I use Nexus 5X

<!-- gh-comment-id:403607799 --> @JoeSSS commented on GitHub (Jul 9, 2018): I tried to fix this issue and gave up in the end.. the whole skin/profile relationship is more than weird. To get correct screen resolution I use Nexus 5X
Author
Owner

@DieterRogiest commented on GitHub (Oct 30, 2018):

Thanks QAutomatron, so that's the cause why my website showed up rendered badly in Samsung Galaxy S6 in docker-android.
I could fix it by bashing into the docker: docker exec -it android-container bash
cd android_emulator
apt update; apt install vim
vim config.ini
vim hardware-qemu.ini
in these two files you can see the bad settings (474 x 839 and density 240)
vim ../devices/profiles/samsung_galaxy_s6.xml : here you can find the correct settings: 1440 x 2560 and dpi 575.92
(qemu: available lcd densities are: 120, 160, 213, 240, 280, 320, 360, 400, 420, 480, 560, 640)
vim config.ini : change it to hw.lcd.density=575.92 (do NOT fill in 560 or 640!)
vim hardware-qemu.ini : change it to
hw.lcd.width = 1440
hw.lcd.height = 2560
hw.lcd.depth = 16
hw.lcd.density = 575.92
cd
ps auxfw
kill -9 <pid of running command /root/emulator/qemu/linux-x86_64/qemu-system-x86_64 @samsung_galaxy_s6_8.1 -gpu off -verbose>
/bin/bash ./src/appium.sh
go to the vnc url http://localhost:6080/ : SGS6 shows up in correct resolution.
But when you kill the pid of the qemu again, then hardware-qemu.ini gets reset again to the wrong settings.

<!-- gh-comment-id:434510305 --> @DieterRogiest commented on GitHub (Oct 30, 2018): Thanks QAutomatron, so that's the cause why my website showed up rendered badly in Samsung Galaxy S6 in docker-android. I could fix it by bashing into the docker: docker exec -it android-container bash cd android_emulator apt update; apt install vim vim config.ini vim hardware-qemu.ini in these two files you can see the bad settings (474 x 839 and density 240) vim ../devices/profiles/samsung_galaxy_s6.xml : here you can find the correct settings: 1440 x 2560 and dpi 575.92 (qemu: available lcd densities are: 120, 160, 213, 240, 280, 320, 360, 400, 420, 480, 560, 640) vim config.ini : change it to hw.lcd.density=575.92 (do NOT fill in 560 or 640!) vim hardware-qemu.ini : change it to hw.lcd.width = 1440 hw.lcd.height = 2560 hw.lcd.depth = 16 hw.lcd.density = 575.92 cd ps auxfw kill -9 <pid of running command /root/emulator/qemu/linux-x86_64/qemu-system-x86_64 @samsung_galaxy_s6_8.1 -gpu off -verbose> /bin/bash ./src/appium.sh go to the vnc url http://localhost:6080/ : SGS6 shows up in correct resolution. But when you kill the pid of the qemu again, then hardware-qemu.ini gets reset again to the wrong settings.
Author
Owner

@DieterRogiest commented on GitHub (Nov 2, 2018):

@butomo1989,
can you also please update the Quick Start of the readme of https://github.com/butomo1989/docker-android: instead of
-e DEVICE="Samsung Galaxy S6"
it would be better to have
-e DEVICE="Nexus 5".

UPDATE: no, don't. The Nexus 5 seems even more unstable than SGS6 (on 8.1 and up). On 8.1 I was able to use the chrome browser of the nexus 5 after killing the qemu command, start it again with /bin/bash ./src/appium.sh, it rebooted again a few times , I disabled Location it rebooted again and then I could use the chrome browser. No idea what's the pattern for having it work without rebooting.

<!-- gh-comment-id:435317748 --> @DieterRogiest commented on GitHub (Nov 2, 2018): @butomo1989, can you also please update the Quick Start of the readme of https://github.com/butomo1989/docker-android: instead of -e DEVICE="Samsung Galaxy S6" it would be better to have -e DEVICE="Nexus 5". UPDATE: no, don't. The Nexus 5 seems even more unstable than SGS6 (on 8.1 and up). On 8.1 I was able to use the chrome browser of the nexus 5 after killing the qemu command, start it again with /bin/bash ./src/appium.sh, it rebooted again a few times , I disabled Location it rebooted again and then I could use the chrome browser. No idea what's the pattern for having it work without rebooting.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/docker-android#43
No description provided.