Sharing iPhone Apps for the Simulator

2019-03-11 08:45发布

iPhone Apps built for the simulator are stored here:

/Users/<username>/Library/Application Support/iPhone Simulator/User/Applications

Is it possible to copy the <GUID>.sb and <GUID> directory and install them on a different computer (with Development tools installed)?

This would be very useful for testing/demoing with out having to buy iPhones for all the managers and external clients.

4条回答
Lonely孤独者°
2楼-- · 2019-03-11 09:28

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.

查看更多
小情绪 Triste *
3楼-- · 2019-03-11 09:36

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)

查看更多
来,给爷笑一个
4楼-- · 2019-03-11 09:37

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 :)

查看更多
时光不老,我们不散
5楼-- · 2019-03-11 09:40

You are able to use simctl binary to interact with iOS simulators from command line.

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

      Find .app file inside derived data folder. /Users/alex/Library/Developer/Xcode/DerivedData/../Build/Products/Debug-iphonesimulator/AppName.app

  • Variant 2:

    1. Build and run the app on the simulator.
    2. 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
    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 -
https://coderwall.com/p/rv2lgw/use-xcodebuild-to-build-workspace-vs-project
https://www.webdigi.co.uk/blog/2016/how-to-transfer-your-app-to-an-ios-simulator-on-another-machine-using-app-file-and-xcrun/

查看更多
登录 后发表回答