cancel(name, body=None, x__xgafv=None)
Cancels an in-progress automation session. This RPC returns immediately and cancellation proceeds asynchronously. If the session is already finished, this RPC will have no effect.
Close httplib2 connections.
create(parent, body=None, requestId=None, sessionId=None, x__xgafv=None)
Starts an automation session with the specified configuration. This method returns a long-running `Operation`, awaiting the completion of all jobs in the session.
delete(name, requestId=None, x__xgafv=None)
Deletes a session. This RPC returns immediately and deletion proceeds asynchronously. It will cancel the session at first if it is still running.
get(name, view=None, x__xgafv=None)
Returns information about a previously created automation session.
list(parent, filter=None, orderBy=None, pageSize=None, pageToken=None, view=None, x__xgafv=None)
Lists previously created automation sessions. Sessions may still be in-progress, or may have finished successfully, or unsuccessfully.
list_next(previous_request, previous_response)
Retrieves the next page of results.
cancel(name, body=None, x__xgafv=None)
Cancels an in-progress automation session. This RPC returns immediately and cancellation proceeds asynchronously. If the session is already finished, this RPC will have no effect.
Args:
name: string, Required. The name of the session. Format: "projects/{project}/locations/{location}/sessions/{session}" (required)
body: object, The request body.
The object takes the form of:
{ # Request to cancel a session.
}
x__xgafv: string, V1 error format.
Allowed values
1 - v1 error format
2 - v2 error format
Returns:
An object of the form:
{ # Response of the cancel session request.
"cancelResult": "A String", # The result of the request.
}
close()
Close httplib2 connections.
create(parent, body=None, requestId=None, sessionId=None, x__xgafv=None)
Starts an automation session with the specified configuration. This method returns a long-running `Operation`, awaiting the completion of all jobs in the session.
Args:
parent: string, Required. The parent resource where this session will be created. Format: `projects/{project}/locations/{location}`. (required)
body: object, The request body.
The object takes the form of:
{ # A session resource in the AutomationSession API. At a high level, `Session` describes the configuration of one or multiple jobs, the state transitions it goes through, and the results.
"name": "A String", # Identifier. The resource name of the session. Format: `projects/{project}/locations/{location}/sessions/{session}`.
"sessionConfig": { # SessionConfig is used to create a session. # Required. Configuration used to create the session.
"displayName": "A String", # Optional. User-settable, human-readable name for the session. Maximum size is 63 bytes when encoded as UTF-8. If set, must match regex: `^A-Za-z0-9*$`.
"jobConfigs": [ # Required. Configs of the jobs in the session.
{ # The configuration of a job.
"action": { # The action to be performed in a job. # Required. Job action.
"androidInstrumentationTest": { # The configuration of an Android instrumentation test. See https://developer.android.com/training/testing/instrumented-tests for more information on Android instrumentation tests. # Android instrumentation test.
"additionalTestOptions": { # Optional. Additional test options to pass to the test runner. Passed to `am instrument` command as `-e` options, which will be passed to the instrumentation test runner using its `onCreate()` method. Formats supported in test_targets are not allowed to be used here. Limits: - Maximum number of entries: 32. - Maximum key size: 64 bytes (UTF-8). - Maximum value size: 1024 bytes (UTF-8).
"a_key": "A String",
},
"enableCodeCoverage": True or False, # Optional. Whether to enable code coverage collection for the test. A coverage file `coverage.ec` will be uploaded to the results folder. For this to work, your classes have to be instrumented offline (build time) by EMMA/JaCoCo.
"instrumentationTimeout": "A String", # Optional. The timeout of the instrumentation test. Default value: 5 min. Range: [1 min, 3 hours].
"orchestratorVersion": "A String", # Optional. The version of the Android Test Orchestrator to use for the test. The available orchestrator versions can be retrieved from the catalog service. If set to "auto", the default orchestrator is used. If not set, no orchestrator is used.
"smartSharding": { # The smart sharding strategy to split the job into multiple shards based on the test methods and their recorded execution time. # Optional. Smart sharding strategy to split the job into multiple shards based on the test methods and their execution time.
"maxShardCount": 42, # Optional. The maximum number of shards to create. If unset or less than 1, system-defined max limits are used. This limit takes precedence if the targeted_shard_duration cannot be satisfied. Limits: - For physical devices, the number of shards must be <= 20. - For virtual devices, the number of shards must be <= 200.
"targetedShardDuration": "A String", # Required. The targeted duration of each shard. Limits: - Must be at least 2 minutes. - Must be at most 3 hours. Shard duration is not guaranteed because smart sharding uses test case history and default durations which may not be accurate. Durations are calculated based on the following inputs: - Timing records from previous runs of the same test case. - For new test cases, the average duration of other known test cases. - A system-chosen, default duration if there are no previous timing records available. Because the actual shard duration can exceed the targeted shard duration, we recommend that you set the targeted value at least 5 minutes less than the maximum allowed instrumentation timeout. This approach avoids cancelling the shard before all tests can finish.
"timingRecord": { # Input file. # Required. The timing record file to use for smart sharding. If the file does not exist, smart sharding will use default test time (30s) for each test method to shard the job into multiple shards. This file will be overwritten with the latest timing record after the job is completed.
"gcsInputFile": { # A path to a file or directory in Google Cloud Storage. # An input file in Google Cloud Storage.
"path": "A String", # Required. The Google Cloud Storage path of the file or directory. Format: `gs:///`.
},
},
},
"testInstallable": { # An Android Installable represents the file(s) for installing an Android package on a device. This can be an APK, an Android App Bundle (AAB), or an APK Set. # Required. The test package to install and run the test.
"files": [ # Required. Files that make up the package. Supported formats are distinguished by their file extension: - APK: One or more files with extension `.apk`. - App Bundle: A single file with extension `.aab`. - APK Set: A single file with extension `.apks`.
{ # Input file.
"gcsInputFile": { # A path to a file or directory in Google Cloud Storage. # An input file in Google Cloud Storage.
"path": "A String", # Required. The Google Cloud Storage path of the file or directory. Format: `gs:///`.
},
},
],
},
"testRunnerClass": "A String", # Optional. Full class name of the test runner class. The class must be `androidx.test.runner.AndroidJUnitRunner` or a subclass of it. The default value is determined by examining the application's manifest. If multiple instrumentations are found, the first one in the manifest will be used.
"testTargets": [ # Optional. A list of test targets or target filters to run. Each target must be fully qualified with the package name or class name, in one of these formats: - `package package_name` - `notPackage com.package.to.skip` - `class package_name.class_name` - `class package_name.class_name#method_name` - `notClass com.foo.ClassToSkip` - `notClass com.foo.ClassName#testMethodToSkip` - `annotation com.foo.AnnotationToRun` - `notAnnotation com.foo.AnnotationToSkip` - `size [small|medium|large]` Formats like `testfile` or `notTestfile` won't be supported. If empty, all targets in the module will be run. Limits: - Maximum number of entries: 1024.
"A String",
],
"uniformSharding": { # Uniformly shards test cases given a total number of shards. It will be translated to `-e numShard` and `-e shardIndex` AndroidJUnitRunner arguments. With uniform sharding enabled, specifying either of these sharding arguments via `environment_variables` is invalid. Based on the sharding mechanism AndroidJUnitRunner uses, there is no guarantee that test cases will be distributed uniformly across all shards. # Optional. Uniform sharding strategy to split the job into multiple shards with equal number of test methods.
"shardCount": 42, # Required. The total number of shards to create. This must always be a positive number that is no greater than the total number of test cases. Limits: - For physical devices, the number of shards must be <= 20. - For virtual devices, the number of shards must be <= 200.
},
},
"androidNativeBinary": { # The configuration of an Android native binary execution. # Android native binary execution.
"androidNativeBinary": { # Input file. # Required. The file path of the Android native binary.
"gcsInputFile": { # A path to a file or directory in Google Cloud Storage. # An input file in Google Cloud Storage.
"path": "A String", # Required. The Google Cloud Storage path of the file or directory. Format: `gs:///`.
},
},
"args": [ # Optional. Arguments for running the binary file. The flags will be appended to the command line that invokes the binary. The number of options is limited to 100.
"A String",
],
"envVars": { # Optional. A map of environment variables to set for the binary process. The keys are the variable names and the values are the variable values. The maximum number of entries is 100. Each key is limited to 128 characters and must conform to POSIX standards. Each value is limited to 2048 characters. The total size of all environment variables must not exceed 16 KiB.
"a_key": "A String",
},
"executionTimeout": "A String", # Optional. The timeout of the execution. Default value: 5 min. Range: [1 min, 3 hours].
},
"iosXcTest": { # The configuration of an iOS XCTest. # iOS XCTest.
"testsZip": { # Input file. # Required. The .zip containing the .xctestrun file and the contents of the DerivedData/Build/Products directory.
"gcsInputFile": { # A path to a file or directory in Google Cloud Storage. # An input file in Google Cloud Storage.
"path": "A String", # Required. The Google Cloud Storage path of the file or directory. Format: `gs:///`.
},
},
"xcTestTimeout": "A String", # Optional. The timeout of the test. Default value: 5 min. Range: [1 min, 3 hours].
"xcodeVersion": "A String", # Optional. The Xcode version that should be used for the test. If not set, a system-default Xcode version is used. The available Xcode versions can be retrieved from the catalog service.
"xctestrun": { # Input file. # Optional. An .xctestrun file that will override the .xctestrun file in the tests zip.
"gcsInputFile": { # A path to a file or directory in Google Cloud Storage. # An input file in Google Cloud Storage.
"path": "A String", # Required. The Google Cloud Storage path of the file or directory. Format: `gs:///`.
},
},
},
},
"allocationConfig": { # Allocation config. # Required. Allocation config.
"deviceConfigs": [ # Required. At least one device config is required. If more than one device config is required, the multiple devices are allocated to each shard of the OmniLab job to run multi-device-interaction tests.
{ # The configuration of a run on a device.
"actions": [ # Optional. The actions to be performed on the device. Actions will be executed in the order they are specified in the list. Each action type can at most have 1 instance in the list.
{ # The action to be performed on a device.
"androidBugreport": { # Captures a bugreport from the device. The output will be written to a file named `bugreport.zip` in the execution output directory. # Captures a bugreport from the device unless the test result is pass.
"collectOnPass": True or False, # Optional. Whether to deliver the bugreport when the test passes. If false, the bugreport is skipped on pass to save time (default behavior). If true, the bugreport is always delivered.
},
"androidDumpsys": { # Captures dumpsys output from the device. The output will be written to a file named `dumpsys.log` in the execution output directory. # Captures a dumpsys from the device.
"collectOnPass": True or False, # Optional. Whether to deliver the dumpsys when the test passes. If false, the dumpsys is skipped on pass to save time (default behavior). If true, the dumpsys is always delivered.
},
"androidInstallPackages": { # Installs Android packages on the device. At least one installable is specified when using this device action. Limits: - A maximum of 20 installables in total are allowed. - A maximum of 100 files are allowed in total across all installables. # Installs Android packages on the device.
"installables": [ # Optional. Deprecated: use `pre_target_app_installables`, `target_app` and `post_target_app_installables` instead. The Android packages to install on the device. The installation will be performed in the order specified, before the installables of all other fields.
{ # An Android Installable represents the file(s) for installing an Android package on a device. This can be an APK, an Android App Bundle (AAB), or an APK Set.
"files": [ # Required. Files that make up the package. Supported formats are distinguished by their file extension: - APK: One or more files with extension `.apk`. - App Bundle: A single file with extension `.aab`. - APK Set: A single file with extension `.apks`.
{ # Input file.
"gcsInputFile": { # A path to a file or directory in Google Cloud Storage. # An input file in Google Cloud Storage.
"path": "A String", # Required. The Google Cloud Storage path of the file or directory. Format: `gs:///`.
},
},
],
},
],
"postTargetAppInstallables": [ # Optional. The Android packages to install on the device after `target_app` (if specified) is installed. The installation will be performed in the order specified.
{ # An Android Installable represents the file(s) for installing an Android package on a device. This can be an APK, an Android App Bundle (AAB), or an APK Set.
"files": [ # Required. Files that make up the package. Supported formats are distinguished by their file extension: - APK: One or more files with extension `.apk`. - App Bundle: A single file with extension `.aab`. - APK Set: A single file with extension `.apks`.
{ # Input file.
"gcsInputFile": { # A path to a file or directory in Google Cloud Storage. # An input file in Google Cloud Storage.
"path": "A String", # Required. The Google Cloud Storage path of the file or directory. Format: `gs:///`.
},
},
],
},
],
"preTargetAppInstallables": [ # Optional. The Android packages to install on the device before `target_app` (if specified) is installed. The installation will be performed in the order specified.
{ # An Android Installable represents the file(s) for installing an Android package on a device. This can be an APK, an Android App Bundle (AAB), or an APK Set.
"files": [ # Required. Files that make up the package. Supported formats are distinguished by their file extension: - APK: One or more files with extension `.apk`. - App Bundle: A single file with extension `.aab`. - APK Set: A single file with extension `.apks`.
{ # Input file.
"gcsInputFile": { # A path to a file or directory in Google Cloud Storage. # An input file in Google Cloud Storage.
"path": "A String", # Required. The Google Cloud Storage path of the file or directory. Format: `gs:///`.
},
},
],
},
],
"targetApp": { # An Android Installable represents the file(s) for installing an Android package on a device. This can be an APK, an Android App Bundle (AAB), or an APK Set. # Optional. The primary Android package to install, serving as the target package for subsequent actions and as the installation ordering anchor. Whether this package is treated as the application under test depends on the job action: - Actions that require an explicit target package (such as performance metrics collection, or accessibility scans) use this package to identify the application to inspect or drive. - Actions that discover or manage targets independently (such as Android instrumentation tests, where target packages are defined in the test runner manifest) treat this field primarily as an installation order anchor between pre- and post-installables. Optional. If omitted, all packages in `pre_target_app_installables` and `post_target_app_installables` are installed without a designated target package.
"files": [ # Required. Files that make up the package. Supported formats are distinguished by their file extension: - APK: One or more files with extension `.apk`. - App Bundle: A single file with extension `.aab`. - APK Set: A single file with extension `.apks`.
{ # Input file.
"gcsInputFile": { # A path to a file or directory in Google Cloud Storage. # An input file in Google Cloud Storage.
"path": "A String", # Required. The Google Cloud Storage path of the file or directory. Format: `gs:///`.
},
},
],
},
},
"androidLogcat": { # Collects logcat output from the device. The output will be written to a file named `logcat.txt` in the execution output directory. # Collects logcat output from the device.
},
"androidMockLocation": { # Mocks the location of the Android device. # Mocks the location of the device.
"location": { # An object that represents a latitude/longitude pair. This is expressed as a pair of doubles to represent degrees latitude and degrees longitude. Unless specified otherwise, this object must conform to the WGS84 standard. Values must be within normalized ranges. # Required. The mock location to set on the device.
"latitude": 3.14, # The latitude in degrees. It must be in the range [-90.0, +90.0].
"longitude": 3.14, # The longitude in degrees. It must be in the range [-180.0, +180.0].
},
},
"androidOrientation": { # Sets the orientation of the device. # Sets the orientation of the device.
"orientation": "A String", # Required. The orientation to set the device to. One of `portrait` or `landscape`.
},
"androidPullFiles": { # Pulls directories and files from the device at the end of the run. Files will be copied to the '/artifacts' directory, with the absolute path structure preserved. Note that: 1. A clean device is provided for the run. 2. Any existing files in the output directory may be overwritten. 3. Pulling files is best effort. Will skip files if they don't exist on the device. # Pulls directories and files from the device at the end of the run.
"paths": [ # Required. Absolute directory or file paths to pull from the device. Limits: - A maximum of 10 paths are allowed.
"A String",
],
},
"androidPushFiles": { # Pushes files to the device at the beginning of the run. Files are overwritten if a file with the same path already exists on the device, if device permissions allow. # Pushes files to the device at the beginning of the run.
"fileConfigs": [ # Required. Configs of pushing files to the device. Limits: - A maximum of 50 files are allowed.
{ # The configuration of pushing a file to the device.
"destinationPath": "A String", # Required. The destination path on the device.
"sourceFile": { # Input file. # Required. The file to be pushed to the device.
"gcsInputFile": { # A path to a file or directory in Google Cloud Storage. # An input file in Google Cloud Storage.
"path": "A String", # Required. The Google Cloud Storage path of the file or directory. Format: `gs:///`.
},
},
},
],
},
"androidRecordVideo": { # Records a video of the device screen during the run. The video will be written to a file named `video.mp4` in the execution output directory. # Records a video of the device screen during the run.
"discardOnPass": True or False, # Optional. Whether to discard and not upload the recording when the test passes. Default is false.
},
"androidSwitchLocale": { # Switches the locale (language and region) of the device. # Switches the locale (language and region) of the device.
"localeCode": "A String", # Required. The locale (language and region) to switch the device to. The format is `language-region`, e.g. "en-US", "zh-CN", etc. The typical language value is a two or three-letter language code as defined in ISO639. The typical region value is a two-letter ISO 3166 code or a three-digit UN M.49 area code.
},
"iosAppPrivacyReport": { # Collects the exported iOS App Privacy Report during the test run. When enabled, the iOS device records application activity (such as network access, domain requests, and sensitive resource access like photos, camera, or location) and exports Apple's official App Privacy Report. The report will be written to a file named `AppActivityReport.ndjson` in the execution output directory. # Collects the exported iOS App Privacy Report during the run.
},
"iosInstallPackages": { # Installs iOS packages on the device. # Installs additional iOS packages on the device.
"ipas": [ # Required. Additional iOS packages (IPAs) to install on the device. Limits: - A maximum of 20 IPAs are allowed.
{ # Input file.
"gcsInputFile": { # A path to a file or directory in Google Cloud Storage. # An input file in Google Cloud Storage.
"path": "A String", # Required. The Google Cloud Storage path of the file or directory. Format: `gs:///`.
},
},
],
},
"iosPullFiles": { # Pulls directories and files from the iOS device sandbox at the end of the run. # Pulls directories and files from the iOS device sandbox at the end of the run.
"paths": [ # Required. Absolute directory or file paths to pull from the device. Limits: - A maximum of 10 paths are allowed.
{ # The configuration of pulling a file or directory from the iOS device.
"bundleId": "A String", # Required. The bundle ID of the application sandbox.
"devicePath": "A String", # Required. The device path relative to the app sandbox, e.g. "/Documents/output/".
},
],
},
"iosPushFiles": { # Pushes files to the iOS device sandbox at the beginning of the run. # Pushes files to the iOS device sandbox at the beginning of the run.
"fileConfigs": [ # Required. Configs of pushing files to the device. Limits: - A maximum of 50 files are allowed.
{ # The configuration of pushing a file to the iOS device.
"bundleId": "A String", # Required. The bundle ID of the application sandbox.
"destinationPath": "A String", # Required. The destination path relative to the app sandbox, e.g. "/Documents/file.txt".
"sourceFile": { # Input file. # Required. The file to be pushed.
"gcsInputFile": { # A path to a file or directory in Google Cloud Storage. # An input file in Google Cloud Storage.
"path": "A String", # Required. The Google Cloud Storage path of the file or directory. Format: `gs:///`.
},
},
},
],
},
"iosRecordVideo": { # Records a video of the iOS device screen during the run. The video will be written to a file named `video.mp4` in the execution output directory. # Records a video of the iOS device screen during the run.
"discardOnPass": True or False, # Optional. Whether to discard the video if the test passes. If not specified, the default is false (always keep the video).
},
"iosSwitchLocale": { # Switches the locale (language and region) of the iOS application. # Switches the locale (language and region) of the iOS application.
"localeCode": "A String", # Required. The locale (language and region) to switch the app to. The format is `language-region` or `language`, e.g. "en-US", "zh-CN", "ja", etc.
},
},
],
"requirement": { # The requirement of a device. # Required. The requirement of the device.
"deviceId": "A String", # The device ID of a device in the catalog. The device ID is the last part of a device's resource name.
},
},
],
},
"displayName": "A String", # Optional. User-settable, human-readable name for the job. If set, it must be unique within the session. If not set, the display name will default to `job-`, where `` is the 0-based index of the job in the session formatted as three digits (e.g., job-000, job-001, ...). Maximum size is 63 bytes when encoded as UTF-8. If set, must match regex: `^A-Za-z0-9*$`.
"labels": { # Optional. User-defined metadata for tracking or categorization. These labels do not affect job execution and are surfaced in the JobReport. Limits: - Maximum number of entries: 16. - Maximum key size: 32 bytes (UTF-8). - Maximum value size: 1024 bytes (UTF-8).
"a_key": "A String",
},
"settings": { # Job settings to control the job execution. # Optional. Job settings.
"retrySettings": { # Retry settings. # Optional. The retry settings of the job.
"flakyTestRetryStrategy": { # Default retry strategy. It will retry on test failures for up to flaky_test_attempts (including the initial run). It also retries on infra issues for up to 2 attempts (including the initial run). So in total, an execution can run up to flaky_test_attempts * 2 times in the worst case. # Optional. The default retry strategy. Allows an Execution to retry on test failures and infrastructure errors.
"flakyTestAttempts": 42, # Required. The total attempts for flaky tests, including the initial run. Default value: 1 (no retry). Range: [1, 5].
"parallelRetry": True or False, # Optional. Whether to retry the test failures in parallel. By default, the test is retried sequentially. If true, when the initial attempt fails, (flaky_test_attempts - 1) attempts will be triggered at the same time to run in parallel.
"testReductionMode": "A String", # Optional. The mode of test reduction for retry. If the test runner doesn't support the specified test reduction mode, the request will be rejected with an `INVALID_ARGUMENT` error.
},
},
},
},
],
"notificationConfig": { # Config to control session notification. # Optional. Notification config for the session.
"pubsubTopic": [ # Optional. The Pub/Sub topics to which session events are published. Format: `projects/{project}/topics/{topic}`. See https://cloud.google.com/pubsub/docs/admin#topic_and_subscription_name_restrictions
"A String",
],
},
"outputDirectoryConfig": { # Config to control session output file directory. # Required. Output file directory config for the session.
"flatDirectoryStructure": True or False, # Optional. Whether to write output files directly under the output directory instead of nesting them under service-generated subdirectories. By default (`false`), output files are stored under `////`. When `true`, the session ID subdirectory is never appended, and the job display name subdirectory is appended only when the session has more than one job. Output files are therefore stored under: - `//` for a single-job session. - `///` for a multi-job session. Set this to `true` when the output directory is already unique per session (for example, when a CI system generates it), to avoid redundant nesting.
"gcsOutputDirectory": { # A path to a file or directory in Google Cloud Storage. # The Google Cloud Storage path of the output directory (e.g. `gs://my-bucket/output`). The bucket must exist. If the bucket is located in another project or uses fine-grained access controls, ensure the Device Run Service Agent of the project (`service-@gcp-sa-devicerun.iam.gserviceaccount.com`) is granted access to the bucket (such as `roles/storage.objectUser`).
"path": "A String", # Required. The Google Cloud Storage path of the file or directory. Format: `gs:///`.
},
},
},
"sessionReport": { # The runtime information and result report of a session. # Output only. The runtime information and result report of the session.
"endTime": "A String", # Output only. The end time of the session.
"id": "A String", # Output only. The unique identifier of the session.
"jobReports": [ # Output only. Reports of the jobs in the session.
{ # The runtime information and result report of a job.
"displayName": "A String", # Output only. The display_name set by users in the JobConfig.
"endTime": "A String", # Output only. The end time of the job.
"executionReports": [ # Output only. Reports of the execution attempts of the job.
{ # The runtime information and result report of a single on-device execution attempt.
"displayName": "A String", # Output only. The display_name set by users in the ExecutionConfig.
"endTime": "A String", # Output only. The end time of the execution.
"id": "A String", # Output only. The unique identifier of the execution.
"outputFiles": [ # Output only. The output files of the execution.
{ # Output file.
"gcsOutputFile": { # A path to a file or directory in Google Cloud Storage. # An output file in Google Cloud Storage.
"path": "A String", # Required. The Google Cloud Storage path of the file or directory. Format: `gs:///`.
},
},
],
"result": { # The result of a session/job/execution. # Output only. The result of the execution.
"cause": { # Describes the cause of the non-passed result occurred during the execution. # Output only. Detailed result cause diagnostics. Set if type is not PASSED.
"summary": { # Describes the summary of an issue (error or warning) with structured details. # Output only. Structured cause detail.
"message": "A String", # Output only. Human-readable explanation of the issue in English.
"reason": "A String", # Output only. The reason of the issue. This is a constant value that identifies the proximate cause of the issue. This should be at most 63 characters and match a regular expression of `A-Z*[A-Z0-9]`, which represents UPPER_SNAKE_CASE.
"type": "A String", # Output only. The issue classification based on responsibility.
},
},
"resultType": "A String", # Output only. The result type of the session/job/execution.
},
"startTime": "A String", # Output only. The start time of the execution.
"status": { # The status of a session/job/execution. # Output only. The status of the execution.
"progressMessages": [ # Output only. Human-readable, detailed descriptions of the session/job/execution's progress. For example: "Provisioning a device", "Starting Test". Each message should contain only one line of text. During the course of execution new data may be appended to the end of progress_messages.
"A String",
],
"statusType": "A String", # Output only. The status type of the session/job/execution.
},
"warnings": [ # Output only. Non-fatal warnings collected during the execution.
{ # Non-fatal operational anomaly, lint observation, or execution insight.
"summary": { # Describes the summary of an issue (error or warning) with structured details. # Output only. Detailed warning summary.
"message": "A String", # Output only. Human-readable explanation of the issue in English.
"reason": "A String", # Output only. The reason of the issue. This is a constant value that identifies the proximate cause of the issue. This should be at most 63 characters and match a regular expression of `A-Z*[A-Z0-9]`, which represents UPPER_SNAKE_CASE.
"type": "A String", # Output only. The issue classification based on responsibility.
},
},
],
},
],
"id": "A String", # Output only. The unique identifier of the job.
"labels": { # Output only. The original labels provided by the user during job creation.
"a_key": "A String",
},
"outputFiles": [ # Output only. The output files of the job.
{ # Output file.
"gcsOutputFile": { # A path to a file or directory in Google Cloud Storage. # An output file in Google Cloud Storage.
"path": "A String", # Required. The Google Cloud Storage path of the file or directory. Format: `gs:///`.
},
},
],
"result": { # The result of a session/job/execution. # Output only. The result of the job.
"cause": { # Describes the cause of the non-passed result occurred during the execution. # Output only. Detailed result cause diagnostics. Set if type is not PASSED.
"summary": { # Describes the summary of an issue (error or warning) with structured details. # Output only. Structured cause detail.
"message": "A String", # Output only. Human-readable explanation of the issue in English.
"reason": "A String", # Output only. The reason of the issue. This is a constant value that identifies the proximate cause of the issue. This should be at most 63 characters and match a regular expression of `A-Z*[A-Z0-9]`, which represents UPPER_SNAKE_CASE.
"type": "A String", # Output only. The issue classification based on responsibility.
},
},
"resultType": "A String", # Output only. The result type of the session/job/execution.
},
"startTime": "A String", # Output only. The start time of the job.
"status": { # The status of a session/job/execution. # Output only. The status of the job.
"progressMessages": [ # Output only. Human-readable, detailed descriptions of the session/job/execution's progress. For example: "Provisioning a device", "Starting Test". Each message should contain only one line of text. During the course of execution new data may be appended to the end of progress_messages.
"A String",
],
"statusType": "A String", # Output only. The status type of the session/job/execution.
},
"warnings": [ # Output only. Non-fatal warnings collected during the job.
{ # Non-fatal operational anomaly, lint observation, or execution insight.
"summary": { # Describes the summary of an issue (error or warning) with structured details. # Output only. Detailed warning summary.
"message": "A String", # Output only. Human-readable explanation of the issue in English.
"reason": "A String", # Output only. The reason of the issue. This is a constant value that identifies the proximate cause of the issue. This should be at most 63 characters and match a regular expression of `A-Z*[A-Z0-9]`, which represents UPPER_SNAKE_CASE.
"type": "A String", # Output only. The issue classification based on responsibility.
},
},
],
},
],
"result": { # The result of a session/job/execution. # Output only. The result of the session.
"cause": { # Describes the cause of the non-passed result occurred during the execution. # Output only. Detailed result cause diagnostics. Set if type is not PASSED.
"summary": { # Describes the summary of an issue (error or warning) with structured details. # Output only. Structured cause detail.
"message": "A String", # Output only. Human-readable explanation of the issue in English.
"reason": "A String", # Output only. The reason of the issue. This is a constant value that identifies the proximate cause of the issue. This should be at most 63 characters and match a regular expression of `A-Z*[A-Z0-9]`, which represents UPPER_SNAKE_CASE.
"type": "A String", # Output only. The issue classification based on responsibility.
},
},
"resultType": "A String", # Output only. The result type of the session/job/execution.
},
"startTime": "A String", # Output only. The start time of the session.
"status": { # The status of a session/job/execution. # Output only. The status of the session.
"progressMessages": [ # Output only. Human-readable, detailed descriptions of the session/job/execution's progress. For example: "Provisioning a device", "Starting Test". Each message should contain only one line of text. During the course of execution new data may be appended to the end of progress_messages.
"A String",
],
"statusType": "A String", # Output only. The status type of the session/job/execution.
},
},
}
requestId: string, Optional. A unique identifier for this request. This request is only idempotent if a `request_id` is provided, i.e. if a request with the same `request_id` is received, then the previous result will be returned. The server will guarantee that for at least 60 minutes after the first request. The value must be a UUID (e.g., 123e4567-e89b-12d3-a456-426655440000). See github.com/google/uuid for more details.
sessionId: string, Optional. The ID to use for the session, which will become the final component of the resource name. If not provided, the server will generate a value for this field. When provided, this value must be between 4 and 63 characters, and match the following regex: ^a-z{2,61}[a-z0-9]$.
x__xgafv: string, V1 error format.
Allowed values
1 - v1 error format
2 - v2 error format
Returns:
An object of the form:
{ # This resource represents a long-running operation that is the result of a network API call.
"done": True or False, # If the value is `false`, it means the operation is still in progress. If `true`, the operation is completed, and either `error` or `response` is available.
"error": { # The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each `Status` message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors). # The error result of the operation in case of failure or cancellation.
"code": 42, # The status code, which should be an enum value of google.rpc.Code.
"details": [ # A list of messages that carry the error details. There is a common set of message types for APIs to use.
{
"a_key": "", # Properties of the object. Contains field @type with type URL.
},
],
"message": "A String", # A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the google.rpc.Status.details field, or localized by the client.
},
"metadata": { # Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any.
"a_key": "", # Properties of the object. Contains field @type with type URL.
},
"name": "A String", # The server-assigned name, which is only unique within the same service that originally returns it. If you use the default HTTP mapping, the `name` should be a resource name ending with `operations/{unique_id}`.
"response": { # The normal, successful response of the operation. If the original method returns no data on success, such as `Delete`, the response is `google.protobuf.Empty`. If the original method is standard `Get`/`Create`/`Update`, the response should be the resource. For other methods, the response should have the type `XxxResponse`, where `Xxx` is the original method name. For example, if the original method name is `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`.
"a_key": "", # Properties of the object. Contains field @type with type URL.
},
}
delete(name, requestId=None, x__xgafv=None)
Deletes a session. This RPC returns immediately and deletion proceeds asynchronously. It will cancel the session at first if it is still running.
Args:
name: string, Required. The name of the session. Format: `projects/{project}/locations/{location}/sessions/{session}`. (required)
requestId: string, Optional. A unique identifier for this request. This request is only idempotent if a `request_id` is provided, i.e. if a request with the same `request_id` is received, then the previous result will be returned. The server will guarantee that for at least 60 minutes after the first request. The value must be a UUID (e.g., 123e4567-e89b-12d3-a456-426655440000). See github.com/google/uuid for more details.
x__xgafv: string, V1 error format.
Allowed values
1 - v1 error format
2 - v2 error format
Returns:
An object of the form:
{ # This resource represents a long-running operation that is the result of a network API call.
"done": True or False, # If the value is `false`, it means the operation is still in progress. If `true`, the operation is completed, and either `error` or `response` is available.
"error": { # The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each `Status` message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors). # The error result of the operation in case of failure or cancellation.
"code": 42, # The status code, which should be an enum value of google.rpc.Code.
"details": [ # A list of messages that carry the error details. There is a common set of message types for APIs to use.
{
"a_key": "", # Properties of the object. Contains field @type with type URL.
},
],
"message": "A String", # A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the google.rpc.Status.details field, or localized by the client.
},
"metadata": { # Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any.
"a_key": "", # Properties of the object. Contains field @type with type URL.
},
"name": "A String", # The server-assigned name, which is only unique within the same service that originally returns it. If you use the default HTTP mapping, the `name` should be a resource name ending with `operations/{unique_id}`.
"response": { # The normal, successful response of the operation. If the original method returns no data on success, such as `Delete`, the response is `google.protobuf.Empty`. If the original method is standard `Get`/`Create`/`Update`, the response should be the resource. For other methods, the response should have the type `XxxResponse`, where `Xxx` is the original method name. For example, if the original method name is `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`.
"a_key": "", # Properties of the object. Contains field @type with type URL.
},
}
get(name, view=None, x__xgafv=None)
Returns information about a previously created automation session.
Args:
name: string, Required. The name of the session. Format: `projects/{project}/locations/{location}/sessions/{session}`. (required)
view: string, Optional. The view of the session to return. If not set, the default BASIC view will be returned.
Allowed values
SESSION_VIEW_UNSPECIFIED - The default / unset value. The API will default to the BASIC view.
SESSION_VIEW_BASIC - Include basic view of the session but not the full contents. Only the uid/display_name/status/result of the session and its jobs/executions will be included. This is the default value (for GetSession).
SESSION_VIEW_FULL - Include everything.
x__xgafv: string, V1 error format.
Allowed values
1 - v1 error format
2 - v2 error format
Returns:
An object of the form:
{ # A session resource in the AutomationSession API. At a high level, `Session` describes the configuration of one or multiple jobs, the state transitions it goes through, and the results.
"name": "A String", # Identifier. The resource name of the session. Format: `projects/{project}/locations/{location}/sessions/{session}`.
"sessionConfig": { # SessionConfig is used to create a session. # Required. Configuration used to create the session.
"displayName": "A String", # Optional. User-settable, human-readable name for the session. Maximum size is 63 bytes when encoded as UTF-8. If set, must match regex: `^A-Za-z0-9*$`.
"jobConfigs": [ # Required. Configs of the jobs in the session.
{ # The configuration of a job.
"action": { # The action to be performed in a job. # Required. Job action.
"androidInstrumentationTest": { # The configuration of an Android instrumentation test. See https://developer.android.com/training/testing/instrumented-tests for more information on Android instrumentation tests. # Android instrumentation test.
"additionalTestOptions": { # Optional. Additional test options to pass to the test runner. Passed to `am instrument` command as `-e` options, which will be passed to the instrumentation test runner using its `onCreate()` method. Formats supported in test_targets are not allowed to be used here. Limits: - Maximum number of entries: 32. - Maximum key size: 64 bytes (UTF-8). - Maximum value size: 1024 bytes (UTF-8).
"a_key": "A String",
},
"enableCodeCoverage": True or False, # Optional. Whether to enable code coverage collection for the test. A coverage file `coverage.ec` will be uploaded to the results folder. For this to work, your classes have to be instrumented offline (build time) by EMMA/JaCoCo.
"instrumentationTimeout": "A String", # Optional. The timeout of the instrumentation test. Default value: 5 min. Range: [1 min, 3 hours].
"orchestratorVersion": "A String", # Optional. The version of the Android Test Orchestrator to use for the test. The available orchestrator versions can be retrieved from the catalog service. If set to "auto", the default orchestrator is used. If not set, no orchestrator is used.
"smartSharding": { # The smart sharding strategy to split the job into multiple shards based on the test methods and their recorded execution time. # Optional. Smart sharding strategy to split the job into multiple shards based on the test methods and their execution time.
"maxShardCount": 42, # Optional. The maximum number of shards to create. If unset or less than 1, system-defined max limits are used. This limit takes precedence if the targeted_shard_duration cannot be satisfied. Limits: - For physical devices, the number of shards must be <= 20. - For virtual devices, the number of shards must be <= 200.
"targetedShardDuration": "A String", # Required. The targeted duration of each shard. Limits: - Must be at least 2 minutes. - Must be at most 3 hours. Shard duration is not guaranteed because smart sharding uses test case history and default durations which may not be accurate. Durations are calculated based on the following inputs: - Timing records from previous runs of the same test case. - For new test cases, the average duration of other known test cases. - A system-chosen, default duration if there are no previous timing records available. Because the actual shard duration can exceed the targeted shard duration, we recommend that you set the targeted value at least 5 minutes less than the maximum allowed instrumentation timeout. This approach avoids cancelling the shard before all tests can finish.
"timingRecord": { # Input file. # Required. The timing record file to use for smart sharding. If the file does not exist, smart sharding will use default test time (30s) for each test method to shard the job into multiple shards. This file will be overwritten with the latest timing record after the job is completed.
"gcsInputFile": { # A path to a file or directory in Google Cloud Storage. # An input file in Google Cloud Storage.
"path": "A String", # Required. The Google Cloud Storage path of the file or directory. Format: `gs:///`.
},
},
},
"testInstallable": { # An Android Installable represents the file(s) for installing an Android package on a device. This can be an APK, an Android App Bundle (AAB), or an APK Set. # Required. The test package to install and run the test.
"files": [ # Required. Files that make up the package. Supported formats are distinguished by their file extension: - APK: One or more files with extension `.apk`. - App Bundle: A single file with extension `.aab`. - APK Set: A single file with extension `.apks`.
{ # Input file.
"gcsInputFile": { # A path to a file or directory in Google Cloud Storage. # An input file in Google Cloud Storage.
"path": "A String", # Required. The Google Cloud Storage path of the file or directory. Format: `gs:///`.
},
},
],
},
"testRunnerClass": "A String", # Optional. Full class name of the test runner class. The class must be `androidx.test.runner.AndroidJUnitRunner` or a subclass of it. The default value is determined by examining the application's manifest. If multiple instrumentations are found, the first one in the manifest will be used.
"testTargets": [ # Optional. A list of test targets or target filters to run. Each target must be fully qualified with the package name or class name, in one of these formats: - `package package_name` - `notPackage com.package.to.skip` - `class package_name.class_name` - `class package_name.class_name#method_name` - `notClass com.foo.ClassToSkip` - `notClass com.foo.ClassName#testMethodToSkip` - `annotation com.foo.AnnotationToRun` - `notAnnotation com.foo.AnnotationToSkip` - `size [small|medium|large]` Formats like `testfile` or `notTestfile` won't be supported. If empty, all targets in the module will be run. Limits: - Maximum number of entries: 1024.
"A String",
],
"uniformSharding": { # Uniformly shards test cases given a total number of shards. It will be translated to `-e numShard` and `-e shardIndex` AndroidJUnitRunner arguments. With uniform sharding enabled, specifying either of these sharding arguments via `environment_variables` is invalid. Based on the sharding mechanism AndroidJUnitRunner uses, there is no guarantee that test cases will be distributed uniformly across all shards. # Optional. Uniform sharding strategy to split the job into multiple shards with equal number of test methods.
"shardCount": 42, # Required. The total number of shards to create. This must always be a positive number that is no greater than the total number of test cases. Limits: - For physical devices, the number of shards must be <= 20. - For virtual devices, the number of shards must be <= 200.
},
},
"androidNativeBinary": { # The configuration of an Android native binary execution. # Android native binary execution.
"androidNativeBinary": { # Input file. # Required. The file path of the Android native binary.
"gcsInputFile": { # A path to a file or directory in Google Cloud Storage. # An input file in Google Cloud Storage.
"path": "A String", # Required. The Google Cloud Storage path of the file or directory. Format: `gs:///`.
},
},
"args": [ # Optional. Arguments for running the binary file. The flags will be appended to the command line that invokes the binary. The number of options is limited to 100.
"A String",
],
"envVars": { # Optional. A map of environment variables to set for the binary process. The keys are the variable names and the values are the variable values. The maximum number of entries is 100. Each key is limited to 128 characters and must conform to POSIX standards. Each value is limited to 2048 characters. The total size of all environment variables must not exceed 16 KiB.
"a_key": "A String",
},
"executionTimeout": "A String", # Optional. The timeout of the execution. Default value: 5 min. Range: [1 min, 3 hours].
},
"iosXcTest": { # The configuration of an iOS XCTest. # iOS XCTest.
"testsZip": { # Input file. # Required. The .zip containing the .xctestrun file and the contents of the DerivedData/Build/Products directory.
"gcsInputFile": { # A path to a file or directory in Google Cloud Storage. # An input file in Google Cloud Storage.
"path": "A String", # Required. The Google Cloud Storage path of the file or directory. Format: `gs:///`.
},
},
"xcTestTimeout": "A String", # Optional. The timeout of the test. Default value: 5 min. Range: [1 min, 3 hours].
"xcodeVersion": "A String", # Optional. The Xcode version that should be used for the test. If not set, a system-default Xcode version is used. The available Xcode versions can be retrieved from the catalog service.
"xctestrun": { # Input file. # Optional. An .xctestrun file that will override the .xctestrun file in the tests zip.
"gcsInputFile": { # A path to a file or directory in Google Cloud Storage. # An input file in Google Cloud Storage.
"path": "A String", # Required. The Google Cloud Storage path of the file or directory. Format: `gs:///`.
},
},
},
},
"allocationConfig": { # Allocation config. # Required. Allocation config.
"deviceConfigs": [ # Required. At least one device config is required. If more than one device config is required, the multiple devices are allocated to each shard of the OmniLab job to run multi-device-interaction tests.
{ # The configuration of a run on a device.
"actions": [ # Optional. The actions to be performed on the device. Actions will be executed in the order they are specified in the list. Each action type can at most have 1 instance in the list.
{ # The action to be performed on a device.
"androidBugreport": { # Captures a bugreport from the device. The output will be written to a file named `bugreport.zip` in the execution output directory. # Captures a bugreport from the device unless the test result is pass.
"collectOnPass": True or False, # Optional. Whether to deliver the bugreport when the test passes. If false, the bugreport is skipped on pass to save time (default behavior). If true, the bugreport is always delivered.
},
"androidDumpsys": { # Captures dumpsys output from the device. The output will be written to a file named `dumpsys.log` in the execution output directory. # Captures a dumpsys from the device.
"collectOnPass": True or False, # Optional. Whether to deliver the dumpsys when the test passes. If false, the dumpsys is skipped on pass to save time (default behavior). If true, the dumpsys is always delivered.
},
"androidInstallPackages": { # Installs Android packages on the device. At least one installable is specified when using this device action. Limits: - A maximum of 20 installables in total are allowed. - A maximum of 100 files are allowed in total across all installables. # Installs Android packages on the device.
"installables": [ # Optional. Deprecated: use `pre_target_app_installables`, `target_app` and `post_target_app_installables` instead. The Android packages to install on the device. The installation will be performed in the order specified, before the installables of all other fields.
{ # An Android Installable represents the file(s) for installing an Android package on a device. This can be an APK, an Android App Bundle (AAB), or an APK Set.
"files": [ # Required. Files that make up the package. Supported formats are distinguished by their file extension: - APK: One or more files with extension `.apk`. - App Bundle: A single file with extension `.aab`. - APK Set: A single file with extension `.apks`.
{ # Input file.
"gcsInputFile": { # A path to a file or directory in Google Cloud Storage. # An input file in Google Cloud Storage.
"path": "A String", # Required. The Google Cloud Storage path of the file or directory. Format: `gs:///`.
},
},
],
},
],
"postTargetAppInstallables": [ # Optional. The Android packages to install on the device after `target_app` (if specified) is installed. The installation will be performed in the order specified.
{ # An Android Installable represents the file(s) for installing an Android package on a device. This can be an APK, an Android App Bundle (AAB), or an APK Set.
"files": [ # Required. Files that make up the package. Supported formats are distinguished by their file extension: - APK: One or more files with extension `.apk`. - App Bundle: A single file with extension `.aab`. - APK Set: A single file with extension `.apks`.
{ # Input file.
"gcsInputFile": { # A path to a file or directory in Google Cloud Storage. # An input file in Google Cloud Storage.
"path": "A String", # Required. The Google Cloud Storage path of the file or directory. Format: `gs:///`.
},
},
],
},
],
"preTargetAppInstallables": [ # Optional. The Android packages to install on the device before `target_app` (if specified) is installed. The installation will be performed in the order specified.
{ # An Android Installable represents the file(s) for installing an Android package on a device. This can be an APK, an Android App Bundle (AAB), or an APK Set.
"files": [ # Required. Files that make up the package. Supported formats are distinguished by their file extension: - APK: One or more files with extension `.apk`. - App Bundle: A single file with extension `.aab`. - APK Set: A single file with extension `.apks`.
{ # Input file.
"gcsInputFile": { # A path to a file or directory in Google Cloud Storage. # An input file in Google Cloud Storage.
"path": "A String", # Required. The Google Cloud Storage path of the file or directory. Format: `gs:///`.
},
},
],
},
],
"targetApp": { # An Android Installable represents the file(s) for installing an Android package on a device. This can be an APK, an Android App Bundle (AAB), or an APK Set. # Optional. The primary Android package to install, serving as the target package for subsequent actions and as the installation ordering anchor. Whether this package is treated as the application under test depends on the job action: - Actions that require an explicit target package (such as performance metrics collection, or accessibility scans) use this package to identify the application to inspect or drive. - Actions that discover or manage targets independently (such as Android instrumentation tests, where target packages are defined in the test runner manifest) treat this field primarily as an installation order anchor between pre- and post-installables. Optional. If omitted, all packages in `pre_target_app_installables` and `post_target_app_installables` are installed without a designated target package.
"files": [ # Required. Files that make up the package. Supported formats are distinguished by their file extension: - APK: One or more files with extension `.apk`. - App Bundle: A single file with extension `.aab`. - APK Set: A single file with extension `.apks`.
{ # Input file.
"gcsInputFile": { # A path to a file or directory in Google Cloud Storage. # An input file in Google Cloud Storage.
"path": "A String", # Required. The Google Cloud Storage path of the file or directory. Format: `gs:///`.
},
},
],
},
},
"androidLogcat": { # Collects logcat output from the device. The output will be written to a file named `logcat.txt` in the execution output directory. # Collects logcat output from the device.
},
"androidMockLocation": { # Mocks the location of the Android device. # Mocks the location of the device.
"location": { # An object that represents a latitude/longitude pair. This is expressed as a pair of doubles to represent degrees latitude and degrees longitude. Unless specified otherwise, this object must conform to the WGS84 standard. Values must be within normalized ranges. # Required. The mock location to set on the device.
"latitude": 3.14, # The latitude in degrees. It must be in the range [-90.0, +90.0].
"longitude": 3.14, # The longitude in degrees. It must be in the range [-180.0, +180.0].
},
},
"androidOrientation": { # Sets the orientation of the device. # Sets the orientation of the device.
"orientation": "A String", # Required. The orientation to set the device to. One of `portrait` or `landscape`.
},
"androidPullFiles": { # Pulls directories and files from the device at the end of the run. Files will be copied to the '/artifacts' directory, with the absolute path structure preserved. Note that: 1. A clean device is provided for the run. 2. Any existing files in the output directory may be overwritten. 3. Pulling files is best effort. Will skip files if they don't exist on the device. # Pulls directories and files from the device at the end of the run.
"paths": [ # Required. Absolute directory or file paths to pull from the device. Limits: - A maximum of 10 paths are allowed.
"A String",
],
},
"androidPushFiles": { # Pushes files to the device at the beginning of the run. Files are overwritten if a file with the same path already exists on the device, if device permissions allow. # Pushes files to the device at the beginning of the run.
"fileConfigs": [ # Required. Configs of pushing files to the device. Limits: - A maximum of 50 files are allowed.
{ # The configuration of pushing a file to the device.
"destinationPath": "A String", # Required. The destination path on the device.
"sourceFile": { # Input file. # Required. The file to be pushed to the device.
"gcsInputFile": { # A path to a file or directory in Google Cloud Storage. # An input file in Google Cloud Storage.
"path": "A String", # Required. The Google Cloud Storage path of the file or directory. Format: `gs:///`.
},
},
},
],
},
"androidRecordVideo": { # Records a video of the device screen during the run. The video will be written to a file named `video.mp4` in the execution output directory. # Records a video of the device screen during the run.
"discardOnPass": True or False, # Optional. Whether to discard and not upload the recording when the test passes. Default is false.
},
"androidSwitchLocale": { # Switches the locale (language and region) of the device. # Switches the locale (language and region) of the device.
"localeCode": "A String", # Required. The locale (language and region) to switch the device to. The format is `language-region`, e.g. "en-US", "zh-CN", etc. The typical language value is a two or three-letter language code as defined in ISO639. The typical region value is a two-letter ISO 3166 code or a three-digit UN M.49 area code.
},
"iosAppPrivacyReport": { # Collects the exported iOS App Privacy Report during the test run. When enabled, the iOS device records application activity (such as network access, domain requests, and sensitive resource access like photos, camera, or location) and exports Apple's official App Privacy Report. The report will be written to a file named `AppActivityReport.ndjson` in the execution output directory. # Collects the exported iOS App Privacy Report during the run.
},
"iosInstallPackages": { # Installs iOS packages on the device. # Installs additional iOS packages on the device.
"ipas": [ # Required. Additional iOS packages (IPAs) to install on the device. Limits: - A maximum of 20 IPAs are allowed.
{ # Input file.
"gcsInputFile": { # A path to a file or directory in Google Cloud Storage. # An input file in Google Cloud Storage.
"path": "A String", # Required. The Google Cloud Storage path of the file or directory. Format: `gs:///`.
},
},
],
},
"iosPullFiles": { # Pulls directories and files from the iOS device sandbox at the end of the run. # Pulls directories and files from the iOS device sandbox at the end of the run.
"paths": [ # Required. Absolute directory or file paths to pull from the device. Limits: - A maximum of 10 paths are allowed.
{ # The configuration of pulling a file or directory from the iOS device.
"bundleId": "A String", # Required. The bundle ID of the application sandbox.
"devicePath": "A String", # Required. The device path relative to the app sandbox, e.g. "/Documents/output/".
},
],
},
"iosPushFiles": { # Pushes files to the iOS device sandbox at the beginning of the run. # Pushes files to the iOS device sandbox at the beginning of the run.
"fileConfigs": [ # Required. Configs of pushing files to the device. Limits: - A maximum of 50 files are allowed.
{ # The configuration of pushing a file to the iOS device.
"bundleId": "A String", # Required. The bundle ID of the application sandbox.
"destinationPath": "A String", # Required. The destination path relative to the app sandbox, e.g. "/Documents/file.txt".
"sourceFile": { # Input file. # Required. The file to be pushed.
"gcsInputFile": { # A path to a file or directory in Google Cloud Storage. # An input file in Google Cloud Storage.
"path": "A String", # Required. The Google Cloud Storage path of the file or directory. Format: `gs:///`.
},
},
},
],
},
"iosRecordVideo": { # Records a video of the iOS device screen during the run. The video will be written to a file named `video.mp4` in the execution output directory. # Records a video of the iOS device screen during the run.
"discardOnPass": True or False, # Optional. Whether to discard the video if the test passes. If not specified, the default is false (always keep the video).
},
"iosSwitchLocale": { # Switches the locale (language and region) of the iOS application. # Switches the locale (language and region) of the iOS application.
"localeCode": "A String", # Required. The locale (language and region) to switch the app to. The format is `language-region` or `language`, e.g. "en-US", "zh-CN", "ja", etc.
},
},
],
"requirement": { # The requirement of a device. # Required. The requirement of the device.
"deviceId": "A String", # The device ID of a device in the catalog. The device ID is the last part of a device's resource name.
},
},
],
},
"displayName": "A String", # Optional. User-settable, human-readable name for the job. If set, it must be unique within the session. If not set, the display name will default to `job-`, where `` is the 0-based index of the job in the session formatted as three digits (e.g., job-000, job-001, ...). Maximum size is 63 bytes when encoded as UTF-8. If set, must match regex: `^A-Za-z0-9*$`.
"labels": { # Optional. User-defined metadata for tracking or categorization. These labels do not affect job execution and are surfaced in the JobReport. Limits: - Maximum number of entries: 16. - Maximum key size: 32 bytes (UTF-8). - Maximum value size: 1024 bytes (UTF-8).
"a_key": "A String",
},
"settings": { # Job settings to control the job execution. # Optional. Job settings.
"retrySettings": { # Retry settings. # Optional. The retry settings of the job.
"flakyTestRetryStrategy": { # Default retry strategy. It will retry on test failures for up to flaky_test_attempts (including the initial run). It also retries on infra issues for up to 2 attempts (including the initial run). So in total, an execution can run up to flaky_test_attempts * 2 times in the worst case. # Optional. The default retry strategy. Allows an Execution to retry on test failures and infrastructure errors.
"flakyTestAttempts": 42, # Required. The total attempts for flaky tests, including the initial run. Default value: 1 (no retry). Range: [1, 5].
"parallelRetry": True or False, # Optional. Whether to retry the test failures in parallel. By default, the test is retried sequentially. If true, when the initial attempt fails, (flaky_test_attempts - 1) attempts will be triggered at the same time to run in parallel.
"testReductionMode": "A String", # Optional. The mode of test reduction for retry. If the test runner doesn't support the specified test reduction mode, the request will be rejected with an `INVALID_ARGUMENT` error.
},
},
},
},
],
"notificationConfig": { # Config to control session notification. # Optional. Notification config for the session.
"pubsubTopic": [ # Optional. The Pub/Sub topics to which session events are published. Format: `projects/{project}/topics/{topic}`. See https://cloud.google.com/pubsub/docs/admin#topic_and_subscription_name_restrictions
"A String",
],
},
"outputDirectoryConfig": { # Config to control session output file directory. # Required. Output file directory config for the session.
"flatDirectoryStructure": True or False, # Optional. Whether to write output files directly under the output directory instead of nesting them under service-generated subdirectories. By default (`false`), output files are stored under `////`. When `true`, the session ID subdirectory is never appended, and the job display name subdirectory is appended only when the session has more than one job. Output files are therefore stored under: - `//` for a single-job session. - `///` for a multi-job session. Set this to `true` when the output directory is already unique per session (for example, when a CI system generates it), to avoid redundant nesting.
"gcsOutputDirectory": { # A path to a file or directory in Google Cloud Storage. # The Google Cloud Storage path of the output directory (e.g. `gs://my-bucket/output`). The bucket must exist. If the bucket is located in another project or uses fine-grained access controls, ensure the Device Run Service Agent of the project (`service-@gcp-sa-devicerun.iam.gserviceaccount.com`) is granted access to the bucket (such as `roles/storage.objectUser`).
"path": "A String", # Required. The Google Cloud Storage path of the file or directory. Format: `gs:///`.
},
},
},
"sessionReport": { # The runtime information and result report of a session. # Output only. The runtime information and result report of the session.
"endTime": "A String", # Output only. The end time of the session.
"id": "A String", # Output only. The unique identifier of the session.
"jobReports": [ # Output only. Reports of the jobs in the session.
{ # The runtime information and result report of a job.
"displayName": "A String", # Output only. The display_name set by users in the JobConfig.
"endTime": "A String", # Output only. The end time of the job.
"executionReports": [ # Output only. Reports of the execution attempts of the job.
{ # The runtime information and result report of a single on-device execution attempt.
"displayName": "A String", # Output only. The display_name set by users in the ExecutionConfig.
"endTime": "A String", # Output only. The end time of the execution.
"id": "A String", # Output only. The unique identifier of the execution.
"outputFiles": [ # Output only. The output files of the execution.
{ # Output file.
"gcsOutputFile": { # A path to a file or directory in Google Cloud Storage. # An output file in Google Cloud Storage.
"path": "A String", # Required. The Google Cloud Storage path of the file or directory. Format: `gs:///`.
},
},
],
"result": { # The result of a session/job/execution. # Output only. The result of the execution.
"cause": { # Describes the cause of the non-passed result occurred during the execution. # Output only. Detailed result cause diagnostics. Set if type is not PASSED.
"summary": { # Describes the summary of an issue (error or warning) with structured details. # Output only. Structured cause detail.
"message": "A String", # Output only. Human-readable explanation of the issue in English.
"reason": "A String", # Output only. The reason of the issue. This is a constant value that identifies the proximate cause of the issue. This should be at most 63 characters and match a regular expression of `A-Z*[A-Z0-9]`, which represents UPPER_SNAKE_CASE.
"type": "A String", # Output only. The issue classification based on responsibility.
},
},
"resultType": "A String", # Output only. The result type of the session/job/execution.
},
"startTime": "A String", # Output only. The start time of the execution.
"status": { # The status of a session/job/execution. # Output only. The status of the execution.
"progressMessages": [ # Output only. Human-readable, detailed descriptions of the session/job/execution's progress. For example: "Provisioning a device", "Starting Test". Each message should contain only one line of text. During the course of execution new data may be appended to the end of progress_messages.
"A String",
],
"statusType": "A String", # Output only. The status type of the session/job/execution.
},
"warnings": [ # Output only. Non-fatal warnings collected during the execution.
{ # Non-fatal operational anomaly, lint observation, or execution insight.
"summary": { # Describes the summary of an issue (error or warning) with structured details. # Output only. Detailed warning summary.
"message": "A String", # Output only. Human-readable explanation of the issue in English.
"reason": "A String", # Output only. The reason of the issue. This is a constant value that identifies the proximate cause of the issue. This should be at most 63 characters and match a regular expression of `A-Z*[A-Z0-9]`, which represents UPPER_SNAKE_CASE.
"type": "A String", # Output only. The issue classification based on responsibility.
},
},
],
},
],
"id": "A String", # Output only. The unique identifier of the job.
"labels": { # Output only. The original labels provided by the user during job creation.
"a_key": "A String",
},
"outputFiles": [ # Output only. The output files of the job.
{ # Output file.
"gcsOutputFile": { # A path to a file or directory in Google Cloud Storage. # An output file in Google Cloud Storage.
"path": "A String", # Required. The Google Cloud Storage path of the file or directory. Format: `gs:///`.
},
},
],
"result": { # The result of a session/job/execution. # Output only. The result of the job.
"cause": { # Describes the cause of the non-passed result occurred during the execution. # Output only. Detailed result cause diagnostics. Set if type is not PASSED.
"summary": { # Describes the summary of an issue (error or warning) with structured details. # Output only. Structured cause detail.
"message": "A String", # Output only. Human-readable explanation of the issue in English.
"reason": "A String", # Output only. The reason of the issue. This is a constant value that identifies the proximate cause of the issue. This should be at most 63 characters and match a regular expression of `A-Z*[A-Z0-9]`, which represents UPPER_SNAKE_CASE.
"type": "A String", # Output only. The issue classification based on responsibility.
},
},
"resultType": "A String", # Output only. The result type of the session/job/execution.
},
"startTime": "A String", # Output only. The start time of the job.
"status": { # The status of a session/job/execution. # Output only. The status of the job.
"progressMessages": [ # Output only. Human-readable, detailed descriptions of the session/job/execution's progress. For example: "Provisioning a device", "Starting Test". Each message should contain only one line of text. During the course of execution new data may be appended to the end of progress_messages.
"A String",
],
"statusType": "A String", # Output only. The status type of the session/job/execution.
},
"warnings": [ # Output only. Non-fatal warnings collected during the job.
{ # Non-fatal operational anomaly, lint observation, or execution insight.
"summary": { # Describes the summary of an issue (error or warning) with structured details. # Output only. Detailed warning summary.
"message": "A String", # Output only. Human-readable explanation of the issue in English.
"reason": "A String", # Output only. The reason of the issue. This is a constant value that identifies the proximate cause of the issue. This should be at most 63 characters and match a regular expression of `A-Z*[A-Z0-9]`, which represents UPPER_SNAKE_CASE.
"type": "A String", # Output only. The issue classification based on responsibility.
},
},
],
},
],
"result": { # The result of a session/job/execution. # Output only. The result of the session.
"cause": { # Describes the cause of the non-passed result occurred during the execution. # Output only. Detailed result cause diagnostics. Set if type is not PASSED.
"summary": { # Describes the summary of an issue (error or warning) with structured details. # Output only. Structured cause detail.
"message": "A String", # Output only. Human-readable explanation of the issue in English.
"reason": "A String", # Output only. The reason of the issue. This is a constant value that identifies the proximate cause of the issue. This should be at most 63 characters and match a regular expression of `A-Z*[A-Z0-9]`, which represents UPPER_SNAKE_CASE.
"type": "A String", # Output only. The issue classification based on responsibility.
},
},
"resultType": "A String", # Output only. The result type of the session/job/execution.
},
"startTime": "A String", # Output only. The start time of the session.
"status": { # The status of a session/job/execution. # Output only. The status of the session.
"progressMessages": [ # Output only. Human-readable, detailed descriptions of the session/job/execution's progress. For example: "Provisioning a device", "Starting Test". Each message should contain only one line of text. During the course of execution new data may be appended to the end of progress_messages.
"A String",
],
"statusType": "A String", # Output only. The status type of the session/job/execution.
},
},
}
list(parent, filter=None, orderBy=None, pageSize=None, pageToken=None, view=None, x__xgafv=None)
Lists previously created automation sessions. Sessions may still be in-progress, or may have finished successfully, or unsuccessfully.
Args:
parent: string, Required. Parent value for ListSessionsRequest The parent of the collection of sessions. Format: `projects/{project}/locations/{location}`. (required)
filter: string, Optional. The raw filter text to constrain the results.
orderBy: string, Optional. The order to sort results by. Supported values: `name`, `name desc`, `create_time`, `create_time desc`. Values must use the snake_case field name; `createTime` is not accepted. Ordering by `create_time` is not supported when listing across all locations (`locations/-`). If unspecified, results are returned in an unspecified order.
pageSize: integer, Optional. The maximum number of sessions to return. The server may return fewer items than this value. If unspecified, at most 500 sessions will be returned. The maximum value is 1000, values above will be coerced to 1000.
pageToken: string, Optional. A page token, received from a previous `ListSessions` call. Provide this to receive the subsequent page. When paginating, all other parameters provided to `ListSessions` must match the call that provided the page token.
view: string, Optional. The view of the sessions to return. If not set, the `BASIC` view will be returned.
Allowed values
SESSION_VIEW_UNSPECIFIED - The default / unset value. The API will default to the BASIC view.
SESSION_VIEW_BASIC - Include basic view of the session but not the full contents. Only the uid/display_name/status/result of the session and its jobs/executions will be included. This is the default value (for GetSession).
SESSION_VIEW_FULL - Include everything.
x__xgafv: string, V1 error format.
Allowed values
1 - v1 error format
2 - v2 error format
Returns:
An object of the form:
{ # Response including listed sessions.
"nextPageToken": "A String", # Token to receive the next page of sessions. This will be absent if the end of the response list has been reached.
"sessions": [ # The list of sessions.
{ # A session resource in the AutomationSession API. At a high level, `Session` describes the configuration of one or multiple jobs, the state transitions it goes through, and the results.
"name": "A String", # Identifier. The resource name of the session. Format: `projects/{project}/locations/{location}/sessions/{session}`.
"sessionConfig": { # SessionConfig is used to create a session. # Required. Configuration used to create the session.
"displayName": "A String", # Optional. User-settable, human-readable name for the session. Maximum size is 63 bytes when encoded as UTF-8. If set, must match regex: `^A-Za-z0-9*$`.
"jobConfigs": [ # Required. Configs of the jobs in the session.
{ # The configuration of a job.
"action": { # The action to be performed in a job. # Required. Job action.
"androidInstrumentationTest": { # The configuration of an Android instrumentation test. See https://developer.android.com/training/testing/instrumented-tests for more information on Android instrumentation tests. # Android instrumentation test.
"additionalTestOptions": { # Optional. Additional test options to pass to the test runner. Passed to `am instrument` command as `-e` options, which will be passed to the instrumentation test runner using its `onCreate()` method. Formats supported in test_targets are not allowed to be used here. Limits: - Maximum number of entries: 32. - Maximum key size: 64 bytes (UTF-8). - Maximum value size: 1024 bytes (UTF-8).
"a_key": "A String",
},
"enableCodeCoverage": True or False, # Optional. Whether to enable code coverage collection for the test. A coverage file `coverage.ec` will be uploaded to the results folder. For this to work, your classes have to be instrumented offline (build time) by EMMA/JaCoCo.
"instrumentationTimeout": "A String", # Optional. The timeout of the instrumentation test. Default value: 5 min. Range: [1 min, 3 hours].
"orchestratorVersion": "A String", # Optional. The version of the Android Test Orchestrator to use for the test. The available orchestrator versions can be retrieved from the catalog service. If set to "auto", the default orchestrator is used. If not set, no orchestrator is used.
"smartSharding": { # The smart sharding strategy to split the job into multiple shards based on the test methods and their recorded execution time. # Optional. Smart sharding strategy to split the job into multiple shards based on the test methods and their execution time.
"maxShardCount": 42, # Optional. The maximum number of shards to create. If unset or less than 1, system-defined max limits are used. This limit takes precedence if the targeted_shard_duration cannot be satisfied. Limits: - For physical devices, the number of shards must be <= 20. - For virtual devices, the number of shards must be <= 200.
"targetedShardDuration": "A String", # Required. The targeted duration of each shard. Limits: - Must be at least 2 minutes. - Must be at most 3 hours. Shard duration is not guaranteed because smart sharding uses test case history and default durations which may not be accurate. Durations are calculated based on the following inputs: - Timing records from previous runs of the same test case. - For new test cases, the average duration of other known test cases. - A system-chosen, default duration if there are no previous timing records available. Because the actual shard duration can exceed the targeted shard duration, we recommend that you set the targeted value at least 5 minutes less than the maximum allowed instrumentation timeout. This approach avoids cancelling the shard before all tests can finish.
"timingRecord": { # Input file. # Required. The timing record file to use for smart sharding. If the file does not exist, smart sharding will use default test time (30s) for each test method to shard the job into multiple shards. This file will be overwritten with the latest timing record after the job is completed.
"gcsInputFile": { # A path to a file or directory in Google Cloud Storage. # An input file in Google Cloud Storage.
"path": "A String", # Required. The Google Cloud Storage path of the file or directory. Format: `gs:///`.
},
},
},
"testInstallable": { # An Android Installable represents the file(s) for installing an Android package on a device. This can be an APK, an Android App Bundle (AAB), or an APK Set. # Required. The test package to install and run the test.
"files": [ # Required. Files that make up the package. Supported formats are distinguished by their file extension: - APK: One or more files with extension `.apk`. - App Bundle: A single file with extension `.aab`. - APK Set: A single file with extension `.apks`.
{ # Input file.
"gcsInputFile": { # A path to a file or directory in Google Cloud Storage. # An input file in Google Cloud Storage.
"path": "A String", # Required. The Google Cloud Storage path of the file or directory. Format: `gs:///`.
},
},
],
},
"testRunnerClass": "A String", # Optional. Full class name of the test runner class. The class must be `androidx.test.runner.AndroidJUnitRunner` or a subclass of it. The default value is determined by examining the application's manifest. If multiple instrumentations are found, the first one in the manifest will be used.
"testTargets": [ # Optional. A list of test targets or target filters to run. Each target must be fully qualified with the package name or class name, in one of these formats: - `package package_name` - `notPackage com.package.to.skip` - `class package_name.class_name` - `class package_name.class_name#method_name` - `notClass com.foo.ClassToSkip` - `notClass com.foo.ClassName#testMethodToSkip` - `annotation com.foo.AnnotationToRun` - `notAnnotation com.foo.AnnotationToSkip` - `size [small|medium|large]` Formats like `testfile` or `notTestfile` won't be supported. If empty, all targets in the module will be run. Limits: - Maximum number of entries: 1024.
"A String",
],
"uniformSharding": { # Uniformly shards test cases given a total number of shards. It will be translated to `-e numShard` and `-e shardIndex` AndroidJUnitRunner arguments. With uniform sharding enabled, specifying either of these sharding arguments via `environment_variables` is invalid. Based on the sharding mechanism AndroidJUnitRunner uses, there is no guarantee that test cases will be distributed uniformly across all shards. # Optional. Uniform sharding strategy to split the job into multiple shards with equal number of test methods.
"shardCount": 42, # Required. The total number of shards to create. This must always be a positive number that is no greater than the total number of test cases. Limits: - For physical devices, the number of shards must be <= 20. - For virtual devices, the number of shards must be <= 200.
},
},
"androidNativeBinary": { # The configuration of an Android native binary execution. # Android native binary execution.
"androidNativeBinary": { # Input file. # Required. The file path of the Android native binary.
"gcsInputFile": { # A path to a file or directory in Google Cloud Storage. # An input file in Google Cloud Storage.
"path": "A String", # Required. The Google Cloud Storage path of the file or directory. Format: `gs:///`.
},
},
"args": [ # Optional. Arguments for running the binary file. The flags will be appended to the command line that invokes the binary. The number of options is limited to 100.
"A String",
],
"envVars": { # Optional. A map of environment variables to set for the binary process. The keys are the variable names and the values are the variable values. The maximum number of entries is 100. Each key is limited to 128 characters and must conform to POSIX standards. Each value is limited to 2048 characters. The total size of all environment variables must not exceed 16 KiB.
"a_key": "A String",
},
"executionTimeout": "A String", # Optional. The timeout of the execution. Default value: 5 min. Range: [1 min, 3 hours].
},
"iosXcTest": { # The configuration of an iOS XCTest. # iOS XCTest.
"testsZip": { # Input file. # Required. The .zip containing the .xctestrun file and the contents of the DerivedData/Build/Products directory.
"gcsInputFile": { # A path to a file or directory in Google Cloud Storage. # An input file in Google Cloud Storage.
"path": "A String", # Required. The Google Cloud Storage path of the file or directory. Format: `gs:///`.
},
},
"xcTestTimeout": "A String", # Optional. The timeout of the test. Default value: 5 min. Range: [1 min, 3 hours].
"xcodeVersion": "A String", # Optional. The Xcode version that should be used for the test. If not set, a system-default Xcode version is used. The available Xcode versions can be retrieved from the catalog service.
"xctestrun": { # Input file. # Optional. An .xctestrun file that will override the .xctestrun file in the tests zip.
"gcsInputFile": { # A path to a file or directory in Google Cloud Storage. # An input file in Google Cloud Storage.
"path": "A String", # Required. The Google Cloud Storage path of the file or directory. Format: `gs:///`.
},
},
},
},
"allocationConfig": { # Allocation config. # Required. Allocation config.
"deviceConfigs": [ # Required. At least one device config is required. If more than one device config is required, the multiple devices are allocated to each shard of the OmniLab job to run multi-device-interaction tests.
{ # The configuration of a run on a device.
"actions": [ # Optional. The actions to be performed on the device. Actions will be executed in the order they are specified in the list. Each action type can at most have 1 instance in the list.
{ # The action to be performed on a device.
"androidBugreport": { # Captures a bugreport from the device. The output will be written to a file named `bugreport.zip` in the execution output directory. # Captures a bugreport from the device unless the test result is pass.
"collectOnPass": True or False, # Optional. Whether to deliver the bugreport when the test passes. If false, the bugreport is skipped on pass to save time (default behavior). If true, the bugreport is always delivered.
},
"androidDumpsys": { # Captures dumpsys output from the device. The output will be written to a file named `dumpsys.log` in the execution output directory. # Captures a dumpsys from the device.
"collectOnPass": True or False, # Optional. Whether to deliver the dumpsys when the test passes. If false, the dumpsys is skipped on pass to save time (default behavior). If true, the dumpsys is always delivered.
},
"androidInstallPackages": { # Installs Android packages on the device. At least one installable is specified when using this device action. Limits: - A maximum of 20 installables in total are allowed. - A maximum of 100 files are allowed in total across all installables. # Installs Android packages on the device.
"installables": [ # Optional. Deprecated: use `pre_target_app_installables`, `target_app` and `post_target_app_installables` instead. The Android packages to install on the device. The installation will be performed in the order specified, before the installables of all other fields.
{ # An Android Installable represents the file(s) for installing an Android package on a device. This can be an APK, an Android App Bundle (AAB), or an APK Set.
"files": [ # Required. Files that make up the package. Supported formats are distinguished by their file extension: - APK: One or more files with extension `.apk`. - App Bundle: A single file with extension `.aab`. - APK Set: A single file with extension `.apks`.
{ # Input file.
"gcsInputFile": { # A path to a file or directory in Google Cloud Storage. # An input file in Google Cloud Storage.
"path": "A String", # Required. The Google Cloud Storage path of the file or directory. Format: `gs:///`.
},
},
],
},
],
"postTargetAppInstallables": [ # Optional. The Android packages to install on the device after `target_app` (if specified) is installed. The installation will be performed in the order specified.
{ # An Android Installable represents the file(s) for installing an Android package on a device. This can be an APK, an Android App Bundle (AAB), or an APK Set.
"files": [ # Required. Files that make up the package. Supported formats are distinguished by their file extension: - APK: One or more files with extension `.apk`. - App Bundle: A single file with extension `.aab`. - APK Set: A single file with extension `.apks`.
{ # Input file.
"gcsInputFile": { # A path to a file or directory in Google Cloud Storage. # An input file in Google Cloud Storage.
"path": "A String", # Required. The Google Cloud Storage path of the file or directory. Format: `gs:///`.
},
},
],
},
],
"preTargetAppInstallables": [ # Optional. The Android packages to install on the device before `target_app` (if specified) is installed. The installation will be performed in the order specified.
{ # An Android Installable represents the file(s) for installing an Android package on a device. This can be an APK, an Android App Bundle (AAB), or an APK Set.
"files": [ # Required. Files that make up the package. Supported formats are distinguished by their file extension: - APK: One or more files with extension `.apk`. - App Bundle: A single file with extension `.aab`. - APK Set: A single file with extension `.apks`.
{ # Input file.
"gcsInputFile": { # A path to a file or directory in Google Cloud Storage. # An input file in Google Cloud Storage.
"path": "A String", # Required. The Google Cloud Storage path of the file or directory. Format: `gs:///`.
},
},
],
},
],
"targetApp": { # An Android Installable represents the file(s) for installing an Android package on a device. This can be an APK, an Android App Bundle (AAB), or an APK Set. # Optional. The primary Android package to install, serving as the target package for subsequent actions and as the installation ordering anchor. Whether this package is treated as the application under test depends on the job action: - Actions that require an explicit target package (such as performance metrics collection, or accessibility scans) use this package to identify the application to inspect or drive. - Actions that discover or manage targets independently (such as Android instrumentation tests, where target packages are defined in the test runner manifest) treat this field primarily as an installation order anchor between pre- and post-installables. Optional. If omitted, all packages in `pre_target_app_installables` and `post_target_app_installables` are installed without a designated target package.
"files": [ # Required. Files that make up the package. Supported formats are distinguished by their file extension: - APK: One or more files with extension `.apk`. - App Bundle: A single file with extension `.aab`. - APK Set: A single file with extension `.apks`.
{ # Input file.
"gcsInputFile": { # A path to a file or directory in Google Cloud Storage. # An input file in Google Cloud Storage.
"path": "A String", # Required. The Google Cloud Storage path of the file or directory. Format: `gs:///`.
},
},
],
},
},
"androidLogcat": { # Collects logcat output from the device. The output will be written to a file named `logcat.txt` in the execution output directory. # Collects logcat output from the device.
},
"androidMockLocation": { # Mocks the location of the Android device. # Mocks the location of the device.
"location": { # An object that represents a latitude/longitude pair. This is expressed as a pair of doubles to represent degrees latitude and degrees longitude. Unless specified otherwise, this object must conform to the WGS84 standard. Values must be within normalized ranges. # Required. The mock location to set on the device.
"latitude": 3.14, # The latitude in degrees. It must be in the range [-90.0, +90.0].
"longitude": 3.14, # The longitude in degrees. It must be in the range [-180.0, +180.0].
},
},
"androidOrientation": { # Sets the orientation of the device. # Sets the orientation of the device.
"orientation": "A String", # Required. The orientation to set the device to. One of `portrait` or `landscape`.
},
"androidPullFiles": { # Pulls directories and files from the device at the end of the run. Files will be copied to the '/artifacts' directory, with the absolute path structure preserved. Note that: 1. A clean device is provided for the run. 2. Any existing files in the output directory may be overwritten. 3. Pulling files is best effort. Will skip files if they don't exist on the device. # Pulls directories and files from the device at the end of the run.
"paths": [ # Required. Absolute directory or file paths to pull from the device. Limits: - A maximum of 10 paths are allowed.
"A String",
],
},
"androidPushFiles": { # Pushes files to the device at the beginning of the run. Files are overwritten if a file with the same path already exists on the device, if device permissions allow. # Pushes files to the device at the beginning of the run.
"fileConfigs": [ # Required. Configs of pushing files to the device. Limits: - A maximum of 50 files are allowed.
{ # The configuration of pushing a file to the device.
"destinationPath": "A String", # Required. The destination path on the device.
"sourceFile": { # Input file. # Required. The file to be pushed to the device.
"gcsInputFile": { # A path to a file or directory in Google Cloud Storage. # An input file in Google Cloud Storage.
"path": "A String", # Required. The Google Cloud Storage path of the file or directory. Format: `gs:///`.
},
},
},
],
},
"androidRecordVideo": { # Records a video of the device screen during the run. The video will be written to a file named `video.mp4` in the execution output directory. # Records a video of the device screen during the run.
"discardOnPass": True or False, # Optional. Whether to discard and not upload the recording when the test passes. Default is false.
},
"androidSwitchLocale": { # Switches the locale (language and region) of the device. # Switches the locale (language and region) of the device.
"localeCode": "A String", # Required. The locale (language and region) to switch the device to. The format is `language-region`, e.g. "en-US", "zh-CN", etc. The typical language value is a two or three-letter language code as defined in ISO639. The typical region value is a two-letter ISO 3166 code or a three-digit UN M.49 area code.
},
"iosAppPrivacyReport": { # Collects the exported iOS App Privacy Report during the test run. When enabled, the iOS device records application activity (such as network access, domain requests, and sensitive resource access like photos, camera, or location) and exports Apple's official App Privacy Report. The report will be written to a file named `AppActivityReport.ndjson` in the execution output directory. # Collects the exported iOS App Privacy Report during the run.
},
"iosInstallPackages": { # Installs iOS packages on the device. # Installs additional iOS packages on the device.
"ipas": [ # Required. Additional iOS packages (IPAs) to install on the device. Limits: - A maximum of 20 IPAs are allowed.
{ # Input file.
"gcsInputFile": { # A path to a file or directory in Google Cloud Storage. # An input file in Google Cloud Storage.
"path": "A String", # Required. The Google Cloud Storage path of the file or directory. Format: `gs:///`.
},
},
],
},
"iosPullFiles": { # Pulls directories and files from the iOS device sandbox at the end of the run. # Pulls directories and files from the iOS device sandbox at the end of the run.
"paths": [ # Required. Absolute directory or file paths to pull from the device. Limits: - A maximum of 10 paths are allowed.
{ # The configuration of pulling a file or directory from the iOS device.
"bundleId": "A String", # Required. The bundle ID of the application sandbox.
"devicePath": "A String", # Required. The device path relative to the app sandbox, e.g. "/Documents/output/".
},
],
},
"iosPushFiles": { # Pushes files to the iOS device sandbox at the beginning of the run. # Pushes files to the iOS device sandbox at the beginning of the run.
"fileConfigs": [ # Required. Configs of pushing files to the device. Limits: - A maximum of 50 files are allowed.
{ # The configuration of pushing a file to the iOS device.
"bundleId": "A String", # Required. The bundle ID of the application sandbox.
"destinationPath": "A String", # Required. The destination path relative to the app sandbox, e.g. "/Documents/file.txt".
"sourceFile": { # Input file. # Required. The file to be pushed.
"gcsInputFile": { # A path to a file or directory in Google Cloud Storage. # An input file in Google Cloud Storage.
"path": "A String", # Required. The Google Cloud Storage path of the file or directory. Format: `gs:///`.
},
},
},
],
},
"iosRecordVideo": { # Records a video of the iOS device screen during the run. The video will be written to a file named `video.mp4` in the execution output directory. # Records a video of the iOS device screen during the run.
"discardOnPass": True or False, # Optional. Whether to discard the video if the test passes. If not specified, the default is false (always keep the video).
},
"iosSwitchLocale": { # Switches the locale (language and region) of the iOS application. # Switches the locale (language and region) of the iOS application.
"localeCode": "A String", # Required. The locale (language and region) to switch the app to. The format is `language-region` or `language`, e.g. "en-US", "zh-CN", "ja", etc.
},
},
],
"requirement": { # The requirement of a device. # Required. The requirement of the device.
"deviceId": "A String", # The device ID of a device in the catalog. The device ID is the last part of a device's resource name.
},
},
],
},
"displayName": "A String", # Optional. User-settable, human-readable name for the job. If set, it must be unique within the session. If not set, the display name will default to `job-`, where `` is the 0-based index of the job in the session formatted as three digits (e.g., job-000, job-001, ...). Maximum size is 63 bytes when encoded as UTF-8. If set, must match regex: `^A-Za-z0-9*$`.
"labels": { # Optional. User-defined metadata for tracking or categorization. These labels do not affect job execution and are surfaced in the JobReport. Limits: - Maximum number of entries: 16. - Maximum key size: 32 bytes (UTF-8). - Maximum value size: 1024 bytes (UTF-8).
"a_key": "A String",
},
"settings": { # Job settings to control the job execution. # Optional. Job settings.
"retrySettings": { # Retry settings. # Optional. The retry settings of the job.
"flakyTestRetryStrategy": { # Default retry strategy. It will retry on test failures for up to flaky_test_attempts (including the initial run). It also retries on infra issues for up to 2 attempts (including the initial run). So in total, an execution can run up to flaky_test_attempts * 2 times in the worst case. # Optional. The default retry strategy. Allows an Execution to retry on test failures and infrastructure errors.
"flakyTestAttempts": 42, # Required. The total attempts for flaky tests, including the initial run. Default value: 1 (no retry). Range: [1, 5].
"parallelRetry": True or False, # Optional. Whether to retry the test failures in parallel. By default, the test is retried sequentially. If true, when the initial attempt fails, (flaky_test_attempts - 1) attempts will be triggered at the same time to run in parallel.
"testReductionMode": "A String", # Optional. The mode of test reduction for retry. If the test runner doesn't support the specified test reduction mode, the request will be rejected with an `INVALID_ARGUMENT` error.
},
},
},
},
],
"notificationConfig": { # Config to control session notification. # Optional. Notification config for the session.
"pubsubTopic": [ # Optional. The Pub/Sub topics to which session events are published. Format: `projects/{project}/topics/{topic}`. See https://cloud.google.com/pubsub/docs/admin#topic_and_subscription_name_restrictions
"A String",
],
},
"outputDirectoryConfig": { # Config to control session output file directory. # Required. Output file directory config for the session.
"flatDirectoryStructure": True or False, # Optional. Whether to write output files directly under the output directory instead of nesting them under service-generated subdirectories. By default (`false`), output files are stored under `////`. When `true`, the session ID subdirectory is never appended, and the job display name subdirectory is appended only when the session has more than one job. Output files are therefore stored under: - `//` for a single-job session. - `///` for a multi-job session. Set this to `true` when the output directory is already unique per session (for example, when a CI system generates it), to avoid redundant nesting.
"gcsOutputDirectory": { # A path to a file or directory in Google Cloud Storage. # The Google Cloud Storage path of the output directory (e.g. `gs://my-bucket/output`). The bucket must exist. If the bucket is located in another project or uses fine-grained access controls, ensure the Device Run Service Agent of the project (`service-@gcp-sa-devicerun.iam.gserviceaccount.com`) is granted access to the bucket (such as `roles/storage.objectUser`).
"path": "A String", # Required. The Google Cloud Storage path of the file or directory. Format: `gs:///`.
},
},
},
"sessionReport": { # The runtime information and result report of a session. # Output only. The runtime information and result report of the session.
"endTime": "A String", # Output only. The end time of the session.
"id": "A String", # Output only. The unique identifier of the session.
"jobReports": [ # Output only. Reports of the jobs in the session.
{ # The runtime information and result report of a job.
"displayName": "A String", # Output only. The display_name set by users in the JobConfig.
"endTime": "A String", # Output only. The end time of the job.
"executionReports": [ # Output only. Reports of the execution attempts of the job.
{ # The runtime information and result report of a single on-device execution attempt.
"displayName": "A String", # Output only. The display_name set by users in the ExecutionConfig.
"endTime": "A String", # Output only. The end time of the execution.
"id": "A String", # Output only. The unique identifier of the execution.
"outputFiles": [ # Output only. The output files of the execution.
{ # Output file.
"gcsOutputFile": { # A path to a file or directory in Google Cloud Storage. # An output file in Google Cloud Storage.
"path": "A String", # Required. The Google Cloud Storage path of the file or directory. Format: `gs:///`.
},
},
],
"result": { # The result of a session/job/execution. # Output only. The result of the execution.
"cause": { # Describes the cause of the non-passed result occurred during the execution. # Output only. Detailed result cause diagnostics. Set if type is not PASSED.
"summary": { # Describes the summary of an issue (error or warning) with structured details. # Output only. Structured cause detail.
"message": "A String", # Output only. Human-readable explanation of the issue in English.
"reason": "A String", # Output only. The reason of the issue. This is a constant value that identifies the proximate cause of the issue. This should be at most 63 characters and match a regular expression of `A-Z*[A-Z0-9]`, which represents UPPER_SNAKE_CASE.
"type": "A String", # Output only. The issue classification based on responsibility.
},
},
"resultType": "A String", # Output only. The result type of the session/job/execution.
},
"startTime": "A String", # Output only. The start time of the execution.
"status": { # The status of a session/job/execution. # Output only. The status of the execution.
"progressMessages": [ # Output only. Human-readable, detailed descriptions of the session/job/execution's progress. For example: "Provisioning a device", "Starting Test". Each message should contain only one line of text. During the course of execution new data may be appended to the end of progress_messages.
"A String",
],
"statusType": "A String", # Output only. The status type of the session/job/execution.
},
"warnings": [ # Output only. Non-fatal warnings collected during the execution.
{ # Non-fatal operational anomaly, lint observation, or execution insight.
"summary": { # Describes the summary of an issue (error or warning) with structured details. # Output only. Detailed warning summary.
"message": "A String", # Output only. Human-readable explanation of the issue in English.
"reason": "A String", # Output only. The reason of the issue. This is a constant value that identifies the proximate cause of the issue. This should be at most 63 characters and match a regular expression of `A-Z*[A-Z0-9]`, which represents UPPER_SNAKE_CASE.
"type": "A String", # Output only. The issue classification based on responsibility.
},
},
],
},
],
"id": "A String", # Output only. The unique identifier of the job.
"labels": { # Output only. The original labels provided by the user during job creation.
"a_key": "A String",
},
"outputFiles": [ # Output only. The output files of the job.
{ # Output file.
"gcsOutputFile": { # A path to a file or directory in Google Cloud Storage. # An output file in Google Cloud Storage.
"path": "A String", # Required. The Google Cloud Storage path of the file or directory. Format: `gs:///`.
},
},
],
"result": { # The result of a session/job/execution. # Output only. The result of the job.
"cause": { # Describes the cause of the non-passed result occurred during the execution. # Output only. Detailed result cause diagnostics. Set if type is not PASSED.
"summary": { # Describes the summary of an issue (error or warning) with structured details. # Output only. Structured cause detail.
"message": "A String", # Output only. Human-readable explanation of the issue in English.
"reason": "A String", # Output only. The reason of the issue. This is a constant value that identifies the proximate cause of the issue. This should be at most 63 characters and match a regular expression of `A-Z*[A-Z0-9]`, which represents UPPER_SNAKE_CASE.
"type": "A String", # Output only. The issue classification based on responsibility.
},
},
"resultType": "A String", # Output only. The result type of the session/job/execution.
},
"startTime": "A String", # Output only. The start time of the job.
"status": { # The status of a session/job/execution. # Output only. The status of the job.
"progressMessages": [ # Output only. Human-readable, detailed descriptions of the session/job/execution's progress. For example: "Provisioning a device", "Starting Test". Each message should contain only one line of text. During the course of execution new data may be appended to the end of progress_messages.
"A String",
],
"statusType": "A String", # Output only. The status type of the session/job/execution.
},
"warnings": [ # Output only. Non-fatal warnings collected during the job.
{ # Non-fatal operational anomaly, lint observation, or execution insight.
"summary": { # Describes the summary of an issue (error or warning) with structured details. # Output only. Detailed warning summary.
"message": "A String", # Output only. Human-readable explanation of the issue in English.
"reason": "A String", # Output only. The reason of the issue. This is a constant value that identifies the proximate cause of the issue. This should be at most 63 characters and match a regular expression of `A-Z*[A-Z0-9]`, which represents UPPER_SNAKE_CASE.
"type": "A String", # Output only. The issue classification based on responsibility.
},
},
],
},
],
"result": { # The result of a session/job/execution. # Output only. The result of the session.
"cause": { # Describes the cause of the non-passed result occurred during the execution. # Output only. Detailed result cause diagnostics. Set if type is not PASSED.
"summary": { # Describes the summary of an issue (error or warning) with structured details. # Output only. Structured cause detail.
"message": "A String", # Output only. Human-readable explanation of the issue in English.
"reason": "A String", # Output only. The reason of the issue. This is a constant value that identifies the proximate cause of the issue. This should be at most 63 characters and match a regular expression of `A-Z*[A-Z0-9]`, which represents UPPER_SNAKE_CASE.
"type": "A String", # Output only. The issue classification based on responsibility.
},
},
"resultType": "A String", # Output only. The result type of the session/job/execution.
},
"startTime": "A String", # Output only. The start time of the session.
"status": { # The status of a session/job/execution. # Output only. The status of the session.
"progressMessages": [ # Output only. Human-readable, detailed descriptions of the session/job/execution's progress. For example: "Provisioning a device", "Starting Test". Each message should contain only one line of text. During the course of execution new data may be appended to the end of progress_messages.
"A String",
],
"statusType": "A String", # Output only. The status type of the session/job/execution.
},
},
},
],
"unreachable": [ # Unordered list. Sessions that could not be reached.
"A String",
],
}
list_next(previous_request, previous_response)
Retrieves the next page of results. Args: previous_request: The request for the previous page. (required) previous_response: The response from the request for the previous page. (required) Returns: A request object that you can call 'execute()' on to request the next page. Returns None if there are no more items in the collection.