的Nexus One的亚行截图? [英] Screenshot of the Nexus One from adb?

查看:133
本文介绍了的Nexus One的亚行截图?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的目标是能够从连接通过USB接口一个根深蒂固的Nexus One键入一个单词的命令,并得到一个截图。

My goal is to be able to type a one word command and get a screenshot from a rooted Nexus One attached by USB.

到目前为止,我可以得到我相信这是一个 32位xRGB888 原始图像向外拉,像这样的帧缓冲:

So far, I can get the framebuffer which I believe is a 32bit xRGB888 raw image by pulling it like this:

adb pull /dev/graphics/fb0 fb0

在那里,虽然,我有一个很难得到它转换为PNG。我试图用的ffmpeg是这样的:

From there though, I'm having a hard time getting it converted to a png. I'm trying with ffmpeg like this:

ffmpeg -vframes 1 -vcodec rawvideo -f rawvideo -pix_fmt rgb8888 -s 480x800 -i fb0 -f image2 -vcodec png image.png

这是创建具有零件隐约类似于屏幕上可爱的紫色的形象,但它绝不是一个干净的屏幕截图。

That creates a lovely purple image that has parts that vaguely resemble the screen, but it's by no means a clean screenshot.

推荐答案

有关ICS一个大大简单的解决方案是使用命令行下面的

A vastly easier solution for ICS is to use the following from the command line

adb shell /system/bin/screencap -p /sdcard/screenshot.png
adb pull /sdcard/screenshot.png screenshot.png

这会保存screenshot.png文件在当前目录。

This'll save the screenshot.png file in the current directory.

测试上三星Galaxy SII和放大器; SII运行4.0.3。

Tested on a Samsung Galaxy SII & SII running 4.0.3.

这篇关于的Nexus One的亚行截图?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆