├── LICENSE ├── README.md ├── fastlane init ├── Gemfile ├── Gemfile.lock └── fastlane │ ├── Appfile │ ├── Fastfile │ ├── Pluginfile │ ├── README.md │ └── report.xml ├── fastlane-蒲公英-设置密码 ├── Appfile ├── Fastfile ├── Pluginfile └── README.md └── img ├── Fastfile.png └── Success.jpg /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 Liang Xu 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # fastlane 快车道自动打包ipa 上传蒲公英 App Store 2 | 3 | # 打包模式支持: 4 | ## 1. ad-hoc内测版本 5 | ## 2. development 开发版本 6 | ## 3. App Store公开版本 7 | 8 | ### 打包完成 + 上传成功 9 | ![Fastfile](https://github.com/XLsn0w/fastlane/blob/master/img/Success.jpg?raw=true) 10 | 11 | ### 编写lane脚本 lane Action其实就是类似于函数的执行方法 朋友你要用的话 直接套用 改成你的项目名称即可 12 | ![Success](https://github.com/XLsn0w/fastlane/blob/master/img/Fastfile.png?raw=true) 13 | 14 | 15 | 16 | ## 1. 打开terminal(终端),进入项目根目录下,初始化fastlane 17 | 18 | # $: fastlane init 19 | -------------------------------------------------------------------------------- /fastlane init/Gemfile: -------------------------------------------------------------------------------- 1 | source "https://rubygems.org" 2 | 3 | gem "fastlane" 4 | 5 | plugins_path = File.join(File.dirname(__FILE__), 'fastlane', 'Pluginfile') 6 | eval_gemfile(plugins_path) if File.exist?(plugins_path) 7 | -------------------------------------------------------------------------------- /fastlane init/Gemfile.lock: -------------------------------------------------------------------------------- 1 | GEM 2 | remote: https://rubygems.org/ 3 | specs: 4 | CFPropertyList (3.0.0) 5 | addressable (2.5.2) 6 | public_suffix (>= 2.0.2, < 4.0) 7 | atomos (0.1.3) 8 | babosa (1.0.2) 9 | claide (1.0.2) 10 | colored (1.2) 11 | colored2 (3.1.2) 12 | commander-fastlane (4.4.6) 13 | highline (~> 1.7.2) 14 | declarative (0.0.10) 15 | declarative-option (0.1.0) 16 | domain_name (0.5.20180417) 17 | unf (>= 0.0.5, < 1.0.0) 18 | dotenv (2.5.0) 19 | emoji_regex (0.1.1) 20 | excon (0.62.0) 21 | faraday (0.15.4) 22 | multipart-post (>= 1.2, < 3) 23 | faraday-cookie_jar (0.0.6) 24 | faraday (>= 0.7.4) 25 | http-cookie (~> 1.0.0) 26 | faraday_middleware (0.12.2) 27 | faraday (>= 0.7.4, < 1.0) 28 | fastimage (2.1.4) 29 | fastlane (2.108.0) 30 | CFPropertyList (>= 2.3, < 4.0.0) 31 | addressable (>= 2.3, < 3.0.0) 32 | babosa (>= 1.0.2, < 2.0.0) 33 | bundler (>= 1.12.0, < 2.0.0) 34 | colored 35 | commander-fastlane (>= 4.4.6, < 5.0.0) 36 | dotenv (>= 2.1.1, < 3.0.0) 37 | emoji_regex (~> 0.1) 38 | excon (>= 0.45.0, < 1.0.0) 39 | faraday (~> 0.9) 40 | faraday-cookie_jar (~> 0.0.6) 41 | faraday_middleware (~> 0.9) 42 | fastimage (>= 2.1.0, < 3.0.0) 43 | gh_inspector (>= 1.1.2, < 2.0.0) 44 | google-api-client (>= 0.21.2, < 0.24.0) 45 | highline (>= 1.7.2, < 2.0.0) 46 | json (< 3.0.0) 47 | mini_magick (~> 4.5.1) 48 | multi_json 49 | multi_xml (~> 0.5) 50 | multipart-post (~> 2.0.0) 51 | plist (>= 3.1.0, < 4.0.0) 52 | public_suffix (~> 2.0.0) 53 | rubyzip (>= 1.2.2, < 2.0.0) 54 | security (= 0.1.3) 55 | simctl (~> 1.6.3) 56 | slack-notifier (>= 2.0.0, < 3.0.0) 57 | terminal-notifier (>= 1.6.2, < 2.0.0) 58 | terminal-table (>= 1.4.5, < 2.0.0) 59 | tty-screen (>= 0.6.3, < 1.0.0) 60 | tty-spinner (>= 0.8.0, < 1.0.0) 61 | word_wrap (~> 1.0.0) 62 | xcodeproj (>= 1.6.0, < 2.0.0) 63 | xcpretty (~> 0.3.0) 64 | xcpretty-travis-formatter (>= 0.0.3) 65 | fastlane-plugin-pgyer (0.2.2) 66 | gh_inspector (1.1.3) 67 | google-api-client (0.23.9) 68 | addressable (~> 2.5, >= 2.5.1) 69 | googleauth (>= 0.5, < 0.7.0) 70 | httpclient (>= 2.8.1, < 3.0) 71 | mime-types (~> 3.0) 72 | representable (~> 3.0) 73 | retriable (>= 2.0, < 4.0) 74 | signet (~> 0.9) 75 | googleauth (0.6.7) 76 | faraday (~> 0.12) 77 | jwt (>= 1.4, < 3.0) 78 | memoist (~> 0.16) 79 | multi_json (~> 1.11) 80 | os (>= 0.9, < 2.0) 81 | signet (~> 0.7) 82 | highline (1.7.10) 83 | http-cookie (1.0.3) 84 | domain_name (~> 0.5) 85 | httpclient (2.8.3) 86 | json (2.1.0) 87 | jwt (2.1.0) 88 | memoist (0.16.0) 89 | mime-types (3.2.2) 90 | mime-types-data (~> 3.2015) 91 | mime-types-data (3.2018.0812) 92 | mini_magick (4.5.1) 93 | multi_json (1.13.1) 94 | multi_xml (0.6.0) 95 | multipart-post (2.0.0) 96 | nanaimo (0.2.6) 97 | naturally (2.2.0) 98 | os (1.0.0) 99 | plist (3.4.0) 100 | public_suffix (2.0.5) 101 | representable (3.0.4) 102 | declarative (< 0.1.0) 103 | declarative-option (< 0.2.0) 104 | uber (< 0.2.0) 105 | retriable (3.1.2) 106 | rouge (2.0.7) 107 | rubyzip (1.2.2) 108 | security (0.1.3) 109 | signet (0.11.0) 110 | addressable (~> 2.3) 111 | faraday (~> 0.9) 112 | jwt (>= 1.5, < 3.0) 113 | multi_json (~> 1.10) 114 | simctl (1.6.5) 115 | CFPropertyList 116 | naturally 117 | slack-notifier (2.3.2) 118 | terminal-notifier (1.8.0) 119 | terminal-table (1.8.0) 120 | unicode-display_width (~> 1.1, >= 1.1.1) 121 | tty-cursor (0.6.0) 122 | tty-screen (0.6.5) 123 | tty-spinner (0.8.0) 124 | tty-cursor (>= 0.5.0) 125 | uber (0.1.0) 126 | unf (0.1.4) 127 | unf_ext 128 | unf_ext (0.0.7.5) 129 | unicode-display_width (1.4.0) 130 | word_wrap (1.0.0) 131 | xcodeproj (1.7.0) 132 | CFPropertyList (>= 2.3.3, < 4.0) 133 | atomos (~> 0.1.3) 134 | claide (>= 1.0.2, < 2.0) 135 | colored2 (~> 3.1) 136 | nanaimo (~> 0.2.6) 137 | xcpretty (0.3.0) 138 | rouge (~> 2.0.7) 139 | xcpretty-travis-formatter (1.0.0) 140 | xcpretty (~> 0.2, >= 0.0.7) 141 | 142 | PLATFORMS 143 | ruby 144 | 145 | DEPENDENCIES 146 | fastlane 147 | fastlane-plugin-pgyer 148 | 149 | BUNDLED WITH 150 | 1.16.6 151 | -------------------------------------------------------------------------------- /fastlane init/fastlane/Appfile: -------------------------------------------------------------------------------- 1 | # app_identifier("[[APP_IDENTIFIER]]") # The bundle identifier of your app 2 | # apple_id("[[APPLE_ID]]") # Your Apple email address 3 | 4 | 5 | # For more information about the Appfile, see: 6 | # https://docs.fastlane.tools/advanced/#appfile 7 | -------------------------------------------------------------------------------- /fastlane init/fastlane/Fastfile: -------------------------------------------------------------------------------- 1 | 2 | default_platform(:ios) 3 | 4 | #指定项目的scheme即:App名称 5 | scheme = “XLsn0w” 6 | 7 | #蒲公英api_key和user_key 8 | pgyer_api_key = "" 9 | pgyer_user_key = "" 10 | 11 | # App专用密码: Apple ID开启两步验证后 专门设置一个用于fastlane上传的密码 12 | FASTLANE_APPLE_APPLICATION_SPECIFIC_PASSWORD = "" 13 | 14 | platform :ios do 15 | 16 | puts "lane执行ad-hoc脚本" 17 | 18 | lane :ad_hoc do|options| 19 | branch = options[:branch] 20 | 21 | # “gym开始执行ad-hoc打包ipa” 22 | 23 | gym( 24 | #输出的ipa名称 25 | output_name:”#{scheme}”, 26 | # 是否清空以前的编译信息 true:是 27 | clean:true, 28 | # 指定打包方式,Release 或者 Debug 29 | configuration:"Release", 30 | # 指定打包所使用的输出方式,目前支持app-store, package, ad-hoc, enterprise, development 31 | export_method:"ad-hoc", 32 | # 指定输出文件夹 33 | output_directory:"./fastlane/ad-hoc", 34 | ) 35 | 36 | puts "开始上传蒲公英" 37 | 38 | pgyer(api_key: “#{pgyer_api_key}”, user_key: “#{pgyer_user_key}”) 39 | 40 | end 41 | 42 | 43 | 44 | # "lane执行development脚本" 45 | 46 | lane :develop do|options| 47 | branch = options[:branch] 48 | 49 | puts “gym开始执行development打包ipa” 50 | 51 | gym( 52 | #输出的ipa名称 53 | output_name:”#{scheme}”, 54 | # 是否清空以前的编译信息 true:是 55 | clean:true, 56 | # 指定打包方式,Release 或者 Debug 57 | configuration:"Debug", 58 | # 指定打包所使用的输出方式,目前支持app-store, package, ad-hoc, enterprise, development 59 | export_method:"development", 60 | # 指定输出文件夹 61 | output_directory:"./fastlane/development", 62 | ) 63 | 64 | end 65 | 66 | 67 | 68 | # "lane执行app-store脚本" 69 | 70 | #desc "向App Store推送一个新的发布版本" 71 | lane :app_store do 72 | build_app(workspace: "TimeForest.xcworkspace", scheme: "TimeForest") 73 | upload_to_app_store 74 | 75 | puts “gym开始执行app-store打包ipa” 76 | 77 | gym( 78 | output_name:”#{scheme}”, 79 | clean:true, 80 | configuration:"Release", 81 | export_method:"app-store", 82 | output_directory:"./fastlane/app-store", 83 | ) 84 | 85 | end 86 | 87 | 88 | 89 | end 90 | -------------------------------------------------------------------------------- /fastlane init/fastlane/Pluginfile: -------------------------------------------------------------------------------- 1 | # Autogenerated by fastlane 2 | # 3 | # Ensure this file is checked in to source control! 4 | 5 | gem 'fastlane-plugin-pgyer' 6 | -------------------------------------------------------------------------------- /fastlane init/fastlane/README.md: -------------------------------------------------------------------------------- 1 | fastlane documentation 2 | ================ 3 | # Installation 4 | 5 | Make sure you have the latest version of the Xcode command line tools installed: 6 | 7 | ``` 8 | xcode-select --install 9 | ``` 10 | 11 | Install _fastlane_ using 12 | ``` 13 | [sudo] gem install fastlane -NV 14 | ``` 15 | or alternatively using `brew cask install fastlane` 16 | 17 | # Available Actions 18 | ## iOS 19 | ### ios ad_hoc 20 | ``` 21 | fastlane ios ad_hoc 22 | ``` 23 | 24 | ### ios develop 25 | ``` 26 | fastlane ios develop 27 | ``` 28 | 29 | ### ios app_store 30 | ``` 31 | fastlane ios app_store 32 | ``` 33 | 34 | 35 | ---- 36 | 37 | This README.md is auto-generated and will be re-generated every time [fastlane](https://fastlane.tools) is run. 38 | More information about fastlane can be found on [fastlane.tools](https://fastlane.tools). 39 | The documentation of fastlane can be found on [docs.fastlane.tools](https://docs.fastlane.tools). 40 | -------------------------------------------------------------------------------- /fastlane init/fastlane/report.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /fastlane-蒲公英-设置密码/Appfile: -------------------------------------------------------------------------------- 1 | # app_identifier("[[APP_IDENTIFIER]]") # The bundle identifier of your app 2 | # apple_id("[[APPLE_ID]]") # Your Apple email address 3 | 4 | 5 | # For more information about the Appfile, see: 6 | # https://docs.fastlane.tools/advanced/#appfile 7 | -------------------------------------------------------------------------------- /fastlane-蒲公英-设置密码/Fastfile: -------------------------------------------------------------------------------- 1 | 2 | default_platform(:ios) 3 | 4 | #指定项目的scheme即:App名称 5 | scheme = “XLsn0wApp” 6 | 7 | #蒲公英api_key和user_key 8 | pgyer_api_key = "8cf272d1f1644ef6cdc5899ba" 9 | pgyer_user_key = "73d7a4869e961756975d33e8" 10 | 11 | # App专用密码: Apple ID开启两步验证后 专门设置一个用于fastlane上传的密码 12 | FASTLANE_APPLE_APPLICATION_SPECIFIC_PASSWORD = "osfh-zvij-selv" 13 | 14 | platform :ios do 15 | 16 | puts "lane执行ad-hoc脚本" 17 | 18 | lane :adhoc do|options| 19 | branch = options[:branch] 20 | 21 | # “gym开始执行ad-hoc打包ipa” 22 | 23 | # 指定Xcode版本 24 | xcode_select("/Applications/Xcode.app") 25 | 26 | gym( 27 | # 输出的ipa名称 28 | output_name:”#{scheme}”, 29 | # 是否清空以前的编译信息 true:是 30 | clean:true, 31 | # 指定打包方式,Release 或者 Debug 32 | configuration:"Release", 33 | # 指定打包所使用的输出方式,目前支持app-store, package, ad-hoc, enterprise, development 34 | export_method:"ad-hoc", 35 | # 指定输出文件夹 36 | output_directory:"./fastlane/ad-hoc", 37 | ) 38 | 39 | puts "开始上传蒲公英" 40 | 41 | # 蒲公英上传需要设置密码 pgyer(api_key: “#{pgyer_api_key}”, user_key: “#{pgyer_user_key}”) 42 | pgyer(api_key: “#{pgyer_api_key}”, user_key: “#{pgyer_user_key}”, password: "bjt", install_type: "2") 43 | 44 | end 45 | 46 | end 47 | -------------------------------------------------------------------------------- /fastlane-蒲公英-设置密码/Pluginfile: -------------------------------------------------------------------------------- 1 | # Autogenerated by fastlane 2 | # 3 | # Ensure this file is checked in to source control! 4 | 5 | gem 'fastlane-plugin-pgyer' 6 | -------------------------------------------------------------------------------- /fastlane-蒲公英-设置密码/README.md: -------------------------------------------------------------------------------- 1 | fastlane documentation 2 | ================ 3 | # Installation 4 | 5 | Make sure you have the latest version of the Xcode command line tools installed: 6 | 7 | ``` 8 | xcode-select --install 9 | ``` 10 | 11 | Install _fastlane_ using 12 | ``` 13 | [sudo] gem install fastlane -NV 14 | ``` 15 | or alternatively using `brew cask install fastlane` 16 | 17 | # Available Actions 18 | ## iOS 19 | ### ios adhoc 20 | ``` 21 | fastlane ios adhoc 22 | ``` 23 | 24 | 25 | ---- 26 | 27 | This README.md is auto-generated and will be re-generated every time [fastlane](https://fastlane.tools) is run. 28 | More information about fastlane can be found on [fastlane.tools](https://fastlane.tools). 29 | The documentation of fastlane can be found on [docs.fastlane.tools](https://docs.fastlane.tools). 30 | -------------------------------------------------------------------------------- /img/Fastfile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XLsn0w/fastlane/00422e5912ef97754b8080a44fec0f09d7d6b853/img/Fastfile.png -------------------------------------------------------------------------------- /img/Success.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XLsn0w/fastlane/00422e5912ef97754b8080a44fec0f09d7d6b853/img/Success.jpg --------------------------------------------------------------------------------