iOS 自动化打包发布(Fastlane+ Jenkins+蒲公英)
安装 Xcode 命令行工具:xcode-select --install
安装 fastlane:sudo gem install fastlane --verbose
安装成功后查看版本:fastlane --version
配置 fastlane:
终端进入工程主目录:
输入:fastlane init

出现:What would you like to use fastlane for? 选项时,选择 3,输入苹果开发者账号和密码。
下面的步骤根据提示输入回车,完成后,fastlane 文件中会多出两个配置文件 Appfile 和 Fastfile

Appfile 中:
# app_identifier("[[APP_IDENTIFIER]]") # The bundle identifier of your app
# apple_id("[[APPLE_ID]]") # Your Apple email address
# For more information about the Appfile, see:
# https://docs.fastlane.tools/advanced/#appfile
替换对应的 bundle identifier 和 开发者账号。
Fastfle 配置:
# 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
#
# For a list of all available plugins, check out
#
# https://docs.fastlane.tools/plugins/available-plugins
# # Uncomment the line if you want fastlane to automatically update itself
# update_fastlane # 定义fastlane版本号
fastlane_version “2.116.” # 定义打包平台
default_platform(:ios) def updateProjectBuildNumber currentTime = Time.new.strftime("%Y%m%d")
build = get_build_number()
if build.include?"#{currentTime}."
# => 为当天版本 计算迭代版本号
lastStr = build[build.length-..build.length-]
lastNum = lastStr.to_i
lastNum = lastNum +
lastStr = lastNum.to_s
if lastNum <
lastStr = lastStr.insert(,"")
end
build = "#{currentTime}.#{lastStr}"
else
# => 非当天版本 build 号重置
build = "#{currentTime}.01"
end
puts("*************| 更新build #{build} |*************") # => 更改项目 build 号
increment_build_number(
build_number: "#{build}"
)
end #指定项目的scheme名称
scheme=“修改成你的工程scheme名称” #蒲公英api_key和user_key
api_key=“修改成蒲公英管理后台中应用的 API Key”
user_key=“修改成蒲公英管理平台中应用的 User Key” platform :ios do
lane :development_build do|options|
branch = options[:branch] puts “开始打development ipa” updateProjectBuildNumber #更改项目build号 # 开始打包
gym(
#输出的ipa名称
output_name:”#{scheme}_#{get_build_number()}”, # 是否清空以前的编译信息 true:是
clean:true, # 指定打包方式,Release 或者 Debug
configuration:"Debug", # 指定打包所使用的输出方式,目前支持app-store, package, ad-hoc, enterprise, development
export_method:"development", # 指定输出文件夹
output_directory:"./fastlane/build",
) puts "开始上传蒲公英"
# 开始上传蒲公英
pgyer(api_key: “#{api_key}”, user_key: “#{user_key}”)
end
end
安装蒲公英插件:fastlane add_plugin pgyer (⚠️进入到工程目录中执行安装蒲公英插件命令)

选择 y

输入电脑密码,安装成功,出现:Successfully installed plugins。
开始打包:fastlane development_build

进入蒲公英后台就可以查看到最新版本更新了。

遇到的坑:
1、Could not find action, lane or variable 'pgyer'. Check out the documentation for more details: https://docs.fastlane.tools/actions
找不到蒲公英插件,原来是安装目录错了,应该在工程目录下安装:fastlane add_plugin pgyer
2、xcodebuild -showBuildSettings timed out after 4 retries with a base timeout of 3. You can override the base timeout value with the environment variable FASTLANE_XCODEBUILD_SETTINGS_TIMEOUT, and the number of retries with the environment variable FASTLANE_XCODEBUILD_SETTINGS_RETRIES
重试打包命令或修改编译时长。
3、[!] Exit status of command 'cd /*** && agvtool what-version -terse' was 6 instead of 0. (FastlaneCore::Interface::FastlaneShellError)
Fastfile 中配置的 Build 自增,需要在 Xcode ->build setting -> version -> current 中配置如下:

iOS 自动化打包发布(Fastlane+ Jenkins+蒲公英)的更多相关文章
- iOS自动化打包发布(fastlane)
一.FastLane介绍 1.1 FastLane是什么? FastLane是一种配置iOS和Android自动化Beta部署和发布的最简单的方法之一.它可以简化一些乏味.单调.重复的工作,像截图.代 ...
- Mac Jenkins+fastlane 简单几步实现iOS自动化打包发布 + jenkins节点设置
最近在使用jenkins 实现ios自动化打包发布蒲公英过程实践遇到了一些坑,特意记录下来方便有需要的人. 进入正题: 一.安装Jenkins 1.Mac上安装Jenkins 遇到到坑 因为 Jenk ...
- Jenkins+ Xcode+ 蒲公英 实现IOS自动化打包和分发
Jenkins+ Xcode+ 蒲公英 实现IOS自动化打包和分发 直接入正题: Screen Shot 2015-09-18 at 16.56.20.png Mac上安装Jekins jekins下 ...
- 【2】IOS APP打包发布
目的: 本文的目的是对IOS APP打包发布做了对应的介绍,大家可根据文档步骤进行mac环境部署: 申请苹果开发者账号 此处略 创建申请证书 这样做的目的就是为你的电脑安装发布许可证,只有这样你的电脑 ...
- IOS自动化打包介绍
IOS自动化打包介绍 标签: app打包 , Ios打包 , iphone打包 , iphone自动化打渠道包 分类:无线客户端技术, 贴吧技术 摘要 随着苹果手持设备用户的不断增加,ios应 ...
- iOS自动化打包上传的踩坑记
http://www.cocoachina.com/ios/20160624/16811.html 很久以前就看了很多关于iOS自动打包ipa的文章, 看着感觉很简单, 但是因为一直没有AppleDe ...
- iOS自动化打包 Jenkins+Gitlab+Fastlane+蒲公英+钉钉
前言 这两天花时间整理一下自动化打包的整套流程,现在iOS端的整套流程是没有问题了,这个过程中踩得坑也的确是特别多,所以这周末把整个流程整理一下,总结出来这篇文章,希望能对有需要的小伙伴有点点帮助. ...
- iOS 自动化打包
理想的情况:不打开工程的情况下,直接双击就能打包出一个IPA文件,这样就可以让测试直接使用 itools 进行安装. 分如下两种情况: 1)不依赖cocoapod 管理项目的自动化. 如果没有一个简 ...
- iOS企业版打包 发布在线安装包 plist
本文转载至 http://blog.csdn.net/u011452278/article/details/49511385 原文转载:http://blog.csdn.net/pang040328/ ...
随机推荐
- C++ socket编程-转载
转自:https://www.cnblogs.com/L-hq815/archive/2012/07/09/2583043.html 若有违规请联系我删除. 介绍 Socket编程让你沮丧吗?从man ...
- C++-POJ2955-Brackets[DP]
题意就是,找出最长合法子括号序列 容易想到设f[l][r]为l~r的最长合法子括号序列的长度 然后从短的状态往长的状态枚举,不断更新答案就可以了 //#include<bits/stdc++.h ...
- C语言预处理学习记录
#include<stdio.h> #define LOCAL //无参宏 //条件编译 #ifdef LOCAL int a=1; #else int a=2; #endif #ifnd ...
- [LOJ113] 最大异或和 - 线性基
虽然是SB模板但还真是第一次手工(然而居然又被运算符优先级调戏了) #include <bits/stdc++.h> using namespace std; #define int lo ...
- Allegro 反射仿真--IBIS模型转化
一.IBIS模型的获取 a) 直接找芯片供应商 b) 从网上下载 i.到Google网站直接搜索某个型号的IBIS模型: ii. 到器件厂商的官方网站下载: iii.从专门提供IBIS模型的网站搜索下 ...
- js - 子节点
子节点数量:this.wdlgLossInfo.childNodes.length
- mysql数据库事务的操作与理解
--------------------事务----------------------------------------------查询mysql事务隔离级别1.查看当前会话隔离级别select ...
- Python3标准库:string通用字符串操作
1. string:通用字符串操作 string模块在很早的Python版本中就有了.以前这个模块中提供的很多函数已经移植为str对象的方法,不过这个模块仍保留了很多有用的常量和类来处理str对象. ...
- JS高级---函数作为参数使用
函数作为参数使用 var arr = [1, 100, 20, 200, 40, 50, 120, 10]; //排序 arr.sort(); console.log(arr); 排序---函数作为参 ...
- Java上传图片到Ftp,包含上传后文件大小为0的问题和Properties配置文件的读取
准备工作:需要使用coomos-net jar包.下载地址 一. 上传图片到FTP,文件大小为0的问题,解决:将ftp模式修改为Passive模式就可以了. //将ftp模式修改为Passive模式 ...