필수 API 사용 설정. 서비스 계정으로 로그인한 후 Google Developers Console API 라이브러리 페이지에서 Google Cloud Testing API 및 Cloud Tool Results API를 사용 설정합니다. 이러한 API를 사용 설정하려면 Console 상단의 검색창에 API 이름을 입력하고 API의 개요 페이지에서 API 사용 설정을 클릭합니다.
Jenkins 설치 및 설정
Linux 또는 Windows에 Jenkins CI를 설치하고 설정할 수 있습니다. 이 가이드의 특정 세부내용은 Linux에 Jenkins CI를 설치하여 실행할 때를 기준으로 합니다(예: 파일 경로에 슬래시(/) 사용).
Linux 또는 Windows를 실행하는 컴퓨터에 Jenkins를 다운로드하여 설치하려면 Jenkins 설치의 안내를 따릅니다. Jenkins를 설치한 후
Jenkins 시작 및 액세스의 안내에 따라
설정을 완료하고 Jenkins 대시보드에 액세스합니다.
전역 보안 설정 구성
Jenkins를 처음 설치하면 사용자 인증 및 액세스 제어가 구성되어 있지 않습니다. Jenkins와 함께 Firebase Test Lab을 사용하려면 전역 보안 설정을 구성하여 액세스 제어를 적용하고 사용자를 인증해야 합니다.
전역 보안 설정을 구성하는 방법
서버에서 Jenkins 대시보드로 이동합니다. 이렇게 하려면
http://<servername>:8080을 탐색합니다. 여기에서 <servername>은
Jenkins를 설치한 컴퓨터의 이름입니다.
Jenkins 대시보드에서 Manage Jenkins를 클릭하고
Configure Global Security를 클릭합니다.
Configure Global Security 페이지에서 Enable security를 클릭하고
Save를 클릭합니다.
Test Lab으로 테스트할 때 Gradle이 생성한 APK 패키지를 사용하는 빌드 단계를 추가합니다. 이 경로를 아래의 셸 스크립트 예에서 <local_server_path>로 사용할 수 있습니다. 여기에서 <AppFolder>는 앱의 Android 스튜디오 프로젝트 폴더입니다.
<AppFolder>/app/build/outputs/apk
Jenkins에 Test Lab 빌드 단계 추가
이제 gcloud 명령줄을 사용하여 Test Lab을 실행하는 빌드 단계를 Jenkins에 추가할 준비가 되었습니다.
Jenkins Execute shell command 창에 다음을 입력합니다.
이때 <local_server_path> 대신 서버의 샘플 앱 경로를,
<app_apk> 대신 앱의 APK를,
<app_test_apk> 대신 앱의 테스트 APK를 입력합니다.
gcloud firebase test android run --app <local_server_path>/<app_apk>.apk
--test <local_server_path>/<app_test_apk>.apk
테스트 결과 분석
Test Lab에서 앱 테스트가 완료되면 Firebase Console이나 프로젝트의 Google Cloud Storage 버킷에서 테스트 결과를 검토할 수 있습니다. 위에 표시된 셸 명령어에 gsutil 명령어를 추가하여 테스트 결과 데이터를 로컬 컴퓨터로 복사할 수도 있습니다.
자세한 내용은 Firebase Test Lab 결과 분석을 참조하세요.
다른 CI 시스템과 지속적 통합
Firebase Test Lab을 다른 CI 시스템과 함께 사용하는 방법은 해당 문서를 참조하세요.
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["필요한 정보가 없음","missingTheInformationINeed","thumb-down"],["너무 복잡함/단계 수가 너무 많음","tooComplicatedTooManySteps","thumb-down"],["오래됨","outOfDate","thumb-down"],["번역 문제","translationIssue","thumb-down"],["샘플/코드 문제","samplesCodeIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-08-29(UTC)"],[],[],null,["\u003cbr /\u003e\n\nYou can use Firebase Test Lab when developing your app using any continuous\nintegration (CI) system. Continuous integration systems let you automatically\nbuild and test your app each time you check in updates to your app source code.\n\nUsing Firebase Test Lab with Jenkins CI\n\nThis section describes how to use Test Lab with\n[Jenkins CI](http://jenkins-ci.org/).\n\nRequirements\n\nBefore you can use Firebase Test Lab with Jenkins, you need to complete the\nfollowing steps:\n\n1. **Set up gcloud.** Follow the instructions from\n [Using Firebase Test Lab from the gcloud Command Line](/docs/test-lab/android/command-line)\n to create a Firebase project and configure your local Google Cloud SDK\n environment.\n\n2. **Create and authorize a service account.** Service accounts aren't subject\n to spam checks or captcha prompts, which could otherwise block your CI\n builds. Create a service account with an **Editor** role in the\n [Google Cloud console](https://console.cloud.google.com/iam-admin/serviceaccounts/)\n and then activate it\n (see the [gcloud auth activate-service-account documentation](https://cloud.google.com/sdk/gcloud/reference/auth/activate-service-account)\n to learn how).\n\n3. **Enable required APIs.** After logging in using the service account: In the\n [Google Developers Console API Library page](https://console.developers.google.com/apis/library),\n enable the **Google Cloud Testing API** and **Cloud Tool Results API** . To\n enable these APIs, type these API names into the search box at the top of the\n console, and then click **Enable API** on the overview page for that API.\n\nInstall and set up Jenkins\n\nYou can install and set up Jenkins CI on Linux or Windows. Certain details of\nthis guide are specific to installing and running Jenkins CI on Linux, including\nthe use of slashes (`/`) in file paths.\n\nTo download and install Jenkins on a computer running Linux or Windows, follow\nthe instructions on [Installing\nJenkins](https://wiki.jenkins-ci.org/display/JENKINS/Installing+Jenkins). After\ninstalling Jenkins, follow the instructions on\n[Starting and Accessing Jenkins](https://wiki.jenkins-ci.org/display/JENKINS/Starting+and+Accessing+Jenkins)\nto complete setup and access the Jenkins dashboard.\n\nConfigure global security settings\n\nJenkins does not have user authentication and access control configured when it\nis first installed. Before using Jenkins with Firebase Test Lab, configure\nglobal security settings to enforce access control and authenticate\nusers.\n\nTo configure global security settings\n\n1. Navigate to the Jenkins dashboard on your server. To do this, browse to **http://\\\u003cservername\\\u003e:8080** , where **\\\u003cservername\\\u003e** is the name of the computer where you have installed Jenkins.\n2. On the Jenkins dashboard, click **Manage Jenkins** , and then click **Configure Global Security**.\n3. On the **Configure Global Security** page, click **Enable security** , and then click **Save**.\n\nFor more information about configuring security settings for Jenkins, see\n[Quick and Simple Security](https://wiki.jenkins-ci.org/display/JENKINS/Quick+and+Simple+Security),\n[Standard Security Setup](https://wiki.jenkins-ci.org/display/JENKINS/Standard+Security+Setup),\nand\n[Securing Jenkins](https://wiki.jenkins-ci.org/display/JENKINS/Securing+Jenkins).\n\nCreate a Jenkins project\n\nNext, create a project for running continuous integration testing of your app\nwith Firebase Test Lab.\n\nTo create a Jenkins project\n\n1. Navigate to the Jenkins dashboard on your server. To do this, browse to **http://\\\u003cservername\\\u003e:8080** , where **\\\u003cservername\\\u003e** is the name of the computer where you have installed Jenkins.\n2. On the Jenkins dashboard, click **New Item**.\n3. Type a name for your project in the **Item name** field:\n - Choose **Freestyle project** to create a project that uses a single build configuration.\n - Choose **Build multi-configuration project** to create a project that runs on multiple different build configurations. If you plan to build your app with a variety of build configurations (multiple locales, multiple Android API levels, etc.), then a multi-configuration project is the best choice.\n4. Click **Save**.\n\nAfter your project is created, your web browser displays the main page for your\nproject.\n\nAdd revision control and Gradle build steps\n\nThis section describes how to integrate Jenkins with revision control systems\nsuch as GitHub, and how to add Gradle build steps to build APK packages\nfrom source code.\n\nIntegrating with GitHub and other revision control systems\n\nIf you use GitHub or another revision control system to manage the source code\nfor your app, you can configure Jenkins to run automated builds and run tests\neach time updates to your app are checked in. You can also configure\nJenkins to run builds periodically.\n\nTo learn about configuring builds in Jenkins, see\n[Configuring automatic builds](https://wiki.jenkins-ci.org/display/JENKINS/Building+a+software+project#Buildingasoftwareproject-Configuringautomaticbuilds).\n\nAdding Gradle build steps to rebuild APK packages\n\nIf you use a revision control system to manage source code for your app, you\nneed to include a Gradle build step to create new APK binaries each time Jenkins\ndownloads source code from your revision control system.\n\n1. Add a build step to run the following commands in the main directory for your\n application:\n\n ```\n ./gradlew :app:assembleDebug\n ./gradlew :app:assembleDebugAndroidTest\n ```\n\n \u003cbr /\u003e\n\n2. Add a build step to use the APK package(s) created by Gradle when testing\n with Test Lab. You can use this path as the\n **\\\u003clocal_server_path\\\u003e** in the shell script example provided below,\n where **\\\u003cAppFolder\\\u003e** is the Android Studio project folder for your\n app:\n\n ```\n \u003cAppFolder\u003e/app/build/outputs/apk\n ```\n\n \u003cbr /\u003e\n\nAdd Test Lab build steps to Jenkins\n\nNow you are ready to add a build step to Jenkins to run Test Lab using\nthe gcloud command line.\n\nTo add a gcloud build step\n\n1. From the main page for your project, click **Configure**.\n2. On the **project configuration** page, scroll down to the **Build** section,\n and then choose **Execute shell** from the **Add build step** menu.\n\n3. In the **Jenkins Execute shell command** window, enter the following,\n substituting **\\\u003clocal_server_path\\\u003e** for the path to the sample app on\n the server, **\\\u003capp_apk\\\u003e** for your app's APK, and\n **\\\u003capp_test_apk\\\u003e** for your app's test APK:\n\n ```\n gcloud firebase test android run --app \u003clocal_server_path\u003e/\u003capp_apk\u003e.apk\n --test \u003clocal_server_path\u003e/\u003capp_test_apk\u003e.apk\n ```\n\n \u003cbr /\u003e\n\nAnalyze test results\n\nAfter Test Lab completes testing of your app, you can review test\nresults in the Firebase console or in a\n[Google Cloud Storage](//cloud.google.com/storage/) bucket in\nyour project. You can also add a\n[`gsutil`](//cloud.google.com/storage/docs/gsutil) command to the\nshell command shown above to copy the test results data to your local computer.\nTo learn more, see\n[Analyzing Firebase Test Lab Results](/docs/test-lab/analyzing-results).\n\nContinuous integration with other CI systems\n\nTo learn how to use Firebase Test Lab with other CI systems, check out\ntheir docs:\n\n- [Bitrise](//devcenter.bitrise.io/testing/device-testing-for-android/)\n- [Circle CI](//circleci.com/docs/2.0/language-android/#testing-with-firebase-test-lab)\n\n| **Note:** If you create documentation explaining how to use Firebase Test Lab with another CI system, [contact us](mailto:cloud-test-lab-integration@google.com) so that we can review it for inclusion in this section."]]