美文网首页
Unity Xcode 命令行构建

Unity Xcode 命令行构建

作者: CERI_CHANNEL | 来源:发表于2022-07-12 09:32 被阅读0次

清理工程

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'

相关文章

网友评论

      本文标题:Unity Xcode 命令行构建

      本文链接:https://www.haomeiwen.com/subject/pdvzbrtx.html