Do It With OS X
The first method is good old screen capture that is built into OS X. This is, of course, not exclusive to iPhone apps. You can hold down Command-Shift-3 to save a screenshot to your desktop in PNG format. This is useful for if you want to take a screenshot while you are running your app in the emulator.
Even more useful, in my opinion, is the Command-Shift-4 function. This turns your cursor into cross-hairs and lets you select a region of the screen to save as your screenshot, again as a PNG. This is great if you just wanted to grab a portion of your app.
You can also add Ctrl to both of the above keyboard shortcuts to save the screenshot to your clipboard instead of to disk. Then you can go paste the screenshot into Photoshop or some other image editor.
Do It With Grab
Grab is an application that comes with OS X which you can find in your Applications/Utilities folder. It features the unique ability to take a screenshot of a window:
This means if you run your app in the iPhone Simulator and then use Grab, you can take screenshots of your app looking all hot in the actual device with just a couple of clicks. This is a great way to get shots of your app in the iPhone if you don’t own one or aren’t a paid developer. Here’s the result:
Screenshots that come out of Grab are in TIFF format.
Do It With Xcode
Xcode’s Organizer tool provides a simple interface for taking screenshots of whatever is currently displaying on an iPhone that is connected to your computer. Open it by going to Xcode’s Window menu and selecting Organizer or just hit Ctrl-Command-O.
Once it is opened, select your iPhone from the Devices section on the left. Then go to the Screenshot tab in the main section. Now use your application on the iPhone until it is in a state where you want to take a screenshot. Finally, press the capture button in Organizer and boom: you’re done.
Xcode saves screenshots as PNG files in the following folder on your machine:
Do It With the iPhone
Did you know you can take a screenshot of anything that the iPhone is doing at any time? It’s true. Just press and hold the home button. While you’re holding it, press and release the Sleep/Wake button. The iPhone’s screen will flash and the camera shutter sound will play. The screenshot will have been saved to your camera roll, which you can access in the Camera app or the Photos app.
Do It With Code
Finally, you can capture screenshots at precise moments in your application by using the following pair of objective-c methods. The first one, captureView, returns a UIImage that contains a render of any UIView (except EAGLView, see below). If you pass your app’s UIWindow into this method, it will return you a screenshot of the app.
The second method, saveScreenshotToPhotosAlbum, takes it a step further and saves an image that contains a render of any UIView to your iPhone’s photo album.
Since the above 2 methods don’t work for EAGLView, we need another solution. Below are a pair of methods that do the equivalent of the above 2 for apps using EAGLView, courtesy iPhone Dev SDK Forum.