Page 1 of 1

Android Screenshot by POWER&VolDwon buttons

Posted: Tue Nov 29, 2016 2:40 pm
by Speedboat
Hi

The integrated screenshot function of Ranorex on Android devices can not be used for google map views
(the recorded screen content is black).

Is there a way to trigger "POWER & VolumeDown" or any other method to use the built in Android screenshot function?

Thanks a lot!

Android 6.0.1 / Google Nexus 4
Ranorex 6.1.1

Re: Android Screenshot by POWER&VolDwon buttons

Posted: Tue Nov 29, 2016 5:28 pm
by asdf
Hi Speedboat,

Have you already tried it through ADB?
Just copy the code below to a batch file and execute it.
Please be aware that this will only work with an USB connection.

Code: Select all

@echo off
cd C:\Program Files (x86)\Ranorex 6.1\Bin\RxEnv\Android\tools
adb shell screencap -p /sdcard/screen.png
adb pull /sdcard/screen.png C:\Temp\screen1.png
cd C:\Temp\
screen1.png
A screenshot will be fetched and will get pulled to your machine and saved in the C:\Temp\.
Afterwards, it just open the image.

You might have to adapt the path to the adb.exe, if you are not using Ranorex 6.1.

Hope this helps.

Best regards,
asdf

Re: Android Screenshot by POWER&VolDown buttons

Posted: Wed Nov 30, 2016 9:54 am
by Speedboat
Hi asdf

Thanks, works perfect 8)
(Didn't think about that)

With the command:
adb connect <device tcp>:5555
it works even fine the visual studio emulator and will also work
over Wifi hopefully.

Thanks,
Speedboat