美文网首页
iOS打包常用脚本

iOS打包常用脚本

作者: 领导的玩具 | 来源:发表于2020-03-17 10:12 被阅读0次

解锁Mac OS

password = "12345"

userName = "jimmy"

/usr/bin/security unlock-keychain -p $password  /Users/$userName/Library/Keychains/login.keychain


设置包名版本号

cd ${WORKSPACE}

buildPlist=${WORKSPACE}/Info.plist

bundleId="com.bundleid"

CFBundleVersion=0.0.0

/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $CFBundleVersion" $buildPlist

/usr/libexec/PlistBuddy -c "Set :CFBundleIdentifier $bundleId" $buildPlist


指定project clean

xcodebuild clean \

-project Unity-iPhone.xcodeproj \

-scheme Unity-iPhone \

-configuration Release


打Archive包

#指定证书,bundle id打包

xcodebuild -archivePath $location \

-project Unity-iPhone.xcodeproj \

-configuration Release \

-scheme Unity-iPhone \

archive \

-sdk iphoneos \

-arch arm64  \

PROVISIONING_PROFILE_SPECIFIER="your_provisiont_profile" \

PRODUCT_BUNDLE_IDENTIFIER="your.bundle.id" \

DEVELOPMENT_TEAM="AXXXXXX4"


No matching provisioning profiles found

明明证书在xcode上配置成功,xcodebuild的时候却显示无法找到证书:

error: No profile for team 'asdfasdfasdf' matching 'dev_com_sdf.mobileprovision' found: Xcode couldn't find any provisioning profiles matching 'asdfasdfasdf/dev_com_sdf.mobileprovision'. Install the profile (by dragging and dropping it onto Xcode's dock item) or select a different one in the Signing & Capabilities tab of the target editor. (in target 'ttt' from project 'ttt')

** ARCHIVE FAILED **

我的打包命令:

xcodebuild archive -project /Users/kingsoft/Desktop/ttt/ttt.xcodeproj \

-scheme ttt \

-configuration Debug \

-archivePath .\

CODE_SIGN_IDENTITY="iPhone Developer: xxx (xxx)" \

PROVISIONING_PROFILE_SPECIFIER=dev_com_sdf.mobileprovision. \

DEVELOPMENT_TEAM="asdfasdfasdf" \

PRODUCT_BUNDLE_IDENTIFIER="com.asdf.asdf"

解决方案是:

CODE_SIGN_IDENTITY不能放到自定义参数的第一位。

xcodebuild archive -project /Users/kingsoft/Desktop/ttt/ttt.xcodeproj \

-scheme ttt \

-configuration Debug \

-archivePath .\

PROVISIONING_PROFILE_SPECIFIER=dev_com_sdf.mobileprovision. \

DEVELOPMENT_TEAM="asdfasdfasdf" \

CODE_SIGN_IDENTITY="iPhone Developer: xxx (xxx)" \

PRODUCT_BUNDLE_IDENTIFIER="com.asdf.asdf"


UnityFramework 因为CodeSigned引起的问题:


因为在Unity 2019.3.x往后,Unity修改了打包策略,会在xcode导出的工程里面多出一个UnityFramework target,而且是auto signed,这样就会导致两个问题:

1.无法导出iPa

2.签名后的iPa有可能企业证书无法安装

解决方式,cd到Unity-iPhone.xcodeproj下

sed -i '' 's/CODE_SIGN_STYLE = Automatic;/ CODE_SIGN_STYLE = Manual;/' project.pbxproj

手动吧unityframework设为手动签名

打出ipa

xcodebuild -exportArchive \

-archivePath $your_archive_path \

-exportPath ./ \

-exportOptionsPlist $your_export_plsit.plist PROVISIONING_PROFILE=$your_profile

相关文章

  • iOS打包常用脚本

    解锁Mac OS password = "12345"userName = "jimmy"/usr/bin/sec...

  • Xcode自动打包

    [iOS]从零开始写个自动打包IPA脚本 【iOS打ipa包】:使用终端实现自动打包 iOS自动打包并发布脚本

  • iOS自动打包ipa(shell脚本)

    系列 iOS自动打包ipa(shell脚本)iOS自动打包ipa(Python脚本) 安装xctool shell...

  • iOS自动打包ipa(Python脚本)

    系列 iOS自动打包ipa(shell脚本)iOS自动打包ipa(Python脚本) 安装Python库 Pyth...

  • iOS脚本一键打包

    ios打包脚本的使用 相关链接: 1. IOS工程自动打包并发布脚本的实现。 2. Xcode中Command L...

  • pyinstaller的使用

    pyinstaller简介 pyinstaller是一个常用的python脚本打包工具,可以将python脚本打包...

  • 2019-02-15

    ios打包时签名失败 ios打包时证书和provisioningprofile都已经切换更新,打包脚本中指定tea...

  • iOS自动打包脚本

    iOS自动打包脚本 iOS自动打包脚本,并实现图片素材、文字资源、部分代码的替换和重签名,基于python实现。 ...

  • ios-面试-脚本打包原理

    脚本打包,自然是为了方便打包,便于ios开发不用手动打包,便于非ios开发能去打包! 打包过程 Xcode打包的过...

  • iOS面试题:脚本打包

    脚本打包,自然是为了方便打包,便于ios开发不用手动打包,便于非ios开发能去打包! 打包过程 Xcode打包的过...

网友评论

      本文标题:iOS打包常用脚本

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