iOS development-Creating simulator packages for iOS projects for running tests on iOS emulators on other computers (Creating an iOS Simulator Build)

Source: Internet
Author: User
Tags install brew

Later in the development of iOS programs, you need to package and distribute the program to everyone for testing. In general, this type of test is a real-machine test, which is correct and necessary. There is just one problem that the IPA package that generates the real machine test requires the relevant certificate.

Of course, the vast majority of iOS developers and even some independent developers can easily (fair bet) get these certificates. Therefore, it is necessary to declare the applicable population and situation of this article:

1. The generated application package can only be used for simulator testing and cannot be used for the real machine;

2. No special certificate is required;

3. A person is not included in the certificate of the device, but need to see the program, verify the relevant functions (or the developer itself does not have any certificates, but need others to observe or test his program).


The body starts with an iOS simulator package that you need to do the following:

· Locate the folder that contains the Xcode items that you want to package.

· Open the terminal and run a few lines of command to build build.

· Use the command line on other computers to start the iOS emulator and install the emulator package that runs the package.



Find your Xcode project directory:

Before we start, let's configure the build configuration (Package debug version or release version) as shown in:



Then we have to find the directory where Xcode works, the easiest way is to use Xcode itself. Click on your project and select Show in Finder:



Open the terminal and look for your iOS Simulator SDK version :

Locate the folder under the . Xcodeproj file and open with Terminal:


By opening the terminal in this way, you will navigate directly to the directory where your project is located:


now run CD: Go back to the top level directory:


Run the following command on the terminal to find the version of the SDK available on your machine:

Xcodebuild-showsdks


In this article, we only need to use the iOS Simulator SDK, if you have more than one iOS emulator SDK installed on your PC, select the latest version:



To Create a simulator package:

Continue to run the following command at the terminal and replace the field after "-SDK" with your emulator SDK

Xcodebuild-arch I386-SDK [Iphonesimulator]


Note: If your project is a multiple "target" project, then you will also need to specify a target to generate the target simulator package, the command is as follows:

Xcodebuild-arch i386-sdk [Iphonesimulator]-scheme [Nameofscheme]



after successful operation, the terminal will output a series of information and * * BUILD succeeded * * end.

The generated emulator package is stored in this path:

{Derive Data Directory}/build/release-iphonesimulator/{projectname}.app

The specific information for this path can also be found in the output information of the final terminal.



launch the iOS emulator from the command line and install the emulator package that runs above:

Reopen a terminal window and run the following command:

Ios-sim launch <path to .app>

This launches the iOS emulator and runs the app in the emulator.

Bad, some students may be reported on the computer: "-bash:ios-sim:command not Found" error. Don't panic, this is a tool that has not been installed on the computer yet Ios-sim. To install this tool, there is a very simple way: Install Ios-sim through brew, a single line of command can be done. Enter the following command at the terminal and run:

Brew Install Ios-sim

Of course, I have a hunch that maybe you don't have any brew on your computer, poke my other tutorial on the Mac, install brew using the command line, and install the brew through the Brew installation Ant tool.

It's all done. Before you rerun the Ios-sim launch <path to .app> command .




Resources:

Creating IOS Simulator Build for Facebook Review

iOS development-Creating simulator packages for iOS projects for running tests on iOS emulators on other computers (Creating an iOS Simulator Build)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.