“android update sdk” on headless linux

前端 未结 5 1305
面向向阳花
面向向阳花 2020-11-28 23:27

Has anybody succeeded in updating/installing Android SDK platforms on a headless Linux server? All I got is the following error:

It seems like the action \"update s

5条回答
  •  囚心锁ツ
    2020-11-29 00:01

    You can use the --no-ui option:

    android update sdk --no-ui
    

    If you'd like to automate it, you could accept all licenses by using the expect tool with this hack (the --accept-license option is currently not fully integrated in the android tool):

    expect -c '
    set timeout -1;
    spawn android - update sdk --no-ui;
    expect {
        "Do you accept the license" { exp_send "y\r" ; exp_continue }
        eof
    }
    '
    

提交回复
热议问题