ADB Screenshot: Not Found?

My phone runs at root 2.3.6 Gingerbread. I am writing these lines to take a screenshot:

adb shell screencap -p /sdcard/screen.png 

It says that permission is prohibited! So I add su , for example:

 adb shell "su -c 'screencap -p /sdcard/screen.png'" 

Now when I run it, it says "screenshot: not found!"

+1
source share
1 answer

You can accomplish this with MonkeyRunner instead of ADB by creating a screenshot.py file with the following contents:

 from com.android.monkeyrunner import MonkeyRunner, MonkeyDevice device = MonkeyRunner.waitForConnection() result = device.takeSnapshot() result.writeToFile('<some path>/screenshot.png','png') 

and run it using the command (on Windows)

<android sdk path>\tools\monkeyrunner.bat <some path>\screenshot.py

+2
source

Source: https://habr.com/ru/post/1262501/


All Articles