dtmilano / AndroidViewClient

Android ViewServer and ADB client
Apache License 2.0
1.63k stars 347 forks source link

Cannot get a correct screenshot when an app only works under landscape mode #229

Closed gchen36 closed 7 years ago

dtmilano commented 7 years ago

Do you have an example you could share?

gchen36 commented 7 years ago
screen shot 2017-11-15 at 1 21 38 pm
gchen36 commented 7 years ago

The issue is related to writeImageToFile(). I wanted to get the ad image which locates at ((0, 949), (1794, 1080)); however, I got the enclosed image file. www studiolassa nl backyardbrawl-10

dtmilano commented 7 years ago

Have you tried a real device? I think the problem might be that the emulator is in portrait mode while the application is in landscape. On a real device, this might not happen.

gchen36 commented 7 years ago

I just tested by commenting out image.crop(box).save(filename, _format) in viewclient.py, the issue comes from uiautomator.takeScreenshot() on genymotion. The landscrape screenshot (1920x1080) has been compressed into 1080x1920. www studiolassa nl backyardbrawl-10