Fastlane入门:安装篇

作者: RaInVis | 来源:发表于2016-09-26 09:28 被阅读5415次

一、安装前准备

我的开发环境:macbook pro OS X EI Capitan 版本 10.11.6 

使用fastlane所需要求:

1.OS X 10.9 (Mavericks) 以上

2.Ruby 2.0 以上

3.Xcode 7.3.1

4.拥有一个付费的苹果开发者账号(我的账号是加入开发组,并且给我开了管理员权限,未付费)

那么接下来将一步一步走进Fastlane的世界

二、配置环境

1.如果你没有Xcode,请先安装一个Xcode吧,O(∩_∩)O~

2.更新ruby版本,安装rvm

curl -L get.rvm.io | bash -s stable     # 安装

rvm -v         # 测试是否安装正常

rvm list known        # 列出已知ruby版本

rvm install ruby-xxxxx     #  安装一个最新ruby版本 注:此处xxxxx为list中的最新版本号

如果报错的话

brew install openssl 

reinstall|install ruby-xxxxx     #    注意修改xxxxxx

以上所需的ruby环境基本配置好了

2.打开终端,选择ruby 源

(rubygems、taobao这两个源不知道哪个能成功,所以都分别切换试一下,后文会提到)

#查看gem源

gem sources

# 删除默认的gem源

gem sources --remove https://rubygems.org/

# 增加taobao作为gem源

gem sources -a https://ruby.taobao.org/

# 查看当前的gem源

gem sources

*** CURRENT SOURCES ***

http://ruby.taobao.org

# 清空源缓存

gem sources -c

# 更新源缓存

gem sources -u

三、安装Fastlane

1.安装xcode-select

xcode-select --install

# 如果 Xcode CLT 已经安装,则会报如下错误

# command line tools are already installed, use "Software Update" to install updates.

# 如果未安装,终端会开始安装 CLT

2.安装fastlane

sudo gem install fastlane --verbose

#  如果报错:ERROR: While executing gem ... (Errno::EPERM) Operation not permitted - /usr/bin/commander 

sudo gem install -n /usr/local/bin fastlane 

# 等待着安装完毕....coffee or tea

# 安装结束后,查看版本(2016.9.26我的版本是1.104.0)

fastlane --version

# 实际上目前安装的fastlane并不是最新版本,还需要更新,怎么更新呢,看下面

# cd到项目文件夹

cd xxxxx

fastlane init

# 需要按照提示输入 AppID以及密码, 这个是你项目的开发者帐号,下边要输入项目的bundleIdentifier,然后出现了提示

########################################################################

# fastlane 1.104.0 is available. You are on 1.103.0.

# It is recommended to use the latest version.

# Update using 'sudo gem update fastlane'.

#######################################################################

# 更新最新版本

sudo gem install -n /usr/local/bin/ fastlane --version1.104.0

# 如果报错 Could not find a valid gem 'fastlane' (= 1.66.0) in any repository , 那么更换一个ruby源,详见步骤2

# 继续更新最新版本

sudo gem install -n /usr/local/bin/ fastlane --version1.104.0

# 1.104.0成功安装!

以上步骤为fastlane安装步骤,也遇到了不少的问题,可能你安装的时候也会遇到另外的问题,如果有疑问,请在下面留言,看到后,我会第一时间回复。相互讨论,看看有没有解决方案。

相关文章

网友评论

  • LD_左岸:$ fastlane init
    [✔] 🚀
    [✔] Looking for iOS and Android projects in current directory...
    [10:04:47]: Created new folder './fastlane'.
    [10:04:47]: Detected an iOS/macOS project in the current directory: 'PeiGengMath.xcworkspace'
    [10:04:47]: -----------------------------
    [10:04:47]: --- Welcome to fastlane 🚀 ---
    [10:04:47]: -----------------------------
    [10:04:47]: fastlane can help you with all kinds of automation for your mobile app
    [10:04:47]: We recommend automating one task first, and then gradually automating more over time
    [10:04:47]: What would you like to use fastlane for?
    1. 📸 Automate screenshots
    2. 👩‍✈️ Automate beta distribution to TestFlight
    3. 🚀 Automate App Store distribution
    4. 🛠 Manual setup - manually setup your project to automate your tasks
    ? 4
    [10:04:49]: ------------------------------------------------------------
    [10:04:49]: --- Setting up fastlane so you can manually configure it ---
    [10:04:49]: ------------------------------------------------------------
    [10:04:49]: Installing dependencies for you...
    [10:04:49]: $ bundle update
    到这就卡死不动了...
    ef4b6e6d5ae9:把里面一个文件改下 再bundle update 就行了
  • 山东菏泽朱志强:楼主好人一生平安
  • Dimon_Hu:大神帮看看,啥情况。
    aaa000:我的也是这个问题 package is corrupt....
    NotFunGuy:请问楼主解决了么?我也遇到这个问题了
  • Dimon_Hu:ERROR: Error installing fastlane:
    invalid gem: package is corrupt, exception while verifying: undefined method `size' for nil:NilClass (NoMethodError) in /Library/Ruby/Gems/2.0.0/cache/fastimage-1.6.8.gem

本文标题:Fastlane入门:安装篇

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