fastlane悟り

6632 ワード

fastlane悟り
ターゲット:fastlaneを使用してappStoreを自動的にパッケージアップロード
一、fastlaneのインストール
fastlaneはRubyバージョンを要求し、現在の最新バージョンはrubyバージョン>=2.1を要求し、インストール前にいくつかの準備手順があります.
  • まずrubyバージョンを表示します:ruby-v
  • XcodeのCLTがインストールされているかどうかを確認します:xcode-select--install(インストールされていない場合、端末は自分でCLTをインストールします)
  • 以上の条件を満たすと、コマンドを入力してfastlaneをインストールします.
    sudo gem install fastlane
    

    fastlaneのツールチェーンについて簡単に説明します.
  • produce作成iTunes ConnectおよびApple Developer
  • Portalのios app.
  • certはiosコード署名証明書を自動的に作成および維持します.
  • sigh provisioning profilesの作成、更新、ダウンロード、修復.
  • snapshotは、Appスクリーンショットを各デバイスに自動的にローカライズします.
  • frameitは、スクリーンショットを適切なデバイススクリーンサイズに適合させる.
  • gymはios appを作成し、パッケージ化します.
  • deliverは、スクリーンショット、メタデータ、およびAppストアにアップロードします.
  • pem Push通知のprofileを自動的に作成および更新します.

  • 二、fastlaneを初期化する
    プロジェクトディレクトリに入ったら、次のコマンドを入力します.
    fastlane init
    

    初期化すると、次の4つのオプションが表示されます.
  • Automate screenshots(自動スクリーンショット)
  • Automate beta distribution to TestFlight(TestFlight)
  • Automate App Store distribution(appStoreリリース)
  • Manual setup-manually setup your project to automate your tasks(カスタム)
  • 初期化が完了すると、fastlaneフォルダが表示されます.次の内容が含まれます.
  • Appfile、app IDと開発者のApple IDを格納するための
  • 作成したlaneを管理するための
  • Fastfile、laneは各action(すなわちfastlaneのツールチェーン)
  • を呼び出すことができる.
  • Snapfileは、スクリーンショットを行う必要があるデバイスのタイプを指定するために使用する(オプションに従って生成され、構成のために自分でファイルを作成することができる)
  • .
  • Deliverfile、appStoreにパブリッシュするファイルを構成するため(オプションによって生成され、自分でファイルを作成して構成することができる)
  • .
    あちこちのファイルのエンコードフォーマットをUTF-8に設定
    /.bashrc,/.bash_profile,~/.zshrcファイルで、編集追加
    export LC_ALL=en_US.UTF-8
    export LANG=en_US.UTF-8
    fastlaneフォルダの同級ディレクトリの下にGemfileファイルを新規作成し、構成を追加します.
    source "https://rubygems.org"
    gem "fastlane"
    コマンドラインで実行
    [sudo] bundle update
    

    GemfileとGemfileを通過する.ロックはバージョン管理を行い、その後Fastfileの構成を開始できます.構成が完了したら、実行します.
    bundle exec fastlane [lane]
    

    三、fastlaneの構成
    公式サイトのリンクを添付します.https://docs.fastlane.tools/actions/
    すべての構成はFastfileファイルに書くことができます.ツールチェーンは自分でファイルを生成して行うことができます.Fastfileで呼び出せばいいです.例えば、DeliverfileにはappStoreをアップロードする構成のいくつかの構成項目が書かれています.Fastfileでは、laneがdeliverを呼び出すとDeliverfileの構成を参照します.
    Fastfileをインポートする必要がある場合は、コマンドを入力します.
    import './path/to/other/Fastfile'
    

    fastlaneの構成は多く、公式サイトでドキュメントを表示することができます.各acitonには対応するパラメータ構成があります.次に、よく使われるactionのプラグインと対応するツールチェーンを挙げます.
    Testingテスト
  • scan run_testsの別名
  • slather slatherコードオーバーライド率レポート
  • を生成するためにslatherを使用する
  • swiftlintを使用してswiftコード検証
  • を実行
  • xcovが書いた良いコードのカバー率報告
  • sonarプログラミング方式でsonar-scanner分析SonarQube
  • を呼び出す
  • oclint OCLintによるLintsの実現
  • gcovr Xcodeプロジェクト運行テストカバー率報告
  • lcov lcov lcovを用いるカバー率データ
  • を生成する.
  • appium Appium用RSpec実行UIテスト
  • xctool xctool xctoolを使用してテスト
  • を実行
  • xcode_server _get _assets Xcode Botのxcarchiveとログ
  • をダウンロード
  • run_testsはiOSアプリケーション(scan経由)
  • を簡単に実行します.
    Buildingパッケージ
  • gym build_ios _appの別名
  • cocoapodsはpod install
  • に相当する
  • gradle Androidアプリケーションの構築とテスト
  • を含むすべての関連action
  • clear_derived _Data Xcode Derivedキャッシュ
  • を削除する
  • adb Run ADB Actions
  • xcversionバージョン説明子
  • を使用するためにXcodeを選択
  • xcodebuild xcodebuildコマンドを使用してアプリケーション
  • を構築および署名
  • carthage Runs carthage for your project
  • xcode_selectで使用するXcodeパスを変更します.Xcode用betaバージョン
  • ensure_xcode _バージョンでは、選択したXcodeバージョンがXcode selectと一致することを確認します.
  • clean_cocoapods _Cache podsのキャッシュを削除する
  • verify_xcode Xcodeのインストールが正しいかどうかを確認する
  • xcode_InstallはXcodeのバージョン
  • がインストールされていることを確認します.
  • verify_pod _keysはpodFileから参照されるすべてのキーが空でない
  • であることを検証する.
  • build_android _app gradle階層の別名
  • xcarchive xcodebuildアーカイブプロジェクト
  • を使用
  • xcclean xcodebuildを使用してプロジェクト
  • をクリーンアップ
  • build_app build_ios _appの別名
  • xcbuild xcodebuildを使用してプロジェクト
  • を構築
  • spmプロジェクトでSwiftパッケージマネージャ
  • を実行
  • build_ios _appは、アプリケーション(gymの別名)
  • を簡単に構築および署名する.
  • xcexport xcodebuildを使用してプロジェクト
  • をエクスポート
  • xctestは、所与のシミュレータ上でテスト
  • を実行する.
    Screenshotsスクリーンショット
  • snapshot capture_ios _screenshotsの別名
  • screengrab capture_android _screenshotsの別名
  • frameit frame_screenshotsの別名
  • frame_screenshots Adds device frames around all screenshots (via frameit)
  • capture_android _screenshots Automated localized screenshots of your Android app (via screengrab)
  • capture_ios _screenshots Generate new localized screenshots on multiple devices (via snapshot)
  • capture_screenshots capture_ios_screenshotsの別名
  • プロジェクトプロジェクトの構成
  • increment_build _numberプロジェクトのbuild number自増
  • set_info _plist _value Sets value to Info.plist of your project as native Ruby data structures
  • get_version _number Get the version number of your project
  • get_info _plist _value Returns value from Info.plist of your project as native Ruby data structures
  • update_info _plist Update a Info.plist file with bundle identifier and display name
  • update_app _identifier Update the project's bundle identifier
  • get_build _number Get the build number of your project
  • increment_version _number Increment the version number of your project
  • update_project _team Update Xcode Development Team ID
  • update_app _group _identifiers This action changes the app group identifiers in the entitlements file
  • get_ipa _info _plist _value Returns a value from Info.plist inside a .ipa file
  • recreate_schemes Recreate not shared Xcode project schemes
  • update_url _schemes Updates the URL schemes in the given Info.plist
  • set_build _number _repository Set the build number from the current repository
  • set_pod _key Sets a value for a key with cocoapods-keys

  • Releasing your appリリース
  • deliver Alias for the upload_to_app_store action
  • supply Alias for the upload_to_play_store action
  • appstore Alias for the upload_to_app_store action
  • upload_to_play_store Upload metadata, screenshots and binaries to Google Play (via supply)
  • upload_to_app_store Upload metadata and binary to iTunes Connect (via deliver)

  • 四、運行時報が間違っている
    fastlane gym produces error:method`to_plist'not defined in Arrayのエラーメッセージが表示された場合、fastlaneを削除し、fastlaneを再インストールすることをお勧めします
    rvm @global do gem uninstall fastlane 
    rvm all do gem uninstall fastlane
    gem uninstall fastlane
    gem install fastlane