简体   繁体   English

安卓手机截图

[英]Android rooted phone screenshots

I'd like to take screenshots on my android phone. 我想在我的Android手机上截图。 I'm an app developer and have a pretty good understanding of the regular API, and I know this steps out of the "regular" thing quite a bit. 我是一名应用程序开发人员,并且对常规API有了很好的了解,并且我知道这样做可以使“常规”事情大为摆脱。

I would have root access. 我将具有root访问权限。

I've seen a few apps that do this. 我看过一些应用程序可以做到这一点。 I'm just wondering how one goes about doing it. 我只是想知道如何去做。 Anybody know the general direction I should be looking in? 有人知道我应该寻找的总体方向吗?

Have a look at framebuffer.c in the adb (phone side) sources, which appears to be what the DDMS screenshot capability uses. 看一下adb(电话端)源中的framebuffer.c,这似乎是DDMS屏幕截图功能使用的。 You need to be uid root or gid graphics due to the permissions on the framebuffer device - presumably the adbd is the later. 由于有帧缓冲设备的权限,您需要是uid root或gid图形-大概是adbd是后者。

It is in /platform/system/core : 它在/platform/system/core

Direct link to the file: https://android.googlesource.com/platform/system/core/+/gingerbread-release/adb/framebuffer_service.c 指向文件的直接链接: https : //android.googlesource.com/platform/system/core/+/gingerbread-release/adb/framebuffer_service.c

The simplest is get look in to the /system/bin/screencap . 最简单的方法是查看/system/bin/screencap
Since you have root access you can easily get rid of it without the overhead of reading and writing buffer. 由于您具有root用户访问权限,因此可以轻松摆脱它,而不会产生读写缓冲区的开销。

drocap2 is usually what I have seen used (free app found in market). drocap2通常是我所见过的(市场上有免费的应用程序)。 Alternatively, if you would like to take a screenshot from your PC, I know Motodev Studio has a plugin for this in their IDE (not sure if it is available for other eclipse based IDEs). 另外,如果您想从PC上截取屏幕截图,我知道Motodev Studio在其IDE中为此提供了一个插件(不确定其他基于Eclipse的IDE是否可用)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM