LoginSignup
6
4

More than 5 years have passed since last update.

[Fastlane] 6時間で100アプリを申請にあげる方法 [通称 : 祭り]

Posted at

iOS その3 Advent Calendar 2016 の 24日目です。
なんとかの6時間といわれるクリスマスイブの晩の時間位でできちゃう!
大量のアプリを一斉に申請に出す「通称:祭り」についてかきます!

主にFastlaneの使い方TIPSな感じです。気をつけるとことか。開発者によるReject方法とか。

祭りの季節だ。

2.0H) 下準備

祭るために準備をします。

1.5H) 申請内容の確認

  • ソースコードは完成済み。
  • コードの量は、WebViewを軸にしサーバー側に設定データ等がある一般的な構成を想定
  • アプリはtarget単位(Scheme単位)で用意しておく。
  • target毎にplistを用意する。
    • 変動する値(サーバーとのやりとりをするためのIDとか)は全てそこに保持するようにする。
    • ENV["APP_ID"] と tagert名 と Scheme名(scheme_name)は同じにしておくと吉。
  • メインのデータはアプリ内ではなく、インターネットを経由しサーバーから取得するものとする

0.5H) pod install

targetを全て指定したpod install

3.0H) Build & Upload

アプリをBuildしてAppleにUploadします。
AppleにUpload後、Apple側での謎の処理が必要なのでソレをまつため、SubtmitとTestFlightとは別にしています。
(環境によっては10分以上、待ちタイムアウトが連続することがおおい)

※ 1アプリ3〜4分、同時に2つのBuid&Uploadのlaneを走らせておこなえばだいたい3時間以内に終わる感じ。

Fastlane

Fastlane の以下を使います。

* gym
* deliver

gym

以下でBuild可能。

gym(scheme: scheme_name)

deliver

以下でUpload可能

deliver(force: true,
    skip_screenshots:true,
    submit_for_review:false,
    skip_metadata:true,
    app_identifier:scheme_name)

全targetに対して実施するには?

Rubyの each で実施。

[
    # Scheme名
    ].each do |scheme_name|

   # gym
   # deliver
 end

例外処理は?

Fastlaneで何らかの失敗をする場合は例外となるため円滑な祭りを執り行うには例外処理が必要。

[
    # Scheme名
    ].each do |scheme_name|
    begin
        # gym 処理
        # deliver 処理
    rescue => ex
        # Slackへの通知
    end
 end

MEMO

例外処理は以下がおおい

  • Xcodeが応答しない、Build時にエラーとなった、署名に失敗、targetが存在しない、Uploadに失敗

1.0H) Submit & TestFlight

一斉に申請あげつつも、動作確認をおこないたい。
なので、TestFlightを使う。
Fastlaneの以下を使う。

* Spaceship

だいたい1アプリ30秒から1分程度の見込。

申請用のrelease_noteを設定

# scheme_name にはScheme名をいれる
app = Spaceship::Tunes::Application.find(scheme_name)
v = app.edit_version
v.release_notes["ja"] = "Thank you!!"
v.release_on_approval = 'true'
builds = v.candidate_builds
v.select_build(builds.first)
v.save!

内部テスト(TestFlight)

一番最新のBuildを内部テストする。
1.0.0はバージョンなので変更すること。

train = app.build_trains["1.0.0"]
train.builds.count
build = train.builds.last
train.update_testing_status!(true, 'internal', build)

申請(Submit)

申請をする。

submission = app.create_submission

# 申請時によく質問されるやつの回避用
submission.export_compliance_uses_encryption = false
submission.add_id_info_uses_idfa = false
submission.content_rights_contains_third_party_content = false
submission.content_rights_has_rights = false

submission.complete!

全targetに対して実施するには?

(Build時と同じため略)

MEMO

  • 内部テストにせよ、Submitにせよ例外処理が必要
  • TestFlightは100アプリ程度を上限に実施できないことが以前あったため、TestFlightが出来ないけどSubmitは出来るということがおこった。
    • TestFlight停止は、 train.update_testing_status!(true, 'internal', build)train.update_testing_status!(false, 'internal', build) にするだけ

最後に

Fastlaneを使ったReject方法

公式DOCに載ってないことが結構あるという噂があります。

既知かもしれませんが先日のアップデートでRejectできるようになっています。

app = Spaceship::Tunes::Application.find(scheme_name)
v = app.edit_version
v.reject!
v.save!

祭りのあとに、不具合発覚・・・!!!とかのときに便利です!!

新規アプリ作成

Fastlaneの以下つかえばいけてるぽい

☝︎の他に色々ストアの情報を用意する必要があるので、あとは頑張る (ง・ω・)ง
スクショとったりもできるらしいけど、最終的には人間が調節しないといけないと思う。

lane(spaceship)のデバッグ

SpaceshipはPlaygroundがあります。
Terminalからfastlane spaceship でできます。便利。

➜  fastlane spaceship
(略)
Please report a bug if this causes problems.
Logging into to iTunes Connect (xxxxxxxxxxxxxxxxxxxx)...
Successfully logged in to iTunes Connect

Logging into the Developer Portal (xxxxxxxxxxxxxxxxxxxx)...
Successfully logged in to the Developer Portal

---------------------------------------
| Welcome to the spaceship playground |
---------------------------------------

Enter docs to open up the documentation
Enter exit to exit the spaceship playground
Enter _ to access the return value of the last executed command

Just enter the commands and confirm with Enter
[1] pry(#<Spaceship::Playground>)> docs
=> "https://github.com/fastlane/fastlane/tree/master/spaceship/docs"

個別Build、個別Deliver

Terminalからそれぞれ、fastlane gymfastlane deliver

感想

norenという、アプリ提供サービスに関わってます。 -> AppStore

開発現場で有識者にFastlaneについて教えてもらいながら頑張ってます。
iTunesConnectをTerminalで触れるのは素晴らしいですね!!!

ナントカの6時間はAppleのお休みにぶち当たってるので申請あげらんないかもしれませんが ヾ(:3ノシヾ)ノシ

6
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
6
4