Unity Xcode 命令行构建

清理工程

xcodebuild clean -project {xcode_project}/Unity-iPhone.xcodeproj -alltargets


构建工程

xcodebuild archive -project {xcode_project}/Unity-iPhone.xcodeproj -scheme 'Unity-iPhone' -configuration '{build_type}' -archivePath {archive_path} CODE_SIGN_IDENTITY='{CODE_SIGN_IDENTITY}' PROVISIONING_PROFILE{APP}='{PROVISIONING_PROFILE}' DEVELOPMENT_TEAM='{DEVELOPMENT_TEAM}' PRODUCT_BUNDLE_IDENTIFIER={bundle_identifier} CODE_SIGN_STYLE='Manual'


导出包

xcodebuild -exportArchive -archivePath {archive_path} -exportPath {export_path} -exportOptionsPlist {export_Options_plist}


参数:

工程路径 构建类型 存档路径 证书标题 证书UUID 证书名称 导出路径 导出选项
string string string string string string string string
xcode_project build_type archive_path CODE_SIGN_IDENTITY PROVISIONING_PROFILE PROVISIONING_PROFILE_SPECIFIER export_path export_Options_plist

CODE_SIGN_IDENTITY: 证书标题
PROVISIONING_PROFILE: 证书的UUID security cms -D -i 签名文件
PROVISIONING_PROFILE_SPECIFIER: 证书名称



如果因为需要设置new building system而失败,请参考
Unity 在使用xcodebuild构建ipa时,因为需要设置new building system而失败


  • Unity2019使用xcodebuild构建出现的问题
    Step 1 : 需要将UnityFramework中的Info.plist中的 CFBundleIdentifier 设置为 $(PRODUCT_BUNDLE_IDENTIFIER_XXX) 只要不等于 $(PRODUCT_BUNDLE_IDENTIFIER)
    Step 2 : 将命令行中 PROVISIONING_PROFILE[_APP] 使用_APP来指定Unity-iPhone
    [Unity2017中]
    Step 1 不需要管
    Step 2 : 不需要加 _APP
  • 在M1、M2芯片下,使用Xcodebuild Archive出现错误
    错误信息: Provisioning profile "XXX" doesn't include the currently selected device "X'Mac"
    解决方法: 在Archive命令中追加 -destination 'generic/platform=iOS'

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容