美文网首页
Flutter 项目自动打包脚本

Flutter 项目自动打包脚本

作者: smallestt | 来源:发表于2023-09-05 15:47 被阅读0次

1 安装 brew

网址:brew.sh 命令粘贴:

/bin/zsh -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)"

2 brew install go 下载1.13.1 版本

环境配置

#go vim .zshrc
export GOROOT=/usr/local/Cellar/go/1.13.1/libexec
export GOPATH=/usr/local/Cellar/go/1.13.1
export GOBIN=GOPATH/bin export PATH=PATH:GOROOT/bin:GOBIN

添加完 source .zshrc 。 无论 在zshrc 还是 bash_profile 都一样, 怎么设置go 的环境变量也可以自己搜索。最后在终端输入

go version
go version go1.13.1 darwin/amd64

3 copy package.go,到项目根目录

4 copy DevelopmentExportOptionsPlist.plist 到iOS目录下

5 当前目录下执行 打包命令 go run package.go

企业微信20230906-154521.png

细节:脚本增加了通过 debug 和 release 动态修改
Constants
static const bool DEBUG = false; // 是否开启debug模式
实现了真正的debug 和 release

6 打包完成后在 /Users/用户/Downloads/Runner-IPA

企业微信截图_29eb8ad0-ca46-4292-8812-e42e99f1242b.png

相关文章

网友评论

      本文标题:Flutter 项目自动打包脚本

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