Effective in 2026, to align with our trunk stable development model and ensure platform stability for the ecosystem, we will publish source code to AOSP in Q2 and Q4. For building and contributing to AOSP, use android-latest-release. The android-latest-release manifest branch will always reference the most recent release pushed to AOSP. For more information, see Changes to AOSP.
Stay organized with collections
Save and categorize content based on your preferences.
AndroidBuildFetcher
public
class
AndroidBuildFetcher
extends Object
| java.lang.Object
|
| ↳ |
com.google.android.tradefed.build.AndroidBuildFetcher
|
Helper class used for downloading files from Android Build API.
Summary
Public methods |
void
|
fetchArtifact(String target, String buildId, String resourceId, String attemptId, File outputFile)
Download artifact to local file.
|
void
|
fetchArtifact(String target, String buildId, String resourceId, String attemptId, File outputFile, long startOffset, long size)
Download part of the artifact to local file with the given range.
|
void
|
fetchDeviceBlob(String deviceName, String binaryType, String version, File outputFile)
Download device blob to local file.
|
BuildArtifactMetadata
|
getArtifactMetadata(String target, String buildId, String resourceId, String attemptId)
Get the metadata of a build artifact.
|
void
|
setUseMd5(boolean useMd5)
|
Public constructors
AndroidBuildFetcher
public AndroidBuildFetcher (String buildEnv)
Constructor of AndroidBuildFetcher.
| Parameters |
buildEnv |
String: the Build API environment to use. |
| Throws |
|
java.io.IOException |
|
java.security.GeneralSecurityException |
GeneralSecurityException |
|
IOException |
|
Public methods
fetchArtifact
public void fetchArtifact (String target,
String buildId,
String resourceId,
String attemptId,
File outputFile)
Download artifact to local file.
| Parameters |
target |
String: artifact target. If it's null, the download will fail. |
buildId |
String: artifact buildId. If it's null, the download will fail. |
resourceId |
String: the filename to download. If it's null, the download will fail. |
attemptId |
String: latest, current or attempt id, default is latest. |
outputFile |
File: download the file to this local file. |
| Throws |
|
com.android.tradefed.build.BuildRetrievalError |
|
java.io.IOException |
BuildRetrievalError |
|
IOException |
|
fetchArtifact
public void fetchArtifact (String target,
String buildId,
String resourceId,
String attemptId,
File outputFile,
long startOffset,
long size)
Download part of the artifact to local file with the given range.
| Parameters |
target |
String: artifact target. If it's null, the download will fail. |
buildId |
String: artifact buildId. If it's null, the download will fail. |
resourceId |
String: the filename to download. If it's null, the download will fail. |
attemptId |
String: latest, current or attempt id, default is latest. |
outputFile |
File: download the file to this local file. |
startOffset |
long: the start offset of the file to download. |
size |
long: number of bytes to download. Set it to a negative value to fetch the whole file. |
| Throws |
|
com.android.tradefed.build.BuildRetrievalError |
|
java.io.IOException |
BuildRetrievalError |
|
IOException |
|
fetchDeviceBlob
public void fetchDeviceBlob (String deviceName,
String binaryType,
String version,
File outputFile)
Download device blob to local file.
| Parameters |
deviceName |
String: If this is null, the download will fail. |
binaryType |
String: radio.img or bootloader.img. If this is null, the download will fail. |
version |
String: device version. If this is null, the download will fail. |
outputFile |
File: local file. Download the blob to this local file. |
| Throws |
|
java.io.IOException |
IOException |
|
public BuildArtifactMetadata getArtifactMetadata (String target,
String buildId,
String resourceId,
String attemptId)
Get the metadata of a build artifact.
| Parameters |
target |
String: artifact target. If it's null, the download will fail. |
buildId |
String: artifact buildId. If it's null, the download will fail. |
resourceId |
String: the filename to download. If it's null, the download will fail. |
attemptId |
String: latest, current or attempt id, default is latest. |
| Throws |
|
java.io.IOException |
IOException |
|
setUseMd5
public void setUseMd5 (boolean useMd5)
| Parameters |
useMd5 |
boolean |
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2026-06-22 UTC.
[null,null,["Last updated 2026-06-22 UTC."],[],[]]