Still waiting for the long iOS build process? Try to build and run the iOS app quickly by using the command line

Source: Internet
Author: User


Needless to say, Xcode is a well-known slow-down. What's more, I sometimes find myself too dependent on cocoa Touch's auto-complete function, which is a combination of angels and demons!

So I started looking for an alternative process to implement the functionality I needed through the command line. The result is quite confusing: there are some articles that suggest using Xctool and xcodebuild to build Xcode target applications, and then use Ios-sim,simctrl and instruments to manage and run the emulator, but most of this information is old-fashioned and fragmented.

Thankfully, I ended up Dickens these trivial pieces of information together for my own purposes. That is, if you now have an iOS project built through Xcode 6, I want to do the following:

    1. Build target Apps
    2. Launch an iOS simulator
    3. Install the app on top of the simulator above
    4. Run the installed app
    5. Remove the app from the emulator

So I want to do all of these things through the command line, that is, to get Xcode to shut down the situation to complete the work.

Before we go any further, you need to gather some basic information about the following:

    1. The scheme you have chosen to build through Xcode (e.g. "Awesomeapp")
    2. Your app package ID (e.g. "Com.awesome.app")
    3. The name of the emulator that has been created (such as "IPhone6 Plus"). If you do not want to get this information from the Xcode GUI, you can collect it by looking at the command xcrun SIMTL list output.

You ready? Then let's get started!

(Note the following commands need to be run under your project folder)

Architecture Target Application:

xcodebuild -scheme AwesomeApp -destination ‘platform=iphonesimulator,name=iPhone 6 Plus‘ -derivedDataPath build

To start the Run emulator:

xcrun instruments -w ‘iPhone 6 Plus‘

Install the app package (you will, of course, need to run this command after you have built the target app and started the completion simulator with the above command)

xcrun simctl install booted build/Build/Products/Debug-iphonesimulator/AwesomeApp.app

Launch an already installed app in the emulator (after the app has been installed with the command above)

xcrun simctl launch booted com.awesome.app

Remove the installation package:

xcrun simctl Uninstall booted Com.awesome.app  

If you need to build a fairly complex project, you actually need to specify a number of parameters for the build command. Read the RTFMS fucking Manuals: Read the damn user manual! )。 If you are a slacker like me, please do these steps automatically by writing some scripts.


-----------Finish------------------

English Original: http://dduan.net/post/2015/02/build-and-run-ios-apps-in-commmand-line/

Reproduced please respect the original/translation

Public number

CSDN

Heaven Zhuhai Branch Rudder

Service Number: Techgogogo

Http://blog.csdn.net/zhubaitian

Excellent Resource recommendation

Address

Comments

Doctorq Blog

Http://testerhome.com/doctorq/topics

Pioneers in the field of Android automation, technology sharing,

Still waiting for the long iOS build process? Try to build and run the iOS app quickly by using the command line

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.