越狱的iOS从后台应用获取屏幕截图 [英] jailbroken iOS taking screenshot from background app

查看:358
本文介绍了越狱的iOS从后台应用获取屏幕截图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在为自己构建一个实用程序应用程序,该应用程序可以在该实用程序在后台运行的同时,对在前台运行的任何内容进行截图.该实用程序将在越狱设备上运行,因此它可以访问私有API,而不仅限于沙盒.由于该实用程序应用程序在后台运行(作为守护程序或使用后台程序),如何访问正在显示的屏幕以生成屏幕截图?

I'm building an utility app for myself that can take screenshots of whatever is running in the foreground while this utility is running in the background. The utility will be running on a jailbroken device so it can access private APIs and not confined to the sandbox. Since the utility app is running in the background (either as a daemon or using backgrounder), how can I access the screen being displayed to generate a screenshot?

我想要这样做的原因是因为我想以编程方式/远程方式截取屏幕截图.该实用程序将截取屏幕截图并上传到我的本地服务器.我将其用作内部测试工具的一部分.

The reason I want this is because I want to take screenshots programmatically/remotely. The utility will take the screenshot and upload to my local server. I'm using this as part of internal test tools.

非常感谢您的帮助!

推荐答案

您应该可以使用

You should be able to grab a screenshot of the whole screen with UICreateScreenImage(). This will give you a CGImageRef, which you can turn into a UIImage with [UIImage imageWithCGImage:screenshot]. You can then upload this to your server and release the image with CGImageRelease(screenshot).

这篇关于越狱的iOS从后台应用获取屏幕截图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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