[iphone] How can I install a .ipa file to my iPhone simulator

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?

This question is related to iphone macos ios-simulator

The answer is


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


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.

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.


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

Hope this helps! (Note: Some apps crash more often than others.)


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.


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.


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.


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.

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.


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.


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>

Examples related to iphone

Detect if the device is iPhone X Xcode 8 shows error that provisioning profile doesn't include signing certificate Access files in /var/mobile/Containers/Data/Application without jailbreaking iPhone Certificate has either expired or has been revoked Missing Compliance in Status when I add built for internal testing in Test Flight.How to solve? cordova run with ios error .. Error code 65 for command: xcodebuild with args: "Could not find Developer Disk Image" Reason: no suitable image found iPad Multitasking support requires these orientations How to insert new cell into UITableView in Swift

Examples related to macos

Problems with installation of Google App Engine SDK for php in OS X dyld: Library not loaded: /usr/local/opt/openssl/lib/libssl.1.0.0.dylib dyld: Library not loaded: /usr/local/opt/icu4c/lib/libicui18n.62.dylib error running php after installing node with brew on Mac Could not install packages due to an EnvironmentError: [Errno 13] How do I install Java on Mac OSX allowing version switching? Git is not working after macOS Update (xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools) Can't compile C program on a Mac after upgrade to Mojave You don't have write permissions for the /Library/Ruby/Gems/2.3.0 directory. (mac user) How can I install a previous version of Python 3 in macOS using homebrew? Could not install packages due to a "Environment error :[error 13]: permission denied : 'usr/local/bin/f2py'"

Examples related to ios-simulator

The iOS Simulator deployment targets is set to 7.0, but the range of supported deployment target version for this platform is 8.0 to 12.1 flutter run: No connected devices Error Running React Native App From Terminal (iOS) How to uninstall downloaded Xcode simulator? Capture iOS Simulator video for App Preview iPhone 6 Plus resolution confusion: Xcode or Apple's website? for development How to enable native resolution for apps on iPhone 6 and 6 Plus? How to access iOS simulator camera Error Domain=NSURLErrorDomain Code=-1005 "The network connection was lost." Document directory path of Xcode Device Simulator