2021/10/27 : Flutter : Build and release an iOS app の訳

 

Contents

Build and release an iOS app


Preliminaries

Xcode is required to build and release your app. You must use a device running macOS to follow this guide.

あなたのアプリをビルド・リリースするためにXcodeが必要です。以下のガイドを実行するためにmacOSが実行できるデバイスが必要です。

 

Before beginning the process of releasing your app, ensure that it meets Apple’s App Review Guidelines.

あなたのアプリのリリース作業を始める前に、あなたのアプリがAppleのApp Review Guidelinesに準拠していることを確認してください。

 

In order to publish your app to the App Store, you must first enroll in the Apple Developer Program.

App Storeにあなたのアプリを出版(リリース)するために、Apple Developer Programに登録する必要があります。

 

You can read more about the various membership options in Apple’s Choosing a Membership guide.

様々なメンバーシップのオプションについては、AppleのChoosing a Membershipガイドで詳しく説明しています。


Register your app on App Store Connect

Manage your app’s life cycle on App Store Connect (formerly iTunes Connect).

あなたのアプリのライフサイクルをApp Store Connectで管理します。

 

You define your app name and description, add screenshots, set pricing, and manage releases to the App Store and TestFlight.

あなたのアプリの名前・説明・スクリーンショット・価格設定・App StoreやTestFlightへのリリースの管理などを定義します。

 

Registering your app involves two steps: registering a unique Bundle ID, and creating an application record on App Store Connect.

あなたのアプリの登録には次の二つが含まれます:「unique Bundle IDの登録」、それと「App Store Connectへのapplication recordの生成」です。

 

For a detailed overview of App Store Connect, see the App Store Connect guide.

App Store Connectの詳しい概要については、「App Store Connectガイド」をご覧ください。


Register a Bundle ID

Every iOS application is associated with a Bundle ID, a unique identifier registered with Apple.

全てのiOSアプリケーションはBundle IDと関連づけられます。Bundle IDはAppleに登録されたユニークな識別子です。

 

To register a Bundle ID for your app, follow these steps:

あなたのアプリのBundle IDを登録するには、以下の手順を実行してください。

1.Open the App IDs page of your developer account.

1.あなたのdeveloper accountページのApp IDsを開いてください。

2.Click + to create a new Bundle ID.

2.新しいBundle IDを生成するために、+をクリックしてください。

3.Enter an app name, select Explicit App ID, and enter an ID.

3.アプリの名前を入力して、Explicit App IDを選択して、IDを入力してください。

4.Select the services your app uses, then click Continue.

4.あなたのアプリが使うサービスを選択して、Continueをクリックしてください。

5.On the next page, confirm the details and click Register to register your Bundle ID.

5.次のページで、詳細を確認して、あなたのBundle IDを登録するためにRegister をクリックしてください。


Create an application record on App Store Connect

あなたのアプリをApp Store Connectに登録します:

1.Open App Store Connect in your browser.

1.ブラウザでApp Store Connectを開きます。

2.On the App Store Connect landing page, click My Apps.

2.App Store Connectのランディングページ(最初のページ)でMy Appsをクリックします。

3.Click + in the top-left corner of the My Apps page, then select New App.

3.My Appsページの左上の + をクリックして、それからNew Appを選択します。

4.Fill in your app details in the form that appears. In the Platforms section, ensure that iOS is checked.

4.あなたのアプリの詳細を出現したフォームに入力します。PlatformsセクションではiOSにチェックしてください。

Since Flutter does not currently support tvOS, leave that checkbox unchecked. Click Create.

現時点ではFlutterはtvOSはサポートしていませんので、そのチェックボックスはチェックしないでください。Createをクリックしてください。

5.Navigate to the application details for your app and select App Information from the sidebar.

5.あなたのアプリのapplication detailsに移動し、サイドバーから「App Information」を選択します。

6.In the General Information section, select the Bundle ID you registered in the preceding step.

6.General Informationセクションで、あなたが以前のステップで登録したBundle IDを選択してください。

For a detailed overview, see Add an app to your account.

詳しい概要については、「アカウントにアプリを追加する」をご覧ください。


Review Xcode project settings

This step covers reviewing the most important settings in the Xcode workspace.

このステップでは、Xcodeのワークスペースで最も重要な設定を確認します。

 

For detailed procedures and descriptions, see Prepare for app distribution.

詳しい手順と解説については、Prepare for app distributionをご覧ください。

 

Navigate to your target’s settings in Xcode:

Xcodeのtargetのsettingsに行きます:

 

1.In Xcode, open Runner.xcworkspace in your app’s ios folder.

1.Xcodeで、あなたのアプリのiosフォルダのRunner.xcworkspaceを開きます。

2.To view your app’s settings, select the Runner project in the Xcode project navigator. Then, in the main view sidebar, select the Runner target.

2.あなたのアプリのsettingsを見て、Xcodeのproject navigatorのRunnerプロジェクトを選択します。そしてメインview sidebarで、Runnerターゲットを選択します。

3.Select the General tab.

3.Generalタブを選択します。

 

Verify the most important settings.

最も重要な設定を確認しましょう。

In the Identity section:

Identityセクションで:

Display Name

The display name of your app.

あなたのアプリの表示名です。

Bundle Identifier

The App ID you registered on App Store Connect.

あなたがApp Store Connectに登録したアプリのIDです。

 

In the Signing & Capabilities section:

Signing & Capabilitiesで:

Automatically manage signing

Whether Xcode should automatically manage app signing and provisioning.

アプリのsigning(署名)とprovisioning(支給)をXcodeが自動的に行うかどうか。

This is set true by default, which should be sufficient for most apps.

これはデフォルトではtrueにセットされます。これはほとんどのアプリにとって十分(適切)です。

For more complex scenarios, see the Code Signing Guide.

さらに複雑なシナリオについては、Code Signing Guideをご覧ください。

Team

登録されているあなたのApple Developer accountに関連するチームを選択してください。

If required, select Add Account…, then update this setting.

必要なら、Add Account…を選択し、このsettingsをアップデートしてください。

iOS Deployment Target

The minimum iOS version that your app supports.

あなたのアプリがサポートするiOSの最小バージョンです。

Flutter supports iOS 9.0 and later.

FlutterはiOS 9.0以降をサポートしています。

If your app or plugins include Objective-C or Swift code that makes use of APIs newer than iOS 9,

もしあなたのアプリあるいはプラグインが、iOS 9以上のAPIを利用したObjective-C あるいは Swiftのコードを含んでいる場合、

update this setting to the highest required version.

この設定を必要な最も高いバージョンにアップデートしてください。

The General tab of your project settings should resemble the following:

あなたのプロジェクトの設定のGeneralタブは下記のようになるはずです。

Xcode Project Settings

For a detailed overview of app signing, see Create, export, and delete signing certificates.

アプリのsigning(署名)についての詳しい概要は、Create, export, and delete signing certificatesをご覧ください。

 


Updating the app’s deployment version

アプリのdeployment versionをアップデートする。

If you changed Deployment Target in your Xcode project, open ios/Flutter/AppframeworkInfo.plist in your Flutter app and update the MinimumOSVersion value to match.

もしXcodeプロジェクトのDeployment Targetを変更した場合は、あなたのFlutterアプリのios/Flutter/AppframeworkInfo.plistを開いて、MinimumOSVersion の値をアップデートして同じにしてください。


Updating the app’s version number

アプリのバージョン番号をアップデートする。

The default version number of the app is 1.0.0.

アプリのデフォルトのバージョン番号は1.0.0です。

To update it, navigate to the pubspec.yaml file and update the following line:

これをアップデートするには、pubspec.yamlファイルの下記の行をアップデートしてください:

version: 1.0.0+1

The version number is three numbers separated by dots, such as 1.0.0 in the example above,

バージョンナンバーは、上記の例の1.0.0のようなドットで区切られた三つの数字です。

followed by an optional build number such as 1 in the example above, separated by a +.

バージョンナンバーの後につづく、+で区切られた、上記の例の1が、ビルドナンバー(省略可能)です。

Both the version and the build number may be overridden in Flutter’s build by specifying --build-name and --build-number, respectively.

Flutterのビルドの際に(コマンドで)–build-name–build-numberをそれぞれ指定することで、バージョンナンバーとビルドナンバーをオーバーライドできます。

iOSではbuild-nameCFBundleShortVersionString を使い、build-numberCFBundleVersionを使います。

Read more about iOS versioning at Core Foundation Keys on the Apple Developer’s site.

iOSのバージョニングについての更なる情報は、Apple Developer’s siteのCore Foundation Keysをご覧ください。


Add an app icon

When a new Flutter app is created, a placeholder icon set is created. This step covers replacing these placeholder icons with your app’s icons:

新しいFlutterアプリが作られる時、プレースホルダー(代替物)のアイコンセットが生成されます。このステップでは、この「デフォルトのアイコン」を「あなたのアイコン」に取り替える手順を示します。

1.Review the iOS App Icon guidelines.

1.iOS App Iconを確認します。

2.In the Xcode project navigator, select Assets.xcassets in the Runner folder. Update the placeholder icons with your own app icons.

2.Xcodeのプロジェクトナビゲーターで、RunnerフォルダのAssets.xcassetsを選択します。プレースホルダーアイコンをあなたのアプリのアイコンに置き換えます。

3.Verify the icon has been replaced by running your app using flutter run.

3.flutter runコマンドを実行して、アプリが変わっているかを確認してください。


Create a build archive with Xcode

Xcodeでbuild archiveを生成する

This step covers creating a build archive and uploading your build to App Store Connect.

このステップではbuild archiveを生成し、あなたのビルドをApp Store Connectにアップロードします。

 

During development, you’ve been building, debugging, and testing with debug builds.

開発中は、debug buildsによりビルド・デバッグ・テストを行ってきました。

When you’re ready to ship your app to users on the App Store or TestFlight, you need to prepare a release build.

あなたのアプリをApp StoreあるいはTestFlightに送り出す準備ができたら、release buildを用意する必要があります。

At this point, you might consider obfuscating your Dart code to make it more difficult to reverse engineer.

この時点で、Dartのコードを難読化してリバースエンジニアリングを困難にすることを検討してみてください。

Obfuscating your code involves adding a couple flags to your build command.

コードを難読化するには、ビルドコマンドにいくつかのフラグを追加します。

 

In Xcode, configure the app version and build:

Xcodeで、アプリのバージョンとビルドを設定します:

1.In Xcode, open Runner.xcworkspace in your app’s ios folder.

1.Xcodeで、アプリのiosフォルダのRunner.xcworkspaceを開きます。

2.Select Runner in the Xcode project navigator, then select the Runner target in the settings view sidebar.

2.XcodeのプロジェクトナビゲーターのRunnerを選択し、settings view sidebarのRunnerを選択してください。

3.In the Identity section, update the Version to the user-facing version number you wish to publish.

3.Identityセクションにおいて、Versionをユーザーに見せるバージョンナンバーにアップデートします。

4.In the Identity section, update the Build identifier to a unique build number used to track this build on App Store Connect. Each upload requires a unique build number.

4.Identityセクションにおいて、Build識別子を、App Store Connectでビルドを追跡するために使用されるユニーク(一意)なビルドナンバーにアップデートします。

Finally, create a build archive and upload it to App Store Connect:

最後に、build archiveを生成して、それをApp Store Connectにアップロードします。

1.Run flutter build ipa to produce a build archive.

1.flutter build ipa

コマンドを実行してbuild archiveを生成します。

Note: On versions of Flutter where flutter build ipa is unavailable, open Xcode and select Product > Archive. In the sidebar of the Xcode Organizer window, select your iOS app, then select the build archive you just produced.

注意:flutter build ipa が利用できない Flutter のバージョンでは、Xcode を開き、Product > Archive を選択します。Xcode Organizerウィンドウのサイドバーで、自分のiOSアプリを選択し、先ほど作成したビルドアーカイブを選択します。

2.Open build/ios/archive/MyApp.xcarchive in Xcode.

2.Xcodeでbuild/ios/archive/MyApp.xcarchiveを開きます。

3.Click the Validate App button. If any issues are reported, address them and produce another build. You can reuse the same build ID until you upload an archive.

3.Validate Appボタンをクリックします。何らかの問題が報告された場合、それに対処して別のビルドを作成します。アーカイブをアップロードするまで、同じビルドIDを再利用することができます。

4.After the archive has been successfully validated, click Distribute App. You can follow the status of your build in the Activities tab of your app’s details page on App Store Connect.

4.Archiveの審査が通ったら、Distribute Appをクリックしてください。ビルドの状況は、App Store Connectのアプリの詳細ページにある「アクティビティ」タブで確認できます。

工事中🏗

 

You should receive an email within 30 minutes notifying you that your build has been validated and is available to release to testers on TestFlight.

30分以内に、ビルドが検証され、TestFlightでのテスターへのリリースが可能になったことを知らせるメールが届きます。

At this point you can choose whether to release on TestFlight, or go ahead and release your app to the App Store.

この時点で、TestFlightでリリースするか、App Storeでリリースするかを選択できます。

For more details, see Upload an app to App Store Connect.

詳細はUpload an app to App Store Connectをご覧ください。


Create a build archive with Codemagic CLI tools

Codemagic CLI toolsを使ってbuild archiveを生成する

This step covers creating a build archive and uploading your build to App Store Connect using Flutter build commands and Codemagic CLI Tools executed in a terminal in the Flutter project directory.

このステップでは、Flutterプロジェクトディレクトリ内のターミナルで実行されるFlutterビルドコマンドとCodemagic CLI Toolsを使用して、ビルドアーカイブを作成し、ビルドをApp Store Connectにアップロードする方法を説明します。

This allows you to create a build archive with full control of distribution certificates in a temporary keychain isolated from your login keychain.

これにより、ログインキーチェーンから分離された一時的なキーチェーンで、配布証明書を完全にコントロールしたビルドアーカイブを作成することができます。

1.Codemagic CLI toolsをインストールします。

pip3 install codemagic-cli-tools

2.You’ll need to generate an App Store Connect API Key with App Manager access to automate operations with App Store Connect.

2.App Store Connectでの操作を自動化するには、App ManagerにアクセスしてApp Store Connect API Keyを生成する必要があります。

To make subsequent commands more concise, set the following environment variables from the new key: issuer id, key id, and API key file.

以降のコマンドをより簡潔にするために、新しいキーから、発行者ID、キーID、APIキーファイルという環境変数を設定します。

export APP_STORE_CONNECT_ISSUER_ID=aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee
export APP_STORE_CONNECT_KEY_IDENTIFIER=ABC1234567
export APP_STORE_CONNECT_PRIVATE_KEY=`cat /path/to/api/key/AuthKey_XXXYYYZZZ.p8`

3.You need to export or create an iOS Distribution certificate to code sign and package a build archive.

ビルドアーカイブをコードサインしてパッケージ化するには、iOS Distribution証明書をエクスポートまたは作成する必要があります。

工事中🏗

 

 

 

 

 

コメントを残す

メールアドレスが公開されることはありません。 が付いている欄は必須項目です