xcodebuild常用命令

1、man xcodebuild

示例:
man xcodebuild
说明:
查看xcodebuild 命令手册,里面有详细的命令示例Demo

2、xcodebuild -exportArchive

示例:
xcodebuild -exportArchive -archivePath MyMobileApp.xcarchive -exportPath ExportDestination -exportOptionsPlist 'export.plist'
说明:
Exports the archive MyMobileApp.xcarchive to the path ExportDestination using the options specified in export.plist.

3、xcodebuild clean

示例:
xcodebuild clean install
说明:
Cleans the build directory; then builds and installs the first target in the Xcode project in the directory from which xcodebuild was started.

4、xcodebuild archive

示例:
xcodebuild archive -workspace MyWorkspace.xcworkspace -scheme MyScheme
说明:
Archives the scheme MyScheme in the Xcode workspace MyWorkspace.xcworkspace.

5、xcodebuild -scheme xxx -workspace xxx.xcworkspace build

示例:
xcodebuild -scheme IOSMapSDKTest -workspace IOSMapSDKTest.xcworkspace build
说明:
工程xxx.xcworkspace编译

6、xcodebuild test

示例:
xcodebuild test -workspace MyWorkspace.xcworkspace -scheme MyScheme -destination 'platform=macOS,arch=x86_64'
说明:
Tests the scheme MyScheme in the Xcode workspace MyWorkspace.xcworkspace using the destination described as My Mac 64-bit in Xcode.

具体示例:
echo "Automating Testing:command line testing"
xcodebuild test -workspace IOSMapSDKTest.xcworkspace -scheme IOSMapSDKTest -destination 'platform=iOS Simulator,name=iPhone 11'
解释说明:
Automating Testing:command line testing of tests in xxx.xcworkspace 工程

7、ruby unitTestInfo.rb --xcresult-path=xxx.xcresult --output-file=xxx.txt

示例:
ruby ./UnitTestParser-master/unitTestInfo.rb --xcresult-path=result.xcresult --output-file=result.txt
说明:
解析result.xcresult格式文件,输出result.txt格式文件(github地址:https://github.com/JerryChu/UnitTestParser)

你可能感兴趣的:(xcodebuild常用命令)