196

I have an iphone simulator running on my Mac.

I have a .ipa file, can you please tell me how can I install it on the simulator?

Abizern
  • 146,289
  • 39
  • 203
  • 257
yinglcs
  • 2,891
  • 6
  • 26
  • 20
  • Double tap in the ipa file and you'll see the app icon, drag and drop into your simulator – Luchi Parejo Alcazar Jul 28 '22 at 09:09
  • **UPDATED Aug 2023** [Solution to install an .IPA on a Simulator](https://stackoverflow.com/questions/72015509/how-to-install-ipa-in-ios-simulator/76917760#76917760) – YuryDG Aug 17 '23 at 00:20

14 Answers14

153

You can't. If it was downloaded via the iTunes store it was built for a different processor and won't work in the simulator.

August
  • 12,139
  • 3
  • 29
  • 30
117

I found an .ipa file that I wanted using iTunes and copied it over to my desktop.

After that I changed the extension to .zip and extracted it.

Next I found the Payload folder and moved the application inside to my desktop.

Finally I moved that application to my iPhone simulators applications folder found at:

  • HD
  • > Applications
  • > Xcode.app (right click - Show Package Contents)
  • > Contents
  • > Developer
  • > Platforms
  • > iPhoneSimulator.platform
  • > SDKs
  • > iPhoneSimulator6.0.sdk
  • > Applications

(Note: Some apps crash more often than others.)

starball
  • 20,030
  • 7
  • 43
  • 238
Keeton Feavel
  • 1,197
  • 1
  • 7
  • 2
  • 30
    @DataGreed: It's moved to HD > Applications > Xcode.app (right click - Show Package Contents) > Contents > Developer > Platforms > iPhoneSimulator.platform > SDKs > iPhoneSimulator6.0.sdk > Applications – Richard Poole Nov 21 '12 at 01:43
  • I am using version 6.1 of the simulator, the icons dont even show up when I start the simulator, any ideas? – Cui Pengfei 崔鹏飞 Feb 17 '13 at 09:58
  • 7
    The path for XCode 4.3 or newer on OSX is at the following location (note that the 5.1 part may be different on your machine) /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.1.sdk/Applications – Brad Parks Jun 21 '13 at 16:50
  • +1 damn i followed you, but when i try to open apps in ios7 simulator it doesn't launches apps like there is a block to that apps uhmm :P i'll try on ios6 simulator or ios5 – itsme Oct 20 '13 at 11:18
  • it crashes on iOS 6 & iOS 7 – lenhhoxung Nov 15 '13 at 04:51
  • This is exactly how I had to do it when taking over a project for a client that had a pissed off developer previously working on it. Thanks for the post, as I didn't remember how I did it. – BRogers Dec 02 '13 at 00:40
  • 15
    application dispalying in simulator.. but its crashing in both iOS6 and iOS7 – Sri May 27 '14 at 12:07
  • @Keeton Feavel it does not worked for me . i m using iOS8.3 simulator – ChenSmile May 29 '15 at 13:37
  • 1
    @DataGreed : You mentioned correct location. Answer mentioned by Keeton helped me in installing LinkedIn app but it is crashing. Any fix? – Jayprakash Dubey Aug 29 '15 at 15:55
  • 3
    I am confirming this installation method to be working even in March 2016. (Though crashed, But Installed) – jeet.chanchawat Mar 11 '16 at 09:23
  • 1
    And in 2017 with Xcode 8.2 the path is (probably): `/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/Applications`. Once I put the app in there, how do I start it in the simulator? I don't see it as an app on the home screen. – Alex Ixeras Oct 13 '17 at 06:18
76

In Xcode 6+ and iOS8+ you can do the simple steps below

  1. Paste .app file on desktop.
  2. Open terminal and paste the commands below:

    cd desktop

    xcrun simctl install booted xyz.app

  3. Open iPhone simulator and click on app and use

For versions below iOS 8, do the following simple steps.

Note: You'll want to make sure that your app is built for all architectures, the Simulator is x386 in the Build Settings and Build Active Architecture Only set to No.

  1. Path: Library->Application Support->iPhone Simulator->7.1 (or another version if you need it)->Applications
  2. Create a new folder with the name of the app
  3. Go inside the folder and place the .app file here.
sinh99
  • 3,909
  • 32
  • 32
65

Update for Xcode 9.4.1+

Hope my answer is getting seen down here as this took me a while to figure out but I just got it working.

First of all you need to build and run the App on your simulator. Then you open the Activity Monitor. Double click the name of your App to find its content.

enter image description here

In the next screen open the Open Files and Ports tab and find the line with MyAppName.app/MyAppName.

enter image description here

Copy the link but make sure to stop at the MyAppName.app. Do not copy the path following it.

Control click onto the finder icon and select Go to folder.

enter image description here]

Paste the path and click enter. You will see your MyAppName.app file. Copy it to the Desktop and zip it. Move it to your desired 2nd computer and unzip the file. Build a random project to have a simulator open.

Lastly: Literally drag and drop the App from your Desktop into your Simulator. You will see the install and the App opens and does not crash.

enter image description here

David Seek
  • 16,783
  • 19
  • 105
  • 136
  • 11
    downvote without a comment for an answer that works :D awesome – David Seek Sep 03 '18 at 19:57
  • Works for transfering dev builds to other simulators! – Alex Pelletier Oct 25 '19 at 17:02
  • 1
    @AlexPelletier isn't that the point of what we're talking here? xD – David Seek Oct 25 '19 at 17:38
  • 1
    Works for me! For anyone who's trying to use the .ipa it won't work because the .ipa only include the arm code. – Hua-Ying Aug 29 '20 at 16:27
  • 2
    "First of all you need to build and run the App on your simulator. " <- How? Isn't this what the OP is asking how to do in the first place? – Nodeocrat May 05 '21 at 10:30
  • The idea is, that you run and build the app, then export it and move it to the second machine. And there you run the exported application. So someone needs to build the app, that someone that has access to the source code. And then you can use that build to run the application on a machine, that does not need access to the code. Hope that makes it more clear for you. – David Seek May 08 '21 at 01:56
  • It fails with error: "Appex bundle at [...] with id [...] specifies a value (com.apple.usernotifications.service) for the NSExtensionPointIdentifier key in the NSExtension dictionary in its Info.plist that does not correspond to a known extension point." – Can Poyrazoğlu May 29 '23 at 20:08
37

You cannot run an ipa file in the simulator because the ipa file is compiled for a phone's ARM architecture, not the simulator's x86 architecture.

However, you can extract an app installed in a local simulator, send it to someone else, and have them copy it to the simulator on their machine.

In terminal, type:

open ~/Library/Application\ Support/iPhone\ Simulator/*/Applications

This will open all the applications folders of all the simulators you have installed. Each of the applications will be in a folder with a random hexadecimal name. You can work out which is your application by looking inside each of them. Once you have found out which one you want, right click it and choose "Compress ..." and it will make a zip file that you can easily copy to another computer and unzip to a similar location.

rjmunro
  • 27,203
  • 20
  • 110
  • 132
  • 2
    On iOS 8 it was moved to per device apps: ~/Library/Developer/CoreSimulator/Devices/594C6B4D-AB19-479B-A047-240361C51D95/data/Applications/ So `open ~/Library/Developer/CoreSimulator/Devices/*/data/Applications` – CC. Sep 22 '14 at 22:14
  • Or, you can extract it from your one simulator, launch another (switch the OS version) and then install it in there. – Alex Zavatone Apr 22 '16 at 16:20
  • 4
    Since iOS 10 you have to copy both hexadecimal named application folders from the following locations: `~/Library/Developer/CoreSimulator/Devices/*/data/Containers/Data/Application/` `~/Library/Developer/CoreSimulator/Devices/*/data/Containers/Bundle/Application/` Otherwise App will not show up in simulator. – Macucula Sep 14 '17 at 09:17
37

UPDATE: For Xcode 8.0+ you need to follow below Steps:

  1. Download application from iTunes
  2. Select downloaded app, right click show in finder
  3. Copy .ipa file to Desktop, rename it to .zip file
  4. Extract that .zip file and you will get directory with application name
  5. Check that directory you will find app file in Payload folder, copy this app file

  6. Go to ~/Library/Developer/CoreSimulator/Devices

FYI: Library folder is hidden by default in mac, you can see hidden file using below command.

defaults write com.apple.finder AppleShowAllFiles YES;
killall Finder /System/Library/CoreServices/Finder.app

Now here you'll see many directories with long hexadecimal names, these all are simulators.

To find your desired simulator, sort these directories using "Arranged By > Date Modified".

Select that simulator file and go to below location.

  1. <HEXADECIMAL-SIMULATOR-STRING>/data/Containers/Bundle/Application/
  2. Create new folder name with <download-app-name> and paste app file in that folder
  3. Open Terminal and run below command to install this application

    xcrun simctl install booted <APP_FILE_PATH>
    

Example <APP_FILE_PATH> will be looks like below:

~/Library/Developer/CoreSimulator/Devices/<HEXADECIMAL-SIMULATOR-STRING>/data/Containers/Bundle/Application/<APP_NAME>
Shiro
  • 7,344
  • 8
  • 46
  • 80
Kampai
  • 22,848
  • 21
  • 95
  • 95
  • 2
    You can use `xcrun simctl list` to find the simulator and codes – Paulo Amaral Mar 16 '17 at 11:13
  • 3
    This seems to work, but your example app path needs a / after the ~ at the beginning, and the path needs to go all the way to the .app file, not just the directory that contains it. – emery Mar 30 '17 at 18:25
  • 1
    If you want to find the simulator that is currently running you can use `xcrun simctl list | grep Booted` – cjbarth Oct 17 '17 at 14:49
  • 1
    how can this work reliably for any downloaded app? since only arm binaries are required, what else would xcode be doing to make it work? unless you meant only for apps where you had all original assets to retarget anyway? – whitneyland Jul 17 '18 at 04:53
23

First of all, IPAs usually only have ARM slices because the App Store does not currently accept Simulator slices in uploads.

Secondly, as of Xcode 8.3 you can drag & drop a .app bundle into the Simulator window and it will be installed. You can find the app in your build products directory ~/Library/Developer/Xcode/DerivedData/projectname-xyzzyabcdefg/Build/Products/Debug-iphonesimulator if you want to save it or distribute it to other people.

To install from the command line use xcrun simctl install <device> <path>.

device can be the device UUID, its name, or booted which means the currently booted device.

russbishop
  • 16,587
  • 7
  • 61
  • 74
  • 2
    Yes, you can drag & drop the `.app` file but that doesn't copy everything the Simulator needs to run it. App I'm working with just crashes immediately. Xcode v. 8.3.3 – Matthew Poer Jul 13 '17 at 04:13
  • 5
    It does, by definition, include everything needed. When Xcode installs an app in the Simulator we pass a path to the `.app` file and that is what gets installed. Your app is crashing for a different reason. – russbishop Jul 13 '17 at 17:40
13

For Xcode 10, here's an easy way that worked for me for a debug IPA (development profiles)

  1. Unzip the IPA to get the Payload folder.
  2. Within the Payload folder is the app executable.
  3. Drag and drop the app to an open simulator. (You might see a green add button when you drag it over the simulator)

It should install that app on that simulator.

Swasidhant
  • 1,231
  • 1
  • 12
  • 13
  • Works for me, I've changed the name of "my-app.ipa" to "my-app.ipa.zip" and after that I unzipped it using the macos Finder app. If you want to install the app using the terminal: `xcrun simctl install "simulator-name" /path/to/my-app.app` – im-a-teapot Jun 08 '20 at 19:00
  • xcrun simctl install booted "my-application.app" works to :) – Medhi Feb 13 '23 at 15:21
  • xcrun no more available on xcode 14 :'( – Huy Hóm Hỉnh Apr 12 '23 at 19:34
7

You can run the application file of project in simulator - not .ipa file.

You can get it from:

Libraries-->Applicationsupport-->iphone simulator-->4.3(its ur simulator version)-->applications-->then u can see many files like 0CD04F.... find out your application file through open it.

You can copy the file to your system(which system simulator u need run ) location Libraries-->Applicationsupport-->iphone simulator-->4.3(its your simulator version)-->applications-->

Then open the simulator 4.3 (its your simulator version where you pasted). You can see the application installed there.


Getting from other people:

Please tell them to find out Libraries-->Applicationsupport-->iphone simulator-->4.3(its ur simulator version)-->applications-->then you can see many files like 0CD04F.... from their system and receive that file from them.

After they have got the file, please copy and paste the file in to your system `Libraries-->Applicationsupport-->iphone simulator-->4.3(its your simulator version)-->applications-->(paste the file here).

Then you can see the app is installed in your system simulator and you can run it after clicking the file.

Max
  • 1,974
  • 2
  • 16
  • 24
humblePilgrim
  • 1,818
  • 4
  • 25
  • 47
6

Copy From Here:
- Run the application in the Xcode. - Select Finder go to Go and click on select Library Library/Application Support/iPhone Simulator/7.0.3-64/Applications - Select 32 bit folder Copy your application.

Paste To Here:
- /Applications/Xcode-Beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhone Simulator. SDK/Applications
- Paste here and run the simulator.

Satheesh Guduri
  • 353
  • 4
  • 8
5

With Xcode 6:

It's very possible to build and install on a simulator.

I did it by copying the debug build configuration (I called it SimRelease for my example below) in the project settings. I changed the architectures to i386 and x86_64 (not sure how necessary this was), but key difference to change between the copied build configuration is build for active architecture set to NO. After that a couple simple command line tools will do the rest!

xcodebuild -scheme YOUR_SCHEME -configuration SimRelease -sdk iphonesimulator8.1

Depending on where you have your DerivedData set you need to go find the outputted .app folder. Once you've found it you can simply install it on any simulator device. To find the device UUID's open Xcode and go to Window->Devices you'll see the list of the device instances and you can grab the UUID's. For a trivial script you could grab all of them from: ~/Library/Developer/CoreSimulator/Devices/ and install on every device.

From there the simple command to install on a device is:

xcrun simctl install DEVICE_ID APP_FOLDER_LOCATION

Here's a simple shell script to take the app and install it on every device:

app_dir=$1
current_dir=$(pwd)
cd ~/Library/Developer/CoreSimulator/Devices/
devices=$(ls -d */)
cd "$current_dir"
for device in $devices
do
    device_id=${device%/}
    xcrun simctl install "$device_id" "$app_dir"
done

Hope this helps! Took me a while to figure out the best way to do it.

rfrittelli
  • 1,211
  • 13
  • 15
  • this script is shorter: xcrun simctl install booted APP_FILE_PATH But when install app to simulator, the app can not run – Đông Hà Apr 24 '15 at 12:40
4

Step to run in different simulator without any code repo :-

First create a .app by building your project(under project folder in Xcode) and paste it in a appropriate location (See pic for more clarity)

enter image description here

  1. Download Xcode
  2. Create a demo project and Start simulator in which you want to run the app.
  3. Copy the .app file in particular location(ex :- Desktop).
  4. cd Desktop and Run the command (xcrun simctl install booted appName.app),
  5. App will be installed in the particular booted simulator.
Anurag Bhakuni
  • 2,379
  • 26
  • 32
2

Tested on iPod touch (7th generation) Simulator 13 (iOS 15.0)

Xcode and Xcode Command Line tools are already installed

Since we have an .ipa file, we can get the .app file from it

  1. Rename .ipa file as .zip and extract the contents
  2. Once the zip file is extracted, we can find the Payload folder which contains App_Name.app file

Open Terminal or iTerm2 app

  1. Navigate to the folder which contains .app file
  2. To list all iOS connected devices & iPhone simulators -> Also shows the UDID of all devices
xcrun xctrace list devices
  1. Boot the simulator
xcrun simctl boot <UDID>
  1. Launch the simulator
open -a simulator
  1. Install the .app file
xcrun simctl install booted <App_Name>.app
1

Just drag and drop .app file to simulator it will install app automatically.

I have checked in iPhone simulator 13(iOS 15.4)

Kirit Vaghela
  • 12,572
  • 4
  • 76
  • 80