user3517970
user3517970

Reputation: 63

ADB Screenshot: not found?

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!"

Upvotes: 1

Views: 2875

Answers (1)

Carlo B.
Carlo B.

Reputation: 1243

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

Upvotes: 2

Related Questions