美文网首页
iOS使用fastlane自动化打包

iOS使用fastlane自动化打包

作者: 十二栗子 | 来源:发表于2019-04-03 11:33 被阅读0次

        这两天工作安排比较松,想着做点什么,翻看到一篇文章说自动化打包的,初试了fastlane一下,果然好用,于是记录下来。

1、首先确认是否安装了ruby,终端查看下ruby版本

ruby -v

2、确认是否安装了Xcode命令行工具

xcode-select --install  或者 brew cask install fastlane

已经安装

3.命令安装

sudo gem install fastlane -NV

报错了

那么需要更换源

查看源:   gem sources

删除源:   gem sources --remove https://gems.ruby-china.org/ 

更换源:   gem sources -a https://gems.ruby-china.com

继续执行  sudo gem install fastlane -NV,如果如下

安装成功

4.使用

cd到项目目录 fastlane init

输入4 一路回车,成功

如果出现下面的图,在操作一遍

bundle update卡着不动了

结束进程ctrl +c;

删除项目下的fastlane文件夹;

使用gem cleanup清理一下;

重新cd到项目下执行fastlane init。

5.配置

我们项目下fastlane 有两个文件Appfile和Fastfile

Appfile文件

app_identifier用于指定APP的bundle id,apple_id指的是你的AppleID

Fastfile文件

lane :custom_lane do中的custom_lane是函数的名称,打包执行命令的时候使用。

# add actions here: https://docs.fastlane.tools/actions 这块就是让我们加具体执行的插件、命令等操作用于打包。

简单打包用于测试,可打包成ad-hoc 或者development

示例配置

6.执行打包命令

cd到项目目录,fastlane NonTeacher

7.上传到蒲公英

cd到项目下, 安装pgyer插件 执行命令

fastlane add_plugin pgyer

蒲公英安装成功

重新编写项目目录下的Fastfile文件,如下:

cd 到项目下,执行命令fastlane NonTeacher 

打包上传成功

因为只频繁用到了打包上传到蒲公英,所以只了解了以上信息,深入请参考下面楼主,感谢分享!

参考:https://www.jianshu.com/p/c09097211cd4

参考:https://mp.weixin.qq.com/s/mRLfF8T8JoIFbr5TiJDzpw

相关文章

网友评论

      本文标题:iOS使用fastlane自动化打包

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