Why Can’t I Run My App in the iOS Simulator?

One very common and valid question when developing AIR mobile applications is “Why can’t I run my app in the iOS simulator?”

This is especially the case once you realize that you can compile and target the Android emulator; The ADT packager supports exporting to the Android emulator, but you can also install any APK (Android Package) binary file into the emulator using the normal tools contained within the Android SDK.

The reason that you can run a Flex Mobile app in the Android emulator, but not in the iOS Simulator comes down to the fundamental difference between an emulator and a simulator. An emulator emulates a physical device; The emulator program mimics the hardware, and the device-specific code that will run on the actual device runs within the mimicked environment. A simulator simulates an environment – it has a likeness or model of an environment, however it is not identical to the target environment.

In this case, the Android emulator mimics the hardware environment and is capable of running a compiled APK for a Flex/AIR mobile application. However, the iOS simulator is not capable of executing the contents of an IPA file. This isn’t specific to an IPA file for an AIR mobile app, but any IPA file – even those downloaded from Apple’s own app store.

The executable content within an IPA file is compiled targeting the device’s A4-ARM processor. Your desktop computer uses an intel-based processor architecture, which isn’t compatible and will not work. Even if you rename an IPA file to a ZIP file and extract the contents, it will not work within the iOS Simulator because of the CPU architecture differences.

Best Practice:

The first, and most important point that I emphasize regarding mobile application development is that nothing is more important than testing your mobile applications on a physical device. Emulators and simulators can help you see how an application may operate within a given environment, but they do not provide you with the actual environment. Physical devices may have memory, CPU, or other physical limitations that an emulator or simulator may not be able to reveal.

Secondly, keep in mind that emulators and simulators are created to make your development process easier and faster (especially if hardware is not readily available for the entire dev team). The debugging environment within Flash Builder is designed exactly for that purpose. You can quickly and easily test your application’s interface and functionality with a single button click. You can even setup debugging profiles for multiple devices, or use one of the predefined device configurations:

While these capabilities make developing for multiple form factors and multiple device types significantly easier and faster, this does not trump my first point. If you are targeting specific hardware, then it is imperative that you test thoroughly on your target platform(s).

11 replies on “Why Can’t I Run My App in the iOS Simulator?”