Sharing iPhone Apps for the Simulator

我怕爱的太早我们不能终老 提交于 2019-11-30 04:14:24

Yes, if you send those files to another person, and they put them into that directory, they can test the applications in the iPhone Simulator as well :)

I found a way that requires just a little more setup, but is much easier for non-developers:

Instructions for your users/testers:

  1. Install Xcode following Apple's instructions
  2. Double-click the attached application - the iPhone simulator will launch, install the app and start it automatically.

How to set it up:

  1. Download and unzip (to a folder on your desktop or wherever) 'Simulator Bundler' from: http://github.com/landonf/simlaunch/downloads
  2. Set your XCode build target to the required Simulator configuration (iPad/iPhone/which iOS version)
  3. Do a 'Build and archive'
  4. Find it: select 'Archived applications' in the Organizer, right click the relevant build, select "Reveal archived application in Finder"
  5. Drag the application (yourAppName, no extension) onto the Simulator Bundler app

Done. This will create a self-contained Mac OS X yourAppDisplayName.app file in the same folder (with your app's icon as the icon) that you can stick up on an FTP server or email to your users/testers.

--

I think it's much neater/slicker than having to explain where to copy files, how to launch the simulator and so on.. And if anything gets messed up they can just uninstall via the familiar tap-and-hold + (x) gesture in the simulator UI, then double-click the app you sent them again.

You can also produce several of these packages changing the bundle identifier between builds, allowing them to be installed side by side in your testers' simulators; say for getting some user feedback on different UI designs, or configure one for Production and one for Staging/QA servers, so your content editors can check their changes before they go live or whatever..

The ability to reinstall the app from a desktop icon is also very convenient for localisation testing: launch the simulator, uninstall the app if present, set the required region format and language, double click the icon on your desktop, test; repeat for each required locale. (guarantees a fresh install each time, I've found that switching language with the app installed can result in all sorts of strange behaviour)

Build app

  • Variant 1 (Preferable):

    • Build a project

      Pattern:

      xcodebuild -project "path_to_fileName.xcodeproj" -target "targetName" -sdk "targetSDK" -configuration buildConfig CODE_SIGN_IDENTITY="NameOfCertificateIdentity" PROVISIONING_PROFILE="ProvisioningProfileName" OTHER_CODE_SIGN_FLAGS="--keychain keyChainName"
      
    • Build a worksapce

      Pattern:

      xcodebuild -workspace "path_to_fileName.xcworkspace" -scheme "schemeName" -sdk "targetSDK" -configuration buildConfig CODE_SIGN_IDENTITY="NameOfCertificateIdentity" PROVISIONING_PROFILE="ProvisioningProfileName" OTHER_CODE_SIGN_FLAGS="--keychain keyChainName"
      

      Example:

      xcodebuild -workspace "/Users/name.xcworkspace" -scheme "MyShemeName" -sdk iphonesimulator CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO
      
  • Variant 2:

    • Build and run the app on the simulator.

Find .app file.

  • inside derived data folder

    /Users/alex/Library/Developer/Xcode/DerivedData/../Build/Products/Debug-iphonesimulator/AppName.app
    
  • Project navigator -> your app project -> Products group -> *.app

  • Open Activity Monitor and find the <App Name> you are running(Not Xcode, the actual App you are building). Double click on the <App Name> -> Open Files and Ports -> Find <App Name.app> path -> find and copy a file <App Name.app> by path -> save the file locally.

Install app

  1. Open Xcode and open a Simulator
  2. On the command line type this command using simctl
    xcrun simctl install booted <path to App Name.app>
  3. The App should appear on the Simulator, just click on the App to Launch it.

The original instruction here and here

We just put up a little tool that will help you through this process for the latest version of Xcode.

It basically creates a zip of the app so that you can pass to the tester and it'll install the app in the right Xcode directory. It will also open it up for the user with the right device selected in iOS Simulator.

Here it is

http://blog.placeit.net/ios-app-packager/

Hopefully it's useful to you guys.

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