Using Private APIs yes. UIGetScreenImage() also works when the app is running in the background. I set up an app to take a screenshot whenever an exception is thrown, and it also takes screenshots of the home screen/ other apps when it crashes while running in the background.
Using Private APIs yes.
UIGetScreenImage()
also works when the app is running in the background. I set up an app to take a screenshot whenever an exception is thrown, and it also takes screenshots of the home screen/ other apps when it crashes while running in the background.This question has some interesting answers regarding the DisplayRecorder app from the AppStore: How does the iOS app Display Recorder record the screen without using private API?
And this shows you how to use UIGetScreenImage: https://stackoverflow.com/a/2507740/832065
Update:
_UICreateScreenUIImage()
is a much faster method of getting a screenshot. It also returns a UIImage instead of CGImageRef: