33

I'm looking for a way to install the mail application on the Xcode 6 iOS Simulator.

Additionally, how do I install apps that are already public on the Appstore so that I can run them on the iOS Simulator? Is there a simple way?

jnic
  • 8,695
  • 3
  • 33
  • 47
Heman Patekar
  • 331
  • 1
  • 3
  • 3

4 Answers4

41

The most common way to install an app in the iOS Simulator is to use Xcode to build and install it. If you have a simulator app bundle which was built by someone else (or archived), you can install it using simctl:

xcrun simctl install booted /path/to/your.app

Keep in mind, of course, that these apps need to be iOS Simulator apps, not iOS Device apps.

Jeremy Huddleston Sequoia
  • 22,938
  • 5
  • 78
  • 86
  • Brilliant! Works for me with Simulator 9.2 (from Xcode 7.2) on El Capitan. Manually copying apps to Simulator folders stopped working for me, but this command line solution solved the problem, allowing me to distribute iOS apps to others on my team. – lifjoy Jan 30 '16 at 00:24
  • If you have a simulator app bundle(Path: /Users/Mac/Library/Developer/CoreSimulator/Devices/1D**-**-**-**BA/data/Containers/Bundle/Application/43**-**-**-**DF/your.app) which was built by someone, But archived IPA(contains: your.app), isn't support to install on Simulator(Tested on tvOS) for Xcode 13.1 or new. – JNYJ Feb 28 '23 at 03:30
24

The iOS simulator is a different compiled binary than the app that gets published on the app store.

If you don't have access to the project's source code or simulator binaries, you can't install it on your own simulator.

Michael Dautermann
  • 88,797
  • 17
  • 166
  • 215
  • Mail client/app is something that comes standard on iOS devices, so I'm not sure why Apple's XCode / iOS Simulator doesn't provide it by default. I'm mainly interested in testing some content that appears on the iOS mail client. How can I accomplish this on the iOS Simulator? – Heman Patekar Feb 05 '15 at 19:47
  • 2
    Apple always preach testing on actually device. There is limitation to the API in iOS simulator. – Black Frog Feb 05 '15 at 20:15
  • Mostly true. If someone else builds a sim app bundle, you could install the resulting binary with 'xcrun simctl install ...' – Jeremy Huddleston Sequoia Feb 07 '15 at 21:41
  • @HemanPatekar The Mail app may not be there, but you should be able to use compose sheets without the app itself. Please be more specific about your exact problem. – Jeremy Huddleston Sequoia Feb 07 '15 at 21:42
9

In Xcode 8.2, you can now drag an app onto a iOS Simulator window. See this blog: https://medium.com/@hollanderbart/new-features-in-xcode-8-2-simulator-fc64a4014a5f

bartosss
  • 1,030
  • 9
  • 16
  • Have anybody checked if the simulator and simulated iOS version still has to match those used when building the simulator app? – Johan Mar 03 '17 at 09:26
5

NOTE: The receiver of the simulator app has to boot up the same simulator and iOS version, as what was used to compile the simulator app bundle.

To install an app compiled for the simulator, you have to:

  1. Boot up the simulator you want to install the app on (and leave it running for step 2).
  2. To install StackOverflow.app from your Desktop, write the following in terminal: xcrun simctl install booted ~/Desktop/StackOverflow.app

You should now instantly see the app icon appear in the simulator (likely appearing on page 2).


To obtain the simulator app you want to distribute, you can run this command in the Xcode console (this works at least when the simulator app has paused on a breakpoint): po NSHomeDirectory()

The folder will be something like:

/Users/MyHomeFolder/Library/Developer/CoreSimulator/Devices/09BB353F-3AF9-4A2A-8CDB-0F15634AD6D8/data/Containers/Data/Application/8F509C84-6809-461D-9F9E-06811EF9A700

The app bundle will be inside the Containers folder at Bundle/Application/3ADE9CF0-F6D0-4461-9B82-30A86580D2C7/StackOverflow.app

Distribute the .app file, specifying the simulator device and iOS version used when compiling the bundle (the same has to be used by the receiver).

Johan
  • 2,472
  • 1
  • 23
  • 25