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

邮差的信 提交于 2021-02-06 17:11:34

问题


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


回答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.




回答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.




回答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/




回答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.




回答5:


First of all set proper bundle identifier with build setting and iOS version which is required for run app.

**

For Device

** 1.

You can Build Archive using and generate ipa

or build app then you will get .app you can drag .app in itune and get .ipa by show in finder.

**

For Simulator

** 2. path:- /Users/Krishan/Library/Application Support/iPhone Simulator/6.0/Applications Open above path and zip app folder which you want to share.Now unzip folder paste on same above path app shown in simulator will run successfully.



来源:https://stackoverflow.com/questions/26819516/xcode-build-archive-app-for-anyone-to-run-in-a-simulator

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!