2

Hey there, I want to simulate the press of iPhone home button and power/standby button. Could anyone tell me how to do this?

Brad Larson
  • 170,088
  • 45
  • 397
  • 571
Nihao
  • 199
  • 1
  • 2
  • 11

3 Answers3

1

There is no public API supporting this.

Björn Marschollek
  • 9,899
  • 9
  • 40
  • 66
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.

Community
  • 1
  • 1
Chaitanya
  • 2,396
  • 4
  • 29
  • 45
  • 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