Fastlane - ios端打包

首先在ios端打包之前,关于开发者账号,测试设备以及证书描述文件不多介绍,这是ios开发人员必须掌握的能力之一,本篇是在掌握以上能力之后的关于Fastlane在ios端打包的实现方案

1.配置环境

2.打包操作

1.在终端打开你的iOS项目文件.xcodeproj所在的文件夹


进入项目初始化.png

2.执行初始化命令

fastlane init

3.选择打包方式


打包方式.png

4.按照命令行输入,项目的同级目录下会生成fastlane文件夹


fastlane文件.png

5.编辑fastlane内部的两个文件,需要用终端去编辑,否则会出现以下错误
09:24:50]: Your Fastfile has had smart quotes sanitised. To avoid issues in the future, you should not use TextEdit for editing it. If you are not using TextEdit, you should turn off smart quotes in your editor of choice.

[!] Syntax error in your Fastfile on line 17: Fastfile:17: syntax error, unexpected tIDENTIFIER, expecting keyword_end
Fastfile:25: syntax error, unexpected end-of-input, expecting keyword_end

5.1Appfile文件

# app_identifier(“***BundleID***") # The bundle identifier of your app,也就是BundleID
# apple_id(“***AppID***") # Your Apple email address,就是你的AppID,苹果开发者账号
# For more information about the Appfile, see:
# [<u>https://docs.fastlane.tools/advanced/#appfile</u>](https://docs.fastlane.tools/advanced/#appfile)

5.2 Fastfile文件

# This file contains the fastlane.tools configuration

# You can find the documentation at https://docs.fastlane.tools

#

# For a list of all available actions, check out

#

#     https://docs.fastlane.tools/actions

#

# Uncomment the line if you want fastlane to automatically update itself

# update_fastlane

default_platform(:ios)

platform :ios do #打包平台

  desc "Description of what the lane does” #打包描述

  lane :test do #打包方法

    # add actions here: [https://docs.fastlane.tools/actions](https://docs.fastlane.tools/actions)

      gym(

    scheme: "", #项目名称

    export_method:"development",#打包输出种类

    output_directory: "", # 打包后的 ipa 文件存放的目录

    output_name: ""  # ipa文件名

    )

  end

end

补充关于export_method方法

app-store,   #AppStore正式生产环境包
ad-hoc,  #生产测试包
enterprise,  #企业包(299美刀账号)
development  #开发测试包

6.执行脚本打包

fastlane test

7.打包成功如下

打包到本地成功.jpg

打包过程
脚本打包.gif

部分测试平台支持fastlane打包
蒲公英使用fastlane打包

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

推荐阅读更多精彩内容

  • 什么是Fastlane? 官方自己的定义是这样的: fastlane is a tool for iOS, Mac...
    会武功的蚊子阅读 7,570评论 5 15
  • 前言:一直有听过脚本一键打包审核,但是自己一直没在意。在微信公众号看到ios一键打包的文章,突然想想自己每次从打包...
    光彩影阅读 5,640评论 1 42
  • 毋庸置疑,Jenkins对我们打包的帮助还是很大的——被测试的同学追着要IPA包的日子终于一去不复返了。但作为追求...
    iOS逆向开发阅读 1,611评论 2 10
  • 这是一个价值被严重低估的币 2017-12-01 馒头 买币以后 有这样一个币, 它是一个天才所创造, 它有石墨烯...
    许中阳阅读 916评论 0 3
  • 忘记具体是哪一天开始跑步,只记得刚开始是为了锻炼身体而逼迫自己迈出跑步的第一步。经过一段时间的坚持后,跑步成了习惯...
    言午许许阅读 327评论 0 0