# `factory` Usage `factory` contains miscellaneous factory commands to run on DUTs. This user guide lists some commonly used `factory` commands. ## factory clear This command stops all running tests and clears their states. ## factory device-data This command shows the content of the device data dictionary. ``` localhost ~ # factory device-data component: ... fw_config: ... program: project: ... ``` To get a specific device data, use `-g` option. ``` localhost ~ # factory device-data -g fw_config 12345 ``` device-data also supports setting or deleting keys. ``` localhost ~ # factory device-data --delete project localhost ~ # factory device-data project= ``` Or you can set the device data from a yaml file. ``` factory device-data --set-yaml FILE ``` To specify the output format, use `--format`. The supported formats are `yaml`, `json` and `pprint`. ## factory dump-test-list This command dumps a test list in certain format. For instance, `factory dump-test-list main_`. You can specify the output format by `factory dump-test-list --format [format] `. The supported formats are: `yaml`, `csv`, `json`, `pprint`. ## factory phase This command queries or sets the current phase. ``` localhost ~ # factory phase PROTO localhost ~ # factory phase --set EVT [INFO] factory.py phase.py:180 2021-07-18 13:45:46.786 Setting phase to EVT in /var/factory/state/PHASE EVT localhost ~ # factory phase EVT ``` ## factory screenshot This command takes a screenshot of the Goofy tab that runs the factory test UI. By default, the images are stored under `/var/log/screenshot_