1、查看xcode的版本和build版本
xcodebuild -version
输出:
Xcode 7.2.1
Build version 7C1002
2、查看系统的sdk以及版本
xcodebuild -showsdks
输出:
OS X SDKs:
OS X 10.11 -sdk macosx10.11
iOS SDKs:
iOS 9.2 -sdk iphoneos9.2
iOS Simulator SDKs:
Simulator - iOS 9.2 -sdk iphonesimulator9.2
tvOS SDKs:
tvOS 9.1 -sdk appletvos9.1
tvOS Simulator SDKs:
Simulator - tvOS 9.1 -sdk appletvsimulator9.1
watchOS SDKs:
watchOS 2.1 -sdk watchos2.1
watchOS Simulator SDKs:
Simulator - watchOS 2.1 -sdk watchsimulator2.1
3.显示工程项目信息
xcodebuild -list
输出:
Information about project "kuaixiao":
Targets:
kuaixiao
kuaixiaoTests
Build Configurations:
Debug
Release
If no build configuration is specified and -scheme is not passed then "Debug" is used.
Schemes:
kuaixiao
2)默认是Release工程,要设置成Debug模式如下:
$ xcodebuild -sdk iphonesimulator5.0 -configuration Debug
3)clean创建的工程
$ xcodebuild clean -sdk iphonesimulator5.0 -configuration Debug
第一步清理:
/usr/bin/xcodebuild -target targetName clean
第二步编译:
/usr/bin/xcodebuild -target targetName build
第三步打包:
/usr/bin/xcrun -sdk iphoneos PackageApplication -v path/To/xxx.app -o xxx.ipa
应用签名打包
xcodebuild -target targetName CODE_SIGN_IDENTITY="iPhone Distribution:XXXXXX"
xcrun -sdk iphoneos PackageApplication -v 源app路径 -o 输出的ipa路径 --sign "iPhone Distribution:XXXXXX"
xcodebuild -version
输出:
Xcode 7.2.1
Build version 7C1002
2、查看系统的sdk以及版本
xcodebuild -showsdks
输出:
OS X SDKs:
OS X 10.11 -sdk macosx10.11
iOS SDKs:
iOS 9.2 -sdk iphoneos9.2
iOS Simulator SDKs:
Simulator - iOS 9.2 -sdk iphonesimulator9.2
tvOS SDKs:
tvOS 9.1 -sdk appletvos9.1
tvOS Simulator SDKs:
Simulator - tvOS 9.1 -sdk appletvsimulator9.1
watchOS SDKs:
watchOS 2.1 -sdk watchos2.1
watchOS Simulator SDKs:
Simulator - watchOS 2.1 -sdk watchsimulator2.1
3.显示工程项目信息
xcodebuild -list
输出:
Information about project "kuaixiao":
Targets:
kuaixiao
kuaixiaoTests
Build Configurations:
Debug
Release
If no build configuration is specified and -scheme is not passed then "Debug" is used.
Schemes:
kuaixiao
2)默认是Release工程,要设置成Debug模式如下:
$ xcodebuild -sdk iphonesimulator5.0 -configuration Debug
3)clean创建的工程
$ xcodebuild clean -sdk iphonesimulator5.0 -configuration Debug
第一步清理:
/usr/bin/xcodebuild -target targetName clean
第二步编译:
/usr/bin/xcodebuild -target targetName build
第三步打包:
/usr/bin/xcrun -sdk iphoneos PackageApplication -v path/To/xxx.app -o xxx.ipa
应用签名打包
xcodebuild -target targetName CODE_SIGN_IDENTITY="iPhone Distribution:XXXXXX"
xcrun -sdk iphoneos PackageApplication -v 源app路径 -o 输出的ipa路径 --sign "iPhone Distribution:XXXXXX"