xcode build/archive app for anyone to run in a simulator

12,010

Solution 1

All answers here are wrong.

You cannot run an .IPA file on the simulator. The simulator runs files which are compiled for the x86 processor, while IPA files are compiled for the ARM processor in the iPhone. Additionally .IPA files must contain a valid certificate while apps for the simulator do NOT need a certificate.

After building the app, go to the left side navigator bar, select Products > appName.app, right click it and select 'Show in Finder'. Finder will show the .app file and you can send the file to your colleague / client and ask them to drag and drop it into iOS Simulator.

Get ios .app folder for simulator

Solution 2

If you have the .app bundle, you can create a tarball of it and send it to someone else. They can then extract it and use xcrun simctl install <device UDID> <path to app bundle> to install your app in the given simulator device.

Solution 3

  1. Build the app in simulator, then locate the simulator data folder. You can get the list of simulator UDID by typing instruments -s devices in Terminal. The UDID is the string between the square brackets. Locate your finder to ~/Library/Developer/CoreSimulator/Devices/[Simulator UDID]

  2. Inside your simulator data folder, locate to data/Containers/Bundle/Application , you will see some folder there if you have multiple apps built before, open them one by one and find the one with your app name inside.

  3. Compress the app_name.app and send it to others. Ask other to use the command instruments -s devices in terminal to find the UDID as well.

  4. Open Xcode and the selected simulator, then open terminal, type xcrun simctl install <Device UDID> <Path to unzipped app_name.app>

The app should install successfully in the simulator, I wrote a blog post about this with screenshot guide here : https://fluffy.es/how-to-archive-ios-app-for-simulator/

Solution 4

First off you will need a release build (not a dev build) to share the installable simulator .app

To generate a Release build:

  1. make sure you go into edit scheme (next to the simulator selector)

  2. Under Run change the build configuration to Release

Then you can right click the app and go into the DerivedData//Build/Products/Release-iphonesimulator/.app

Copy the .app and share with whoever has xcode.

That person then needs to do a few things.

  1. Download your app and add it in a location that they can access the path. example: Users/<username>/Downloads/test.app

  2. Get the device ID xcrun simctl list devices example 7FAB6CD2-70D0-416F-9C50-4C7C23B2ABCD

  3. With a valid simulator id, run xcrun simctl install 7FAB6CD2-70D0-416F-9C50-4C7C23B2ABCD Users/<username>/Downloads/test.app

  4. The app should install and they should be able to open the app.

Share:
12,010

Related videos on Youtube

Johnny Major
Author by

Johnny Major

Updated on July 10, 2022

Comments

  • Johnny Major
    Johnny Major almost 2 years

    I am trying to figure out how I can build/archive my iOS application in xcode so that I can send it to anyone and they can run in it a simulator. I thought I could just build it and run it in the simulator and pull the .app file however I have no luck. I would like to build it so anyone I give it to can run it in any simulator using the phonegap ios-sim.

    Any information would be great!

    Thanks

    • Sam B
      Sam B over 9 years
      Have you looked into testflight? You can have external users test your app on actual devices. I am assuming you are asking this question because your testers don't have apple devices. In that case tell them to download Xcode for free from apple, install it and then zip up your entire project and send to them. Or stage it on github
  • Jeremy Huddleston Sequoia
    Jeremy Huddleston Sequoia over 9 years
    This information is outdated and does not apply to Xcode 6.0 and newer.
  • Elmue
    Elmue almost 5 years
    This is not an answer to the question. "If you have the .app bundle...". The question is how to GET the app bundle, not how to start it in the simulator. You missed the point.
  • Elmue
    Elmue almost 5 years
    Your answer does not help. The folder "CoreSimulator" does not exist in "/Library/Developer". There are only "CommandLineTools" and "PrivateFrameworks". However your link is more useful than your answer. The first chapter on that "fluffy" page descibes how to do it.
  • Elmue
    Elmue almost 5 years
    The answer is wrong. An IPA file can only run on a real phone but NOT in the simulator.
  • Jeremy Huddleston Sequoia
    Jeremy Huddleston Sequoia almost 5 years
    On the contrary, it does answer the question of how to share the app with others. Specifically note "so that I can send it to anyone and they can run in it a simulator" in the original question. It seemed obvious to me how to actually get the app bundle (just run 'xcodebuild -target <your app target> -sdk iphonesimulator' to build it) and perhaps the less obvious how to actually install it.
  • Elmue
    Elmue almost 5 years
    If you know in which folder XCode has stored the compiled app (which is the most difficult part for a beginner) you can simply put the "XYZ.app" folder into a ZIP file and send it to anyone. The other person can then simply drag and drop the content of the ZIP file onto the iOS simulator. No commandline magic is required for this.
  • Jeremy Huddleston Sequoia
    Jeremy Huddleston Sequoia almost 5 years
    Yep, we added that a couple years ago. As for the path of the app itself, just drag it out of the file navigator in Xcode.
  • JohnnyC
    JohnnyC almost 5 years
    This is by far the easiest way to get the .app file
  • Balasubramanian
    Balasubramanian about 3 years
    app which is under products folder is debug build. How to we get release build?