通过 CLI 读取或设置配置项,适合在持续集成等自动化场景中预先写入运行、发行所需配置。
注意:
cli config的读写只作用于 CLI 自身,不会改变 IDE 的设置。 执行命令前,请先执行cli open。
cli config get --key <配置项Key>
| 参数 | 说明 |
|---|---|
--key | 配置项的 Key |
示例:
cli config get --key uts-development-android.gradleHome
cli config set --key <配置项Key> --value <配置项值> [--type <值类型>]
| 参数 | 说明 |
|---|---|
--key | 配置项的 Key |
--value | 需要设置的配置项值 |
--type | 配置项的值类型,可选 number、boolean、string,不填默认为 string |
示例:
# 设置字符串配置项
cli config set --key uts-development-android.gradleHome --value <gradle 可执行文件路径>
# 设置数字配置项
cli config set --key editor.fontSize --value 16 --type number
# 设置布尔配置项
cli config set --key editor.wordWrap --value true --type boolean