ADB Screenshot: not found?

2019-08-15 00:37发布

My phone runs rooted 2.3.6 Gingerbread. I write these lines to take a screenshot:

adb shell screencap -p /sdcard/screen.png

It says permission denied! So I add su, like this:

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

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

标签: android adb
1条回答
放我归山
2楼-- · 2019-08-15 00:52

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

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

and run it with the command (on Windows)

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

查看更多
登录 后发表回答