Device simulation using the iOS Simulator

The iOS Simulator (Mac-only) offers a fast way to run and debug iOS applications. When testing with the iOS simulator, you do not need a developer certificate or a provisioning profile. You must still create a p12 certificate, although it can be self-signed.

By default ADT always launches the iPhone simulator. To change the simulator device, set the environment variable, AIR_IOS_SIMULATOR_DEVICE, as follows:

launchctl setenv AIR_IOS_SIMULATOR_DEVICE "iPad Retina"

Restart the process after setting the environment variable and run the application on the simulator device of your choice.

Note: When using ADT with the iOS Simulator, you must always include the ‑platformsdk option, specifying the path to the iOS Simulator SDK.

To run an application in the iOS Simulator:

  1. Use the adt -package command with either -target ipa-test-interpreter-simulator or -target ipa-debug-interpreter-simulator, as the following example shows:

    adt     -package 
        -target ipa-test-interpreter-simulator 
        -storetype pkcs12 -keystore Certificates.p12 
        -storepass password 
        myApp.ipa 
        myApp-app.xml 
        myApp.swf 
        -platformsdk /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk
  2. Use the adt ‑installApp command to install the application in the iOS Simulator, as the following example shows:

    adt     -installApp 
        -platform ios 
        -platformsdk /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk 
        -device ios-simulator 
        -package sample_ipa_name.ipa
  3. Use the adt ‑launchApp command to run the application in the iOS Simulator, as the following example shows:

    adt     -launchApp 
        -platform ios 
        -platformsdk /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk 
        -device ios-simulator 
        -appid sample_ipa_name

To test a native extension in the iOS Simulator, use the iPhone-x86 platform name in the extension.xml file and specify library.a (static library) in the nativeLibrary element, as the following extension.xml example shows:

<extension xmlns="http://ns.adobe.com/air/extension/3.1"> 
  <id>com.cnative.extensions</id> 
  <versionNumber>1</versionNumber> 
  <platforms> 
    <platform name="iPhone-x86"> 
      <applicationDeployment> 
        <nativeLibrary>library.a</nativeLibrary> 
        <initializer>TestNativeExtensionsInitializer </initializer> 
        <finalizer>TestNativeExtensionsFinalizer </finalizer> 
      </applicationDeployment> 
    </platform> 
  </platforms> 
</extension>
Note: When testing a native extension in the iOS Simulator, do not use the static library (.a file) that is compiled for the device. Instead, be sure to use the static library that is compiled for the simulator.