天天看點

xcodebuild打包總結

[size=medium][size=large][size=medium][size=small]xcodebuild

--help

-version

-showsdks

-list 工程目錄下

// clean工程

xcodebuild clean

//

-configuration Debug/Release

-workspace SoYoungMobile40.xcworkspace

-project SoYoungMobile40.xcodeproj

-scheme SoYoungMobile40

//

-sdk iphoneos10.0

總結:

自動簽名隻能在Xcode中使用,使用CI打包工具需要使用手動來配置。

# 編譯、生成xcarchive檔案 (這條指令适用于automatic簽名)

xcodebuild clean archive -archivePath build/SoYoungMobile40.xcarchive -workspace SoYoungMobile40.xcworkspace -scheme SoYoungMobile40 -configuration Release DEVELOPMENT_TEAM_Production=UTKJ82F75E

# 把編譯、生成xcarchive檔案生成ipa包

xcodebuild -exportArchive -exportFormat IPA -archivePath build/SoYoungMobile40.xcarchive -exportPath build/SoYoungMobile40.ipa

========

# 安裝select_xcode_signing_method腳本 用來切換automatic和manual簽名方式

# https://gist.github.com/thelvis4/253a2cdea8360da519b2a025c5d8fbac

gem install xcodeproj # 需要先安裝工具

ruby select_xcode_signing_method.rb -p . -t SoYoungMobile40 -m 'Manual'

# 可用 Debug

xcodebuild clean archive -archivePath build/SoYoungMobile40.xcarchive -workspace SoYoungMobile40.xcworkspace -scheme SoYoungMobile40 -configuration Debug PROVISIONING_PROFILE_SPECIFIER='soyoungapp' CODE_SIGN_IDENTITY='iPhone Developer'

# 可用 Distribution

xcodebuild clean archive -archivePath build/SoYoungMobile40.xcarchive -workspace SoYoungMobile40.xcworkspace -scheme SoYoungMobile40 -configuration Release PROVISIONING_PROFILE_SPECIFIER='qd_dis' CODE_SIGN_IDENTITY='iPhone Distribution'

#可用 adhoc

xcodebuild clean archive -archivePath build/SoYoungMobile40.xcarchive -workspace SoYoungMobile40.xcworkspace -scheme SoYoungMobile40 -configuration Release PROVISIONING_PROFILE_SPECIFIER='qd_adhoc1' CODE_SIGN_IDENTITY='iPhone Distribution'

# 生成ipa包

xcodebuild -exportArchive -exportFormat IPA -archivePath build/SoYoungMobile40.xcarchive -exportPath build/SoYoungMobile40.ipa

參考:

http://stackoverflow.com/questions/39500634/use-xcodebuild-xcode-8-and-automatic-signing-in-ci-travis-jenkins-environmen

https://pewpewthespells.com/blog/migrating_code_signing.html#signing-methods-xcode-8

http://blog.csdn.net/sqq521/article/details/46830201[/size][/size][/size][/size]