Friday, January 20, 2012

How to open Xcode iPhone Simulator

I have been providing a lot of iPhone support recently and I don't own a iPhone so I have been using Xcode's iPhone Simulator which you can launch from through Finder here:

/Developer/Platforms/iPhoneSimulator.platform/Developer/Applications/iOS Simulator.app.

Also, you can make it available from Applications/QuickSilver by right clicking it and select 'Make Alias' and put the alias/shortcut wherever you want (like in your Applications folder).


Here's iOS Simulator information quoted from the iOS Developer Library which can be found here:

http://developer.apple.com/library/ios/#documentation/Xcode/Conceptual/ios_development_workflow/25-Using_iOS_Simulator/ios_simulator_application.html#//apple_ref/doc/uid/TP40007959-CH9-SW1

Using iOS Simulator

You use the iOS Simulator app to run your iOS app on a Mac. By simulating the operation of your app you:
  • Learn about the Xcode development experience and the iOS development environment before becoming a member of a development team.
  • Find major problems in your app during design and early testing.
  • Test your app’s user interface.
  • Measure your app’s memory usage before carrying out detailed performance analysis on iOS-based devices.
The iOS Simulator app (located in /Platforms/iPhoneSimulator.platform/Developer/Applications) presents the iPhone or iPad user interface in a window on your computer. This app provides several ways to interact with it by using the keyboard and mouse to simulate taps, device rotation, and other user actions.
This chapter describes the ways in which you use your computer’s input devices to simulate the interaction between users and their devices. The chapter also describes how to uninstall apps from a simulator and how to reset the contents of a simulation environment.

Setting the Device and iOS Version

iOS Simulator can simulate three devices (iPhone, iPhone with Retina display, and iPad) and several iOS versions.
To specify the device you want to simulate, choose Hardware > Device, and choose the device.
To specify the iOS version to simulate, choose Hardware > Version, and choose the iOS version.

Manipulating the Hardware

With iOS Simulator you can simulate most of the actions a user performs on a device. When your app is running in a simulator, you can carry out these hardware interactions through the Hardware menu:
  • Rotate Left. Rotates the simulator to the left.
  • Rotate Right. Rotates the simulator to the right.
  • Shake Gesture. Shakes the simulator.
  • Home. Takes the simulator to the Home screen.
  • Lock. Locks the simulator.
  • Simulate Memory Warning. Sends the frontmost app low-memory warnings. For information on how to handle low-memory situations, see <!--a target="_self"
“Observing Low-Memory Warnings” in iOS App Programming Guide.
  • Toggle In-Call Status Bar. Toggles the status bar between its normal state and its state when a phone call or FaceTime call is in progress. The status bar is taller in its in-call state than in its normal state. This command shows how your app’s user interface looks when the user launches your app during a call.
  • 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.
  • TV Out. Opens a window simulating the TV out signal of a device.
  • -->

    Performing Gestures

    Table 4-1 lists gestures you can perform on a simulator (see iOS Human Interface Guidelines for more about gestures).
    Table 4-1 Performing gestures in iOS Simulator
    GestureDesktop action
    TapClick.
    Touch and holdHold down the mouse button.
    Double-tapDouble-click.
    Swipe1. Place the pointer at the place where you want the swipe to start.
    2. Hold down the mouse button.
    3. Move the pointer in the direction you want to swipe and release the mouse button.
    Flick1. Place the pointer at the start position.
    2. Hold down the mouse button.
    3. Move the pointer quickly in the direction you want to flick and release the mouse button.
    Drag1. Place the pointer at the start position.
    2. Hold down the mouse button.
    3. Move the pointer in the direction you want to drag.
    Pinch1. 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 to the end position, and release the Option key.

    Installing Apps

    Xcode installs apps in simulation environments automatically when you build your app for a simulator. See “Building and Running Apps” for details.

    Uninstalling Apps

    To uninstall apps that you have installed in a simulation environment, use the same method used to uninstall apps from devices:
    1. Place the pointer over the icon of the app you want to uninstall and hold down the mouse button until the icon starts to jiggle and a close button appears.
    2. Click the close button.
    3. Click the Home button to stop the icon from jiggling.

    Resetting Content and Settings

    To set the user content and settings of a simulation environment to their factory state and remove the apps you have installed, choose iOS Simulator > Reset Content and Settings.

    Viewing iOS Simulator Console and Crash Logs

    To learn how to view your app’s console logs when it runs in a simulator, see “Viewing Console Output and Device Logs.”
    If your app crashes while running in a simulator, the CrashReporter facility displays details about the crash. You configure how CrashReporter deals with such crashes using the CrashReporterPref app, located in /Applications/Utilities (, which is the directory where the Xcode toolset is installed).

    Simulation Environment File System Location

    The file systems for the iOS releases the iOS Simulator can simulate are stored in your home directory, ~/Library/Application Support/iPhone Simulator. That directory contains one subdirectory per iOS release supported by iOS Simulator.
    Within each iOS-release directory, iOS Simulator stores system app preferences files in Library/Preferences and third-party–app preferences files in Applications/Library/Preferences.

    Hardware Simulation Support

    iOS Simulator doesn’t simulate accelerometer or camera hardware.

    No comments: