gcloud topic arg-files Stay organized with collections Save and categorize content based on your preferences.
- NAME
- gcloud topic arg-files - supplementary help for arg-files to be used with
gcloud firebase test
- gcloud topic arg-files - supplementary help for arg-files to be used with
- DESCRIPTION
- Supplementary help for arg-files to be used with
gcloud firebase test.All
gcloudfirebase test android runarguments may be specified by flags on thecommand line and/or via a YAML-formattedARG_FILE. Theoptional, positional ARG_SPEC argument on the command line is used to specify asingleARG_FILE:ARG_GROUP_NAMEpair, whereARG_FILEis the path to the YAML argumentfile, andARG_GROUP_NAMEis the name of the argumentgroup to load and parse. TheARG_FILEmust contain validYAML syntax or gcloud will respond with an error.The basic format of a YAML argument file is:
arg-group1:arg1:value1# a commentarg2:value2…# Another commentarg-group2:arg3:value3…List arguments may be specified within square brackets:
directories-to-pull:[/sdcard/dir1,/data/dir2]
or by using the alternate YAML list notation with one dash per list item:
directories-to-pull:-/sdcard/dir1-/data/dir2
If a list argument only contains a single value, you may omit the squarebrackets:
directories-to-pull:/sdcard/dir1
Composition
A special
include: [syntax allows merging or composition of argument groups (seeARG_GROUP1, …]EXAMPLESbelow). Included argument groups caninclude:other argument groups within the same YAML file, with unlimited nesting.Precedence
An argument which appears on the command line has the highest precedence andwill override the same argument if it is specified within an argument file.
Any argument defined directly within a group will have higher precedence than anidentical argument which is merged into that group using the
include:keyword. - EXAMPLES
- Here are the contents of a very simple YAML argument file which is assumed to bestored in a file named excelsior_args.yaml:
# Run a quick 'robo' test on the 'Excelsior' app for# 90 seconds using only the default Test Lab device.quick-robo-test:app:path/to/excelsior.apktype:robomax-steps:100timeout:90sasync:true
To invoke this test, run:
gcloudfirebasetestandroidrunexcelsior_args.yaml:quick-robo-testTo select which device(s) you wish to test against in an argument file, use
device:to specify one or more devices, with each device having oneor more dimensions. For example, to specify the LG G3 device in the Chineselocale and with landscape orientation, use:single-device-group:device:[{model:g3,orientation:landscape,locale:zh}]
To specify multiple devices, use any of the following equivalent YAML formats:
multi-device-group1:device:[{model:flo},{model:g3,version:19,locale:zh},{model:mako,version:21}]
multi-device-group2:device:-{model:flo}-{model:g3,version:19,locale:zh}-{model:mako,version:21}
multi-device-group3:device:-model:flo-model:g3version:19locale:zh-model:makoversion:21
If your app has a login screen, or has additional UI elements which requireinput text, you may specify the resource names of the Android target UIelements, along with their corresponding input values, in the 'robo-directives'map argument. You may also specify the elements which the Robo test shouldprioritize clicking. In the example below, "username_resource" is the resourcename of the username field and "username" is the input for that field (similarlyfor password), and "signin_button_resource" is the resource name of the sign inbutton.
# Run a 'robo' test on the 'Excelsior' app with login credentials.robo-test-with-login:app:path/to/excelsior.apktype:roborobo-directives:"text:username_resource":username"text:password_resource":password"click:sigin_button_resource":""
Assuming the above YAML text is appended to the arg-file namedexcelsior_args.yaml, you may invoke the test by running:
gcloudfirebasetestandroidrunexcelsior_args.yaml:robo-test-with-loginHere is a slightly more complicated example which demonstrates composition ofargument groups using the legacy device dimension arguments(
device:is now the preferred way to specify test devices). Assumethe following YAML text is appended to the arg-file shown above namedexcelsior_args.yaml:# Specify some unit tests to be run against a test matrix# with one device type, two Android versions, and four# locales, for a total of eight test variations (1*2*4).unit-tests:type:instrumentationapp:path/to/excelsior.apktest:path/to/excelsior-test.apk# the unit teststimeout:10mdevice-ids:NexusLowResinclude:[supported-versions,supported-locales]
supported-versions:os-version-ids:[21,22]
supported-locales:locales:[en,es,fr,it]
To invoke this test matrix, run:
gcloudfirebasetestandroidrunexcelsior_args.yaml:unit-testsTo run these unit tests with the same locales and os-version-ids, butsubstituting a sampling of three physical Android devices instead of the singlevirtual NexusLowRes device, run:
gcloudfirebasetestandroidrunexcelsior_args.yaml:unit-tests--device-idsshamu,htc_m8,g3In the last example, the --device-ids argument on the command line overrides thedevice-ids: specification inside the arg-file because command-line argumentshave higher precedence.
- NOTES
- These variants are also available:
gcloudalphatopicarg-filesgcloudbetatopicarg-files
Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-07-22 UTC.