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閱讀 230,321評論 6 543
  • 序言:濱河連續發生了三起死亡事件,死亡現場離奇詭異,居然都是意外死亡,警方通過查閱死者的電腦和手機,發現死者居然都...
    沈念sama閱讀 99,559評論 3 429
  • 文/潘曉璐 我一進店門,熙熙樓的掌柜王于貴愁眉苦臉地迎上來,“玉大人,你說我怎么就攤上這事。” “怎么了?”我有些...
    開封第一講書人閱讀 178,442評論 0 383
  • 文/不壞的土叔 我叫張陵,是天一觀的道長。 經常有香客問我,道長,這世上最難降的妖魔是什么? 我笑而不...
    開封第一講書人閱讀 63,835評論 1 317
  • 正文 為了忘掉前任,我火速辦了婚禮,結果婚禮上,老公的妹妹穿的比我還像新娘。我一直安慰自己,他們只是感情好,可當我...
    茶點故事閱讀 72,581評論 6 412
  • 文/花漫 我一把揭開白布。 她就那樣靜靜地躺著,像睡著了一般。 火紅的嫁衣襯著肌膚如雪。 梳的紋絲不亂的頭發上,一...
    開封第一講書人閱讀 55,922評論 1 328
  • 那天,我揣著相機與錄音,去河邊找鬼。 笑死,一個胖子當著我的面吹牛,可吹牛的內容都是我干的。 我是一名探鬼主播,決...
    沈念sama閱讀 43,931評論 3 447
  • 文/蒼蘭香墨 我猛地睜開眼,長吁一口氣:“原來是場噩夢啊……” “哼!你這毒婦竟也來了?” 一聲冷哼從身側響起,我...
    開封第一講書人閱讀 43,096評論 0 290
  • 序言:老撾萬榮一對情侶失蹤,失蹤者是張志新(化名)和其女友劉穎,沒想到半個月后,有當地人在樹林里發現了一具尸體,經...
    沈念sama閱讀 49,639評論 1 336
  • 正文 獨居荒郊野嶺守林人離奇死亡,尸身上長有42處帶血的膿包…… 初始之章·張勛 以下內容為張勛視角 年9月15日...
    茶點故事閱讀 41,374評論 3 358
  • 正文 我和宋清朗相戀三年,在試婚紗的時候發現自己被綠了。 大學時的朋友給我發了我未婚夫和他白月光在一起吃飯的照片。...
    茶點故事閱讀 43,591評論 1 374
  • 序言:一個原本活蹦亂跳的男人離奇死亡,死狀恐怖,靈堂內的尸體忽然破棺而出,到底是詐尸還是另有隱情,我是刑警寧澤,帶...
    沈念sama閱讀 39,104評論 5 364
  • 正文 年R本政府宣布,位于F島的核電站,受9級特大地震影響,放射性物質發生泄漏。R本人自食惡果不足惜,卻給世界環境...
    茶點故事閱讀 44,789評論 3 349
  • 文/蒙蒙 一、第九天 我趴在偏房一處隱蔽的房頂上張望。 院中可真熱鬧,春花似錦、人聲如沸。這莊子的主人今日做“春日...
    開封第一講書人閱讀 35,196評論 0 28
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽。三九已至,卻和暖如春,著一層夾襖步出監牢的瞬間,已是汗流浹背。 一陣腳步聲響...
    開封第一講書人閱讀 36,524評論 1 295
  • 我被黑心中介騙來泰國打工, 沒想到剛下飛機就差點兒被人妖公主榨干…… 1. 我叫王不留,地道東北人。 一個月前我還...
    沈念sama閱讀 52,322評論 3 400
  • 正文 我出身青樓,卻偏偏與公主長得像,于是被迫代替她去往敵國和親。 傳聞我的和親對象是個殘疾皇子,可洞房花燭夜當晚...
    茶點故事閱讀 48,554評論 2 379

推薦閱讀更多精彩內容