问题描述
我知道可以从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库:
这篇关于以编程方式从连接的Mac计算机获取iOS设备屏幕截图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!