一、HomeBrew相關:
先對HomeBrew做一個簡單的介紹吧,之前了解的也不多。
主要就是用於安裝Unix的工具包。
注意:HomeBrew依賴於Xcode的 Command Line Tool.
官方的鏈接:
http://mxcl.github.io/homebrew/
Homebrew作為OS X上強大的包管理器,為系統軟件提供了非常方便的安裝方式,獨特式的解決了包的依賴問題,並不再需要煩人的sudo,一鍵式編譯,無參數困擾,真的,你值得擁有。
安裝
Homebrew依賴於XCode,首先需要安裝,lion后XCode也是免費的了,直接到App store下載。同時Homebrew也依賴ruby,Mac已經自帶ruby。
1
|
|
使用
- 查看brew的幫助
1
|
|
- 安裝軟件
1
|
|
- 卸載軟件
1
|
|
- 搜索軟件
1
|
|
- 顯示已經安裝軟件列表
1
|
|
- 更新軟件,把所有的Formula目錄更新,並且會對本機已經安裝並有更新的軟件用*標明。
1
|
|
- 更新某具體軟件
1
|
|
- 查看軟件信息
1
|
|
- 刪除程序,和upgrade一樣,單個軟件刪除和所有程序老版刪除。
1 2 |
|
- 查看那些已安裝的程序需要更新
1
|
|
程序安裝路徑及文件夾
Homebrew將本地的/usr/local初始化為git的工作樹,並將目錄所有者變更為當前所操作的用戶,以后的操作將不需要sudo。
1 2 3 4 5 6 |
|
HomeBrew與MacPorts的比較,貌似MacPorts會被人逐漸遺棄
http://hi.hiing.net/2011/06/use-homebrew-package-management.html
二、XCTool相關
xctool是facebook開源的一個命令行工具,用來替代蘋果的xcodebuild工具。
功能如下:
- 像xcode一樣跑測試用例
- 結構化輸出編譯測試結果
- 彩色且方便閱讀的編譯內容輸出
示例截圖:

如何安裝xctool
最簡單的辦法是通過homebrew安裝xctool
brew update brew install xctool
搞定
如何使用xctool
打包
path/to/xctool.sh \ -workspace YourWorkspace.xcworkspace \ -scheme YourScheme \ archive
build
path/to/xctool.sh \ -workspace YourWorkspace.xcworkspace \ -scheme YourScheme \ build
測試
path/to/xctool.sh \ -workspace YourWorkspace.xcworkspace \ -scheme YourScheme \ test
使用命令如下,上面的命令參照
切換到工程目錄下,然后輸入如下命令:
xctool -workspace taoappios.xcworkspace -scheme taoappios archive
生成archive文件
xctool -workspace taoappios.xcworkspace -scheme taoappios build
編譯
usage: xctool [BASE OPTIONS] [ACTION [ACTION ARGUMENTS]] ...
Examples:
xctool [BASE OPTIONS] clean
xctool [BASE OPTIONS] build
xctool [BASE OPTIONS] build-tests [-only TARGET] [-skip-deps]
xctool [BASE OPTIONS] run-tests [-test-sdk SDK] [-only SPEC] [-freshSimulator] [-freshInstall]
xctool [BASE OPTIONS] test [-test-sdk SDK] [-only SPEC] [-skip-deps] [-freshSimulator] [-freshInstall]
xctool [BASE OPTIONS] archive
Base Options:
-help show help
-workspace PATH path to workspace
-project PATH path to project
-scheme NAME scheme to use for building or testing
-find-target TARGET Search for the workspace/project/scheme to build the target
-find-target-path PATH Path to search for -find-target.
-find-target-exclude-pathColon-separated list of paths to exclude for -find-target.
-sdk VERSION sdk to use for building (e.g. 6.0, 6.1)
-configuration NAME configuration to use (e.g. Debug, Release)
-jobs NUMBER number of concurrent build operations to run
-arch ARCH arch to build for (e.g. i386, armv7)
-toolchain PATH path to toolchain
-xcconfig PATH path to an xcconfig
-reporter TYPE[:FILE] add reporter
-showBuildSettings display a list of build settings and values
-version print version and exit
SETTING=VALUE Set the build 'setting' to 'value'
Options for 'build-tests' action:
-only TARGET build only a specific test TARGET
-skip-deps Only build the target, not its dependencies
Options for 'run-tests' action:
-test-sdk SDK SDK to test with
-only SPEC SPEC is TARGET[:Class/case[,Class2/case2]]
-freshSimulator Start fresh simulator for each application test target
-freshInstall Use clean install of TEST_HOST for every app test run
Options for 'test' action:
-test-sdk SDK SDK to test with
-only SPEC SPEC is TARGET[:Class/case[,Class2/case2]]
-skip-deps Only build the target, not its dependencies
-freshSimulator Start fresh simulator for each application test target
-freshInstall Use clean install of TEST_HOST for every app test run
