无需手动确认即可使用 Flutter 接受 Android 个许可

Accepting Android licenses using Flutter without manual confirmation

我正在创建一个 shell 脚本,用于将机器设置为 CI/CD 运行ner。我们将使用此 CI 管道构建 android 带有 flutter 的 APK。为了完成初始 运行ner 设置,我需要安装 Android SDK、Flutter CLI 等。为此,我需要使用此命令接受 android 许可证:

flutter doctor --android-licenses

在那里,会出现一个提示,输入 'y' 作为确认。我知道要阅读并接受许可证。但是,由于我正在编写 shell 程序,有没有办法绕过手动确认?

在Linux中,我们使用-y来避免在包安装过程中出现提示。同样,有没有办法避免人工确认?

其他信息:

  1. OS 我要 运行 这个:MacOS
  2. 终端:zsh
  3. Shell 脚本:#!/bin/bash

yes 永远输出 y

yes | flutter doctor --android-licenses