來自非死book的iOS項目構建工具:xctool
xctool 用以替換蘋果公司的 xcodebuild 工具來簡化 iOS 和 Mac 項目的構建和測試。要使用該工具必須安裝 Xcode 命令行工具:From Xcode, install via Xcode → Preferences → Downloads.
-
Runs the same tests as Xcode.app.
Surprisingly, Apple's command-line xcodebuild tool does not run your product's tests the same way as Xcode.app. xcodebuild doesn't understand which targets in your scheme are test targets, which test suites or cases you might have disabled in your scheme, or how to run simulator-based, application tests.
If you use application tests, you've probably seen xcodebuild skipping them with this message:
Skipping tests; the iPhoneSimulator platform does not currently support application-hosted tests (TEST_HOST set).
xctool fixes this - it looks at your Xcode scheme and is able to reproduce the same test run you would get with Xcode.app via Cmd-U or Product → Test, including running application tests that require the iOS simulator.
-
Structured output of build and test results.
xctool captures all build events and test results as structured JSON objects. If you're building a continuous integration system, this means you don't have to regex parse xcodebuild output anymore.
Try one of the Reporters to customize the output or get the full event stream with the
-reporter json-stream
option. -
Human-friendly, ANSI-colored output.
xcodebuild is incredibly verbose, printing the full compile command and output for every source file. By default, xctool is only verbose if something goes wrong, making it much easier to identify where the problems are.
Example:
-
Faster, parallelized test runs.
xctool can optionally run all of your test bundles in parallel, speeding up your test runs significantly. At 非死book, we've seen 2x and 3x speed ups by parallelizing our runs.
Use the
-parallelize
option with run-tests or test to enable. See Parallelizing Test Runs for more info.