IOS development-create a Simulator package for the iOS project for testing the iOS Simulator running on other computers (Creating an iOS Simulator Build)

Source: Internet
Author: User
Tags install brew

IOS development-create a Simulator package for the iOS project for testing the iOS Simulator running on other computers (Creating an iOS Simulator Build)

After the iOS program is developed, it is necessary to package the program and distribute it to everyone for testing. Generally, such tests are true machine tests, which are correct and necessary. There is only one problem. The relevant certificate is required to generate an ipa package for a real machine test.

Of course, the vast majority of iOS developers and even some independent developers can easily obtain these certificates. Therefore, we need to declare the applicable groups and situations of this article:

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

2. No special certificate is required;

3. someone is not included in the certificate, but needs to see the program and verify the relevant functions (or the developer does not have any certificate, but needs others to observe or test the program ).

 

To generate an iOS simulator package, you must perform the following operations:

· Find the folder containing the Xcode project to be packaged.

· Open the terminal and run several lines to generate a build.

· Use command lines on other computers to start the iOS simulator and install the package of the simulator package.

 

 

Find your Xcode project directory:

Before everything starts, configure Build Configuration (package the Debug or Release version), as shown in:

 

Then we need to find the directory where the Xcode project is located. The easiest way is to use Xcode itself. Click your project and selectShow in Finder:

 

Open the terminal and find your iOS Simulator SDK version:

Find the. xcodeproj file in the folder and open it on the terminal:

 

Open the terminal in this way and navigate directly to the directory where your project is located:

 

Now run cd .. back to the upper-level directory:

 

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

Xcodebuild-showsdks

 

In this article, we only need to use the iOS Simulator SDK. If multiple iOS Simulator sdks are installed on your computer, select the latest version:

 

 
Create a simulator package:

Run the following command on the terminal and replace the field following-SDK with your simulator sdk.

Xcodebuild-arch i386-sdk [iphonesimulator]

 

 

NOTE: If your project is a multi-Target project, you need to specify a Target to generate the Target simulator package. The command is as follows:

Xcodebuild-arch i386-sdk [iphonesimulator]-scheme [NameOfScheme]

 

 

After running successfully, a series of information is output on the terminal and ends with ** build succeeded.

The generated simulator package is stored in this path:

{Derive data directory}/build/Release-iphonesimulator/{projectname}. app

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

 

 

Start the iOS simulator through the command line and install and run the simulator package generated above:

Open a terminal window and run the following command:

Ios-sim launch

In this way, the iOS simulator is started and the app is run in the simulator.

 

Poor, some people may report the error "-bash: ios-sim: command not found" on their computers. Don't worry, this is because ios-sim is not installed on your computer. To install this tool, there is a very simple method: Install ios-sim through brew, a line of command can be done. Enter the following command on the terminal and run:

Brew install ios-sim

Of course, I have a hunch that brew may not be installed on your computer, and I am hitting another tutorial. Use the command line to install brew on Mac, and install brew using tools such as Ant through brew.

All of this is done, and then re-run the previous ios-sim launch. Command.

 

 

Related Article

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.