Fastlane自动化打包---配置篇

Fastlane自动化打包---安装篇
Fastlane自动化打包---打包上传蒲公英篇

参考文档:

2. Fastlane初始化

2.1为项目配置 fastlane
$ cd 项目目录
$ fastlane init

2.1.1. init过程中可能出现的问题 常见问题

(1)如果期间报错 Connection reset by peer - SSL_Connect,就需要执行:

$ brew update && brew install ruby
// 重装
$ sudo gem install -n /usr/local/bin fastlane

(1.1)然后重新执行

$ fastlane init

这些是参考AD_Fastlane中的错误,实际当中我没有遇到,如果没有遇到可以忽略

2.2. 步骤详情

2.2.1我选择的是第三个下面的步骤也会按照第三个来讲解,因为是小白,所以只能选择第三个
$ fastlane init
[✔] 🚀 
[✔] Looking for iOS and Android projects in current directory...
[10:37:51]: Created new folder './fastlane'.
[10:37:51]: Detected an iOS/macOS project in the current directory: 'XXXXXX.xcworkspace'
[10:37:51]: -----------------------------
[10:37:51]: --- Welcome to fastlane 🚀 ---
[10:37:51]: -----------------------------
[10:37:51]: fastlane can help you with all kinds of automation for your mobile app
[10:37:51]: We recommend automating one task first, and then gradually automating more over time
[10:37:51]: What would you like to use fastlane for?
1. 📸  Automate screenshots  `->自动截图`
2. 👩‍✈️  Automate beta distribution to TestFlight  `->自动testfilght型配置`
3. 🚀  Automate App Store distribution `->自动发布型配置`
4. 🛠  Manual setup - manually setup your project to automate your tasks `->需要手动配置内容`
2.2.2接下来它会让你输入你的苹果开发者账号和密码密码输入过一次,下次默认自动登录了,千万不要输错了
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
?  3
[10:37:53]: ----------------------------------------------------------
[10:37:53]: --- Setting up fastlane for iOS App Store distribution ---
[10:37:53]: ----------------------------------------------------------
[10:37:53]: Parsing your local Xcode project to find the available schemes and the app identifier
[10:37:53]: $ xcodebuild -showBuildSettings -workspace FastlaneDev.xcworkspace -scheme FastlaneDev
[10:37:55]: $ cd `你项目的路径` && agvtool what-version -terse
[10:37:55]: --------------------------------
[10:37:55]: --- Login with your Apple ID ---
[10:37:55]: --------------------------------
[10:37:55]: To use App Store Connect and Apple Developer Portal features as part of fastlane,
[10:37:55]: we will ask you for your Apple ID username and password
[10:37:55]: This is necessary for certain fastlane features, for example:
[10:37:55]: 
[10:37:55]: - Create and manage your provisioning profiles on the Developer Portal
[10:37:55]: - Upload and manage TestFlight and App Store builds on App Store Connect
[10:37:55]: - Manage your App Store Connect app metadata and screenshots
[10:37:55]: 
[10:37:55]: Your Apple ID credentials will only be stored in your Keychain, on your local machine
[10:37:55]: For more information, check out
[10:37:55]:     https://github.com/fastlane/fastlane/tree/master/credentials_manager
[10:37:55]: 
[10:37:55]: Please enter your Apple ID developer credentials
[10:37:55]: Apple ID Username:
`你的Apple ID`
[10:38:16]: Logging in...

错误提示
当然密码输入错误或者是其他错误都会报错的我没有尝试过密码错误,我的错误是另一个,是因为开发者账号协议没有同意
当有错误出现 就会询问你是否进行手动配置,如果你有把握手动配置就选择Yes,如果没有就选择NO,就会停止,解决错误重新自动配置

[10:38:16]: Logging in...
[10:38:17]: --------------------
[10:38:17]: fastlane init failed
[10:38:17]: --------------------
[10:38:17]: ["The request could not be completed because:", "Need to >acknowledge to Apple's Apple ID and Privacy statement. Please manually log >into https://appleid.apple.com (or https://itunesconnect.apple.com) to >acknowledge the statement."]
[10:38:17]: Something failed while running `fastlane init`
[10:38:17]: Tried using Apple ID with email '开发者账号'
[10:38:17]: You can either retry, or fallback to manual setup which will create a >basic Fastfile
[10:38:17]: Would you like to fallback to a manual Fastfile? (y/n)
2.2.3 然后苹果开发者账号认证登录完成

当然如果你的是企业账号或者公司账号关联多个开发者账号的话也会让你自己选择

[10:42:08]: Logging in...
Password (for `开发者账号`): *********
Multiple teams found on the Developer Portal, please enter the number of the >team you want to use: 
1) 3333333 "XXXXX Siti Technology Co., Ltd." (Company/Organization)
2) 3333333 "XXXXXX United Win Asset Management Co., Ltd." >>>(Company/Organization)
3) 3333333 "XXXXXXXX Financial Information Service Co., Ltd." (Company/Organization)

然后会询问是否在开发者账号下创建一个App
由于不想多创建,因为创建之后不能删除,所以我就找了一个废弃的来创建,把项目的 Bundle identifier修改一下就可以,然后重新走一个他会检测,如果已经在开发者账号中创建了就不会有这一步。

[10:43:41]: ✅  Logging in with your Apple ID was successful
[10:43:41]: Checking if the app 'Bundle identifier' exists in your Apple >Developer Portal...
[10:43:41]: It looks like the app 'Bundle identifier' isn't available on the Apple >Developer Portal
[10:43:41]: for the team ID '3333333' on Apple ID '开发者账号'
[10:43:41]: Do you want fastlane to create the App ID for you on the Apple
Developer Portal? (y/n)
2.2.4 init完成
[10:50:45]: Would you like to have fastlane manage your app's metadata?
[10:50:45]: If you enable this feature, fastlane will download your existing metadata and screenshots.
[10:50:45]: This way, you'll be able to edit your app's metadata in local `.txt` files.
[10:50:45]: After editing the local `.txt` files, just run fastlane and all changes will be pushed up.
[10:50:45]: If you don't want to use this feature, you can still use fastlane to upload and distribute new builds to the App Store
[10:50:45]: Would you like fastlane to manage your app's metadata? (y/n)
y

[10:51:18]: Writing to './fastlane/metadata/zh-Hans/description.txt'
[10:51:18]: Writing to './fastlane/metadata/zh-Hans/keywords.txt'
[10:51:18]: Writing to './fastlane/metadata/zh-Hans/release_notes.txt'
[10:51:18]: Writing to './fastlane/metadata/zh-Hans/support_url.txt'
[10:51:18]: Writing to './fastlane/metadata/zh-Hans/marketing_url.txt'
[10:51:18]: Writing to './fastlane/metadata/zh-Hans/promotional_text.txt'
[10:51:18]: Writing to './fastlane/metadata/zh-Hans/name.txt'
[10:51:18]: Writing to './fastlane/metadata/zh-Hans/subtitle.txt'
[10:51:18]: Writing to './fastlane/metadata/zh-Hans/privacy_url.txt'
[10:51:18]: Writing to './fastlane/metadata/copyright.txt'
[10:51:18]: Writing to './fastlane/metadata/primary_category.txt'
[10:51:18]: Writing to './fastlane/metadata/secondary_category.txt'
[10:51:18]: Writing to './fastlane/metadata/primary_first_sub_category.txt'
[10:51:18]: Writing to './fastlane/metadata/primary_second_sub_category.txt'
[10:51:18]: Writing to './fastlane/metadata/secondary_first_sub_category.txt'
[10:51:18]: Writing to './fastlane/metadata/secondary_second_sub_category.txt'
[10:51:18]: Writing to './fastlane/metadata/trade_representative_contact_information/trade_name.txt'
[10:51:18]: Writing to './fastlane/metadata/trade_representative_contact_information/first_name.txt'
[10:51:18]: Writing to './fastlane/metadata/trade_representative_contact_information/last_name.txt'
[10:51:18]: Writing to './fastlane/metadata/trade_representative_contact_information/address_line1.txt'
[10:51:18]: Writing to './fastlane/metadata/trade_representative_contact_information/address_line2.txt'
[10:51:18]: Writing to './fastlane/metadata/trade_representative_contact_information/address_line3.txt'
[10:51:18]: Writing to './fastlane/metadata/trade_representative_contact_information/city_name.txt'
[10:51:18]: Writing to './fastlane/metadata/trade_representative_contact_information/state.txt'
[10:51:18]: Writing to './fastlane/metadata/trade_representative_contact_information/country.txt'
[10:51:18]: Writing to './fastlane/metadata/trade_representative_contact_information/postal_code.txt'
[10:51:18]: Writing to './fastlane/metadata/trade_representative_contact_information/phone_number.txt'
[10:51:18]: Writing to './fastlane/metadata/trade_representative_contact_information/email_address.txt'
[10:51:18]: Writing to './fastlane/metadata/trade_representative_contact_information/is_displayed_on_app_store.txt'
[10:51:18]: Writing to './fastlane/metadata/review_information/first_name.txt'
[10:51:18]: Writing to './fastlane/metadata/review_information/last_name.txt'
[10:51:18]: Writing to './fastlane/metadata/review_information/phone_number.txt'
[10:51:18]: Writing to './fastlane/metadata/review_information/email_address.txt'
[10:51:18]: Writing to './fastlane/metadata/review_information/demo_user.txt'
[10:51:18]: Writing to './fastlane/metadata/review_information/demo_password.txt'
[10:51:18]: Writing to './fastlane/metadata/review_information/notes.txt'
[10:51:18]: Successfully created new configuration files.
[10:51:18]: Downloading all existing screenshots...
[10:51:19]: Successfully downloaded all existing screenshots
[10:51:19]: Successfully created new Deliverfile at path './fastlane/Deliverfile'

网上看到的错误我没有遇到过
如果一直停留在bundle update这个地方

[09:36:01]: Installing dependencies for you...
[09:36:01]: $ bundle update

关闭终端 打开项目文件夹,找到fastlane init过程中生成的Gemfile文件,并打开

屏幕快照 2018-07-25 11.43.40.png

#将https://rubygems.org,换成https://ruby.taobao.org,说是被墙,但我没有遇到
屏幕快照 2018-07-25 11.44.03.png

然后打开终端,cd到当前项目,输入bundle update

  • 注意事项: 过程当中会有很多填写密码或者询问(y/n) YES/NO 要留意看清楚什么意思
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 206,839评论 6 482
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 88,543评论 2 382
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 153,116评论 0 344
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 55,371评论 1 279
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 64,384评论 5 374
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 49,111评论 1 285
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 38,416评论 3 400
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 37,053评论 0 259
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 43,558评论 1 300
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 36,007评论 2 325
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 38,117评论 1 334
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 33,756评论 4 324
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 39,324评论 3 307
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 30,315评论 0 19
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 31,539评论 1 262
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 45,578评论 2 355
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 42,877评论 2 345

推荐阅读更多精彩内容