Hey there, I want to simulate the press of iPhone home button and power/standby button. Could anyone tell me how to do this?
Asked
Active
Viewed 1,695 times
3 Answers
1
There is no public API supporting this.

Björn Marschollek
- 9,899
- 9
- 40
- 66
-
Thanks for letting me know this. Perhaps could you tell me which private APIs support this? – Nihao Oct 18 '10 at 13:01
-
[[UIApplication sharedApplication] terminate]; – Björn Marschollek Oct 18 '10 at 16:52
1
Your app should never quit unless the user has pressed the home button. Apple will most likely reject your app if you do.
To answer your question, to "simulate" the app closing/crashing you can use exit
exit( 0 );

aegzorz
- 2,209
- 15
- 18
0
Probably you want to take a screenshot of the screen from your app?
Check this Capture iPhone screen with status bar included?
There is no public api available for taking a screenshot.
-
hello, thanks for your reply. I tried that method given by the reference link. However, it gave me a totally black image. I guess it might be caused by my overlayview. Do you know how to render both the main window and its overlay in the video preview mode? Thank you :D – Nihao Oct 18 '10 at 13:00