Firebase Test Lab for iOS のスタートガイド
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
Firebase Test Lab を使用すると、さまざまなデバイスや構成でアプリの品質をテストできます。このガイドでは、Test Lab の主なコンセプト、iOS サービス、テストの開始手順の概要を説明します。
Test Lab の割り当てとお支払いプランの詳細については、使用量、割り当て、料金をご覧ください。
主なコンセプトと用語
選択したデバイスと構成に対して、テストまたは一連のテストケースを実行すると、Test Lab はアプリに対してテストを一括して実行し、その結果をテスト マトリックスとして表示します。
デバイス × テスト実行 = テスト マトリックス
- デバイス
- スマートフォン、タブレット、ウェアラブル デバイスなど、テストを実行する実機または仮想デバイス(Android のみ)。テスト マトリックス内のデバイスは、デバイスモデル、OS のバージョン、画面の向き、ロケール(地域や言語の設定とも呼ばれます)で識別されます。
- テスト、テスト実行
- デバイス上で実行するテスト(または一連のテストケース)。テストは、デバイスごとに 1 つ実行するか、必要に応じてシャーディングし、そのテストケースを複数のデバイスで実行できます。
- テスト マトリックス
- テストの実行状況とテスト結果が含まれます。マトリックス内のいずれかのテスト実行が失敗すると、マトリックス全体が失敗となります。
ステップ 1: Test Lab にアップロードするテストを準備する
Test Lab で次のテストを実行できます。実機では、すべてのテストタイプが最大 45 分実行できます。また、キャッチされない例外が発生すると、テストは失敗します。
XCTest(XCUITests を含む): XCTest フレームワークを使用して記述した単体テスト。Test Lab で実行する XCTest の変更手順については、XCTest の作成をご覧ください。
ゲームループ テスト: 「デモモード」を使用して、ゲームアプリでのプレーヤーの操作をシミュレートするテスト。複数のユーザーに対するゲームのパフォーマンスに問題がないことを確認できる、高速かつスケーラブルなテストです。ゲームループ テストの実行を選択すると、次のことを行えます。
Test Lab でテストを実行する手順については、ゲームループ テストの実行をご覧ください。
テストの実行には、次に挙げるツールを選択できます。
Firebase コンソールを使用すると、アプリをアップロードして、どこからでもテストを開始できます。このツールの使用方法については、Firebase コンソールを使用したテストをご覧ください。
gcloud コマンドライン インターフェース(CLI)では、コマンドラインからインタラクティブにテストを実行できます。また、自動化されたビルドとテストプロセスの一部として、スクリプト作成にも適しています。このツールの使用方法については、gcloud CLI を使用したテストをご覧ください。
実際のデバイスでテストする前に、シミュレータ上でローカルにテストを行い、意図したとおりに動作することを確認します。手順については、ローカルでテストを実行するをご覧ください。
ステップ 3: テストデバイスを指定する
Test Lab を使用すると、Google データセンターでホストされているさまざまな iOS デバイスやモデル上でアプリに対してテストを実行できます。詳細については、使用可能なデバイスをご覧ください。
ステップ 4: テスト結果を確認する
テストを開始する方法にかかわらず、すべてのテスト結果は Test Lab で管理され、オンラインで表示できます。
テスト結果の概要は、自動的に保存され、Firebase コンソールに表示できます。これには、テストケース固有の動画、スクリーンショット、合格、不合格、不安定な結果のテスト数など、テストに最も関連のあるデータが含まれています。
未処理のテスト結果はテストログとアプリのエラーの詳細を含み、Google Cloud バケットに自動的に保存されます。バケットを指定する場合は、ストレージの費用が発生します。指定しない場合、バケットは Test Lab によって無料で作成されます。
詳しくは、Firebase Test Lab の結果を分析するをご覧ください。
デバイスのクリーンアップ
Google ではアプリデータのセキュリティを重要視しています。業界標準のベスト プラクティスに従い、テストが終了するごとに、アプリデータを削除し、実機のシステム設定をリセットして、新しいテストを行う準備を整えます。カスタムのリカバリ イメージでフラッシュできるデバイスの場合は、テストを実行するたびにデバイスをフラッシュするためのステップを加えています。
Test Lab で仮想デバイスを使用する場合は、デバイスの使用後にそれらのインスタンスが削除されるため、どのテストでも新しい仮想デバイス インスタンスが使用されます。
Test Lab デバイスにプライベート バックエンド サーバーへのアクセスを許可する
一部のモバイルアプリは、テスト中に正常に動作するために、プライベート バックエンド サービスと通信する必要があります。バックエンド サーバーがファイアウォール ルールで保護されている場合は、以下の IP アドレス ブロックを使用して、ファイアウォールにルートを開くことで、Test Lab の実機と仮想デバイスのアクセスを許可できます。
モバイル広告
Test Lab はアプリのテストを自動化するスケーラブルなインフラストラクチャを提供していますが、この機能は不正な広告収益を生むように設計された悪意のあるアプリによって悪用される可能性があります。
この問題には次のように対処してください。
サードパーティのデジタル広告プロバイダ(広告ネットワーク、デマンドサイド プラットフォームなど)をご利用の場合は、アプリの開発とテスト時に、実際の広告ではなくテスト広告を使用することをおすすめします。
テストで実際の広告を使用する必要がある場合は、以下の IP アドレス ブロックを使用して、Test Lab から発生する収益と、対応するすべてのトラフィックを除外するように、ご利用のデジタル広告プロバイダに通知してください。Google が所有する広告プロバイダの場合は、Test Lab が対応するため、この通知を行う必要はありません。
Test Lab デバイスで使用される IP アドレス
Test Lab デバイスによって生成されるすべてのネットワーク トラフィックは、次の IP アドレス ブロックから発信されます。gcloud CLI で gcloud beta firebase test ip-blocks list
コマンド を使用してこのリストにアクセスすることもできます。このリストは平均して年に 1 回更新されます。
プラットフォームとデバイスのタイプ |
CIDR IP アドレス ブロック |
Android および iOS 搭載の実機、Arm 仮想デバイス |
70.32.128.0/19(2022 年 2 月に追加)
108.177.6.0/23
108.177.18.192/26(2022 年 2 月に追加)
108.177.29.64/27(2022 年 2 月に拡張)
108.177.31.160/27(2022 年 2 月に追加)
199.36.156.8/29(2022 年 2 月に追加)
199.36.156.16/28(2022 年 2 月に追加)
209.85.131.0/27(2022 年 2 月に追加)
2001:4860:1008::/48(2022 年 2 月に追加)
2001:4860:1018::/48(2022 年 2 月に追加)
2001:4860:1019::/48(2022 年 2 月に追加)
2001:4860:1020::/48(2022 年 2 月に追加)
2001:4860:1022::/48(2022 年 2 月に追加)
70.32.128.48/28(2024 年 4 月に追加)
|
Android Virtual Device(非 Arm) |
34.68.194.64/29(2019 年 11 月に追加)
34.69.234.64/29(2019 年 11 月に追加)
34.73.34.72/29(2019 年 11 月に追加)
34.73.178.72/29(2019 年 11 月に追加)
34.74.10.72/29(2022 年 2 月に追加)
34.136.2.136/29(2022 年 2 月に追加)
34.136.50.136/29(2022 年 2 月に追加)
34.145.234.144/29(2022 年 2 月に追加)
35.192.160.56/29
35.196.166.80/29
35.196.169.240/29
35.203.128.0/28
35.234.176.160/28
35.243.2.0/27(2019 年 7 月に追加)
35.245.243.240/29(2022 年 2 月に追加)
199.192.115.0/30
199.192.115.8/30
199.192.115.16/29
|
現在は使用されていないデバイス IP ブロック |
74.125.122.32/29(2022 年 2 月に削除)
216.239.44.24/29(2022 年 2 月に削除)
|
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2025-08-16 UTC。
[null,null,["最終更新日 2025-08-16 UTC。"],[],[],null,["\u003cbr /\u003e\n\nFirebase Test Lab lets you quality test your app on a range of devices and\nconfigurations. This guide provides an overview of Test Lab's key concepts,\niOS offerings, and instructions on how to start testing.\n\nFor information about Test Lab quotas and pricing plans, see\n[Usage, Quotas, and Pricing](../usage-quotas-pricing).\n\nKey concepts and terms\n\nWhen you run a test or a set of test cases against devices and configurations\nyou've selected, Test Lab runs the test against your app in a batch, then\ndisplays the results as a **test matrix**.\n\n**Devices × Test Executions = Test Matrix**\n\nDevice\n: A physical or virtual device (Android only) you run a test on, such as a\n phone, tablet, or wearable device. Devices in a test matrix are identified by\n device model, OS version, screen orientation, and locale (also known as\n geography and language settings).\n\nTest, test execution\n: A test (or a set of test cases) to be run on a device. You can run one test\n per device, or optionally shard the test and run its test cases on\n different devices.\n\nTest matrix\n: Contains the statuses and test results for your test executions. If any\n test execution in a matrix fails, the whole matrix fails.\n\n*** ** * ** ***\n\n**Step 1** : Prepare your test for uploading to Test Lab\n\nYou can run the following tests with Test Lab. Note that all test types can\nrun up to a maximum of 45 minutes on physical devices, and any uncaught\nexception will cause a test failure.\n\n- **XCTest (including XCUITests)** : A unit test you've written using the\n [XCTest framework](https://developer.apple.com/documentation/xctest).\n Visit [Create an XCTest](/docs/test-lab/ios/run-xctest) for instructions on modifying an\n XCTest to run with Test Lab.\n\n- **Game Loop test**: A test that uses a \"demo mode\" to\n simulate player actions in gaming apps. This is a fast and scalable way\n to verify that your game performs well for users. When you choose to run a\n Game Loop test, you can:\n\n - Write tests native to your game engine.\n\n - Avoid writing the same code for different UIs or testing\n frameworks.\n\n - Optionally create multiple loops to run in a single test execution. You\n can also organize loops by using labels so you can keep track of them and\n re-run specific loops.\n\n Visit [Run a Game Loop test](/docs/test-lab/ios/run-game-loop-test) for instructions on how to\n run your test in Test Lab.\n\n**Step 2**: Choose a tool to run your test\n\nYou can choose the following tools to run your test with:\n\n- The **Firebase console** lets you upload an\n app and initiate testing from anywhere. See\n [Test with the Firebase console](/docs/test-lab/ios/firebase-console)\n for instructions on using this tool.\n\n- The **gcloud command line interface (CLI)** enables you to run tests\n from the command line interactively, and is also well suited for scripting as\n part of your automated build and testing process. See [Test with the gcloud CLI](/docs/test-lab/ios/command-line)\n for instructions on using this tool.\n\n- Before testing on real devices, run your test **locally on a simulator** to\n make sure it behaves as intended. See\n [Test locally](/docs/test-lab/ios/test-locally) for instructions.\n\n**Step 3**: Specify testing devices\n\nWith Test Lab, you can run your test against your app on a wide range of iOS\ndevices and models hosted in a Google data center. To learn more, see\n[Available devices.](/docs/test-lab/ios/available-testing-devices)\n\n**Step 4**: Review test results\n\nRegardless of how you initiate your tests, all your test results are managed by\nTest Lab and can be viewed online.\n\nThe **test result summary** is\nautomatically stored and can be viewed in the Firebase console. It contains\nthe most relevant data for your test, including test case-specific videos,\nscreenshots, the number of tests that passed, failed, or got flaky results, and\nmore.\n\nThe **raw test results** contain test logs and app failure details, and is\nautomatically stored in a Google Cloud bucket. If you specify a bucket, you are\nresponsible for the cost of the storage. If you don't specify a bucket,\nTest Lab creates one for you at no cost.\n\nFor more details, see\n[Analyze Firebase Test Lab Results.](/docs/test-lab/analyzing-results)\n\nDevice cleanup\n\nGoogle takes the security of your app data very seriously. We follow\nindustry-standard best practices to remove app data and reset system settings\nfor physical devices after every test run to ensure that they are\nready to run new tests. For devices that we can flash with a custom recovery\nimage, we go one step further by flashing these devices between test runs.\n\nFor the virtual devices used by Test Lab, device instances are deleted after\nthey are used so that each test run uses a new virtual device instance.\n\n*** ** * ** ***\n\nAllowing Test Lab devices to access private backend servers\n\nSome mobile apps need to communicate with private backend services to function\ncorrectly during testing. If your backend servers are protected by firewall\nrules, you can allow access for Test Lab's physical and virtual devices by\nusing the [IP address blocks below](#ip-blocks) to open routes through your\nfirewall.\n\nMobile advertising\n\nTest Lab provides a scalable infrastructure that automates app testing, and\nunfortunately, this capability can be misused by malicious apps designed to\ngenerate fraudulent ad revenue.\n\nTo mitigate this issue:\n\n- If you use or work with third-party digital advertising providers\n (for example, ad networks or demand-side platforms),\n you're recommended to use test ads rather than real ads during app development\n and testing.\n\n- If you must use real ads in your test, notify the digital advertising\n providers you work with to filter out revenues and all corresponding traffic\n generated from Test Lab by using the\n [IP address blocks below](#ip-blocks). You don't need\n to notify Google-owned ad providers; Test Lab takes care of that for you.\n\nIP addresses used by Test Lab devices\n\nAll network traffic generated by Test Lab devices originates from the\nfollowing\n[IP address blocks](https://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing#CIDR_notation).\nYou can also access this list by using the\n`gcloud beta firebase test ip-blocks list`\n[command](https://cloud.google.com/sdk/gcloud/reference/beta/firebase/test/ip-blocks/list)\nin the [gcloud](https://cloud.google.com/sdk/gcloud) CLI. The list is updated on\naverage once a year.\n\n| Platform and device type | CIDR IP address block |\n|-------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Android and iOS physical devices, Arm virtual devices | 70.32.128.0/19 (added 02-2022) 108.177.6.0/23 108.177.18.192/26 (added 02-2022) 108.177.29.64/27 (expanded 02-2022) 108.177.31.160/27 (added 02-2022) 199.36.156.8/29 (added 02-2022) 199.36.156.16/28 (added 02-2022) 209.85.131.0/27 (added 02-2022) 2001:4860:1008::/48 (added 02-2022) 2001:4860:1018::/48 (added 02-2022) 2001:4860:1019::/48 (added 02-2022) 2001:4860:1020::/48 (added 02-2022) 2001:4860:1022::/48 (added 02-2022) 70.32.128.48/28 (added 04-2024) |\n| Android virtual devices (Non-Arm) | 34.68.194.64/29 (added 11-2019) 34.69.234.64/29 (added 11-2019) 34.73.34.72/29 (added 11-2019) 34.73.178.72/29 (added 11-2019) 34.74.10.72/29 (added 02-2022) 34.136.2.136/29 (added 02-2022) 34.136.50.136/29 (added 02-2022) 34.145.234.144/29 (added 02-2022) 35.192.160.56/29 35.196.166.80/29 35.196.169.240/29 35.203.128.0/28 35.234.176.160/28 35.243.2.0/27 (added 7-2019) 35.245.243.240/29 (added 02-2022) 199.192.115.0/30 199.192.115.8/30 199.192.115.16/29 |\n| Device IP-blocks no longer being used | 74.125.122.32/29 (removed 02-2022) 216.239.44.24/29 (removed 02-2022) |"]]