iOS的shell脚本出ipa以及遇见的问题

脚本地址

大家首先下载脚本地址:
脚本地址

里面蒲公英地址对应的key、都需要修改自己的

使用

  • 先配置DevelopmentExportOptionsPlist文件中的信息(解包方法,标识符及对应的描述文件名称)
  • 将xcodebuild.sh中appName置换为项目工程名
  • 将文件放置于项目文件中和.xcodeproj平级
    在终端中进入
    .xcodeproj上级目录
    输入./xcodebuild.sh即可自动打包、如无执行权限则先执行hmod +x xcodebuild.sh

脚本运行授权

切回 脚本制定目录下(比如我的脚本在桌面)
bogon:~ gaoguangxiao$ cd /Users/gaoguangxiao/Desktop

运行脚本
bogon:Desktop gaoguangxiao$ ./Test.sh

授权否定的意思,需要解除授权,运行下面步骤解出授权
./Test.sh: Permission denied

解除授权 chmod a+x Test.sh
bogon:Desktop gaoguangxiao$ chmod a+x Test.sh

重新运行脚本

参考文档

问题

M1/M2芯片执行脚本报错

 "Provisioning profile "iOS Team Provisioning Profile" doesn't include the currently selected device "xxx's MacBook Pro"

"Provisioning profile "iOS Team Provisioning Profile" doesn't include the currently selected device "Mac Mini" 

解决方法

xcodebuild \
archive -workspace ${project_name}.xcworkspace \
-scheme ${scheme_name} \
-destination 'generic/platform=iOS' \
-configuration ${development_mode} \
-archivePath build/${project_name}.xcarchive -quiet  || exit

重点是这句话

-destination 'generic/platform=iOS'

xcode-select: error

这个错误是Xcode路径错误

Error: xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance

使用以下命令把xcode的路径修改为安装的位置

sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer

exportArchive: ipatool failed

error: exportArchive: ipatool failed

AppThinning.StubError(errorDescription: Optional("ipatool failed"))

解决方法

修改exportOptions文件中compileBitcode为NO,即可

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

推荐阅读更多精彩内容