String list = StringUtils.join(components, ',');
log(logger, Messages.INSTALLING_SDK_COMPONENTS(list));
String all = sdk.getSdkToolsVersion() < 17 ? "-o" : "-a";
String upgradeArgs = String.format("update sdk -u %s %s -t %s", all, proxySettings, list);
ArgumentListBuilder cmd = Utils.getToolCommand(sdk, launcher.isUnix(), Tool.ANDROID, upgradeArgs);
ProcStarter procStarter = launcher.launch().stderr(logger).readStdout().writeStdin().cmds(cmd);
if (sdk.hasKnownHome()) {
EnvVars env = new EnvVars();
env.put("ANDROID_SDK_HOME", sdk.getSdkHome());
procStarter = procStarter.envs(env);
}
// Run the command and accept any licence requests during installation
Proc proc = procStarter.start();
BufferedReader r = new BufferedReader(new InputStreamReader(proc.getStdout()));
String line;
while (proc.isAlive() && (line = r.readLine()) != null) {
logger.println(line);
if (line.toLowerCase(Locale.ENGLISH).startsWith("license id: ")) {