以编程方式从连接的Mac计算机获取iOS设备屏幕截图 [英] Programatically get iOS device screenshot from the connected Mac computer

查看:113
本文介绍了以编程方式从连接的Mac计算机获取iOS设备屏幕截图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道可以从iOS应用程序中的代码以编程方式获取屏幕截图,并手动从Xcode和Instruments获取屏幕截图(Instruments也会在UIAutomation测试失败期间自动截取屏幕截图)。我想要找到的是一种编程方式(在Mac上运行代码,而不是设备)从设备上截取插入到Mac上的屏幕截图。

I know it's possible to get a screenshot programatically from code in the iOS application, and to manually get screenshots from Xcode and Instruments (Instruments also automatically takes screenshots during UIAutomation test failures). What I would like to find is a programatic way (with code running on the Mac, not the device) to grab screenshots from the device onto the Mac which it is plugged into.

Xcode或Instruments中是否有API(或命令行参数)才能访问此屏幕截图功能?或者(理想情况下)与设备接口并直接获取屏幕截图,就像Xcode和Instruments一样吗?

Is there an API (or command-line parameters) into Xcode or Instruments to get access to this screenshot feature? Or (ideally) to interface to the device and get a screenshot directly, the same way that Xcode and Instruments do it?

推荐答案

是的,有办法。您想要安装免费的libimobiledevice库: https://github.com/benvium/libimobiledevice-macosx

Yes, there is a way. You want to install the free libimobiledevice library: https://github.com/benvium/libimobiledevice-macosx

安装后,您可以从命令行运行 idevicescreenshot ,它将保存一个TIFF文件截图到当前目录。

When it is installed, you can run idevicescreenshot from the commandline and it will save a TIFF file with a screenshot to the current directory.

参见 http://pervasivecode.blogspot.de/2012/06/take-iphone-or-ipad-screenshot-from.html

这篇关于以编程方式从连接的Mac计算机获取iOS设备屏幕截图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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