Interacting with iOS Simulator
Interacting with iOS Simulator differs from interacting with an actual device. In this chapter you learn how to:
Simulate hardware actions such as rotate and shake
Simulate Multi-Touch gestures using a mouse and keyboard
Uninstall an app you previously installed in a simulation environment
Copy and paste text and images between the simulator and your Mac
Simulating Hardware Interactions
With iOS Simulator, you can simulate most of the actions a user performs on a device. Table 2-1 lists hardware manipulations you can perform in iOS Simulator by using the Hardware menu.
Menu option | Hardware action |
|---|---|
Rotate Left | Rotates the simulator to the left. |
Rotate Right | Rotates the simulator to the right. |
Shake Gesture | Simulates shaking the device. |
Home | Displays the Home screen of the simulated device. |
Lock | Displays the Lock screen. |
Simulate Memory Warning | Sends the frontmost app a simulated low-memory warning. For information on how to handle low-memory situations, see “Observing Low-Memory Warnings” in iOS App Programming Guide. |
Toggle In-Call Status Bar | Toggles the status bar between its normal state and its in-call state. This command shows how your app’s user interface looks when a user launches your app during a call or while navigation is running. The in-call state bar is used when a phone call is in progress, a FaceTime call is in progress, or Maps in iOS 6 is navigating. The status bar is taller in its in-call state than in its normal state. |
Simulate Hardware Keyboard | Toggles the software keyboard on an iPad simulator. Turn off the software keyboard to simulate using a keyboard dock or wireless keyboard with an iPad device. Note: The Mac’s keyboard can be used as input into the simulator at all times. |
TV Out | Opens a window simulating a device’s TV Out signal. Note: Several TV Out resolutions are available by choosing Hardware > TV Out > desired resolution. |
Simulating User Gestures
With iOS Simulator, you can perform traditional Multi-Touch gestures using the mouse and keyboard. Table 2-2 lists gestures you can perform in iOS Simulator. See iOS Human Interface Guidelines for more about gestures.
Gesture | Desktop action |
|---|---|
Tap | Click. |
Touch and hold | Press and hold down the mouse button or trackpad. |
Double-tap | Double-click. |
Drag | Drag. |
Swipe | Drag. |
Flick | Drag quickly. |
Two-finger Drag | 1. Place the pointer where you want the two-finger drag to occur. 2. Hold down the Option key. 3. Move the circles that represent finger touches to the start position. 4. Move the center of the pinch target by holding down the Shift key, moving the circles to the desired center position, and releasing the Shift key. 5. Hold down the Shift key and the mouse button, move the circles in the direction you want to drag, and release both the Shift key and the mouse button. |
Pinch | 1. Place the pointer where you want the pinch to occur. 2. Hold down the Option key. 3. Move the circles that represent finger touches to the start position. 4. Move the center of the pinch target by holding down the Shift key, moving the circles to the desired center position, and releasing the Shift key. 5. Hold down the mouse button, move the circles in and out to the end position, and release the Option key. |
Rotate | 1. Place the pointer where you want the rotation to occur. 2. Hold down the Option key. 3. Move the circles that represent finger touches to the start position. 4. Move the center of the pinch target by holding down the Shift key, moving the circles to the desired center position, and releasing the Shift key. 5. Hold down the mouse button, rotate the circles to the end position, and release the Option key. |
Installing and Uninstalling Apps
When you build your app for iOS Simulator, Xcode automatically installs it in the selected simulation environment. In the same way that the Maps app disappears when you switch from the 6.0 simulation environment to the 5.1 simulation environment, your own apps exist only within the specific simulation environments where you installed them.
Select the simulation environment from which to remove the app by choosing Hardware > Version > iOS version.
Place the pointer on the icon of the app you want to uninstall, and then press and hold down the mouse button or trackpad until the icons start to jiggle and a close button appears.
Click the close button on the app you want to uninstall from the simulation environment.
Click the Home button, or if the Home button is not visible, choose Hardware > Home to stop the icons from jiggling.
Copying and Pasting in iOS Simulator
iOS Simulator provides a variety of copy and paste operations, both within the simulator and between the simulator and your Mac. The actual copy and paste operations in iOS Simulator are performed in the same way they are on an iOS device, but if you are trying to copy and paste between the simulator and your Mac, additional steps must be taken. Copy and paste operations can be used on strings and images.
If you are copying an image from a webpage in iOS Simulator, you need to save it to the Photos app first.
Press and hold down the mouse button or trackpad on the image you want to save.
When the menu appears, click Save Image to save the image to the Photos app in iOS Simulator.

The image is saved to the Saved Photos album in the Photos app.
Open the photo you want to copy in the Photos app.
Press and hold down the mouse button or trackpad on the image you want to copy.

Click Copy.
If you intend to paste the image on your Mac outside of iOS Simulator, choose Edit > Copy.
This copies the image to the Mac’s pasteboard. To paste the image in another app on the Mac, use that app’s paste command.
Click the insertion point to display the selection buttons.

Click the Select button to select the adjacent word, or click Select All to select all text.
Drag the grab points to select more or less text.
Click Copy.

If you are pasting the text on your Mac outside of iOS Simulator, choose Edit > Copy.
This copies the text to the Mac’s pasteboard. To paste the text in another app on the Mac, use that app’s paste command.
If the image you are pasting was copied from your Mac, choose Edit > Paste.
This action copies the image from the Mac’s pasteboard to the simulator’s pasteboard.
Navigate to the location where you want to paste the image you just copied.
Press and hold down the mouse button or trackpad in the location where you want to paste your copied image, and then click Paste.

If the text you are pasting was copied from your Mac, choose Edit > Paste.
This action copies the text from the Mac’s pasteboard to the simulator’s pasteboard.
Navigate to the location where you want to paste the text you just copied.
Double-click in the location where you want to paste the text, and then click Paste.

Taking a Screenshot of the Simulator
In iOS Simulator you can copy a screenshot of the simulator to your Mac’s pasteboard, or you can save a copy of the screenshot as a file.
To take a screenshot and save it to your Mac’s pasteboard, choose Edit > Copy Screen.
To save a screenshot as a file, choose File > Save Screen Shot. The screenshot is saved to the desktop of your Mac.
Viewing the Simulated Device’s Screen
Even though iOS Simulator runs on all Macs, how it appears may differ between models. If you are using a computer whose screen is not large enough to display the entire simulator, only the screen of the simulated iOS device is shown, not the device border around it.
You can scale iOS Simulator by choosing Window > Scale > percentage of choice, but scaling shows only the device screen for any size other than 100 percent. For other scaling sizes, only the screen of the device is simulated, as shown in Figure 2-1.

Testing Retina and Non-Retina Display Devices
With iOS Simulator, you can simulate iOS devices both with and without Retina displays, regardless of whether you have a Mac with Retina display.
When working on a Mac without a Retina display, the simulator is mapped from pixel to pixel instead of from point to point. When simulating an app for an iOS device with Retina display on a Mac without a Retina display, the simulator appears twice as large as it would for a non-Retina display app to account for the extra pixels in a Retina display.
When working on a Mac with Retina display, your computer maps each point in the iOS app to a point on the Mac’s screen. If the simulated app is for an iOS device with a Retina display, each point is composed of 1 pixel. If the app being simulated is for an iOS device without a Retina display, each point is composed of 2 pixels.
To learn more about mapping points to pixels, see “Points Versus Pixels” in Drawing and Printing Guide for iOS.
© 2013 Apple Inc. All Rights Reserved. (Last updated: 2013-04-23)