使用ADB捕获屏幕 [英] Using ADB to capture the screen
问题描述
我正在尝试尽快获取手机屏幕的屏幕截图。
目前,我正在做:
I'm trying to get a screenshot of the phone screen as fast as possible. Currently, I am doing:
adb shell screencap -p /sdcard/screencap.png && adb pull /sdcard/screencap.png
然而它太慢了,需要3秒钟。
有没有更好的方法呢?我打算在无根电话下使用此功能。
However it is too slow and takes up to 3 seconds. Is there any better way to do this? I intend to use this function with an unrooted phone.
我还可以使用哪些不同的参数进行screencap?
Also what are the different arguments I can use for screencap?
谢谢。
编辑(额外信息):我打算使用此方法将屏幕的实时馈送到我的电脑上。目前的方法有效但速度太慢。我无法使用 adb shell screenrecord
因为我在录制时无法访问该视频文件。
EDIT (extra information): I intend to use this method to be able to get a live feed of the screen onto my pc. The current method works however it is too slow. I can't use adb shell screenrecord
because I won't be able to access the video file while it is being recorded.
推荐答案
使其工作@ OSX和Linux
To make it work @ OSX and Linux
adb exec-out screencap -p > screen.png
这篇关于使用ADB捕获屏幕的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!