mac 使用命令下载软件

以下载xcode为例:

curl -H "Referrer Policy:no-referrer-when-downgrade" \
-H "Accept-Encoding:gzip, deflate, br" \
-H "Accept:text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8" \
-H "Connection:keep-alive" \
-H "Host:download.developer.apple.com" \
-H "Referer:https://developer.apple.com/download/more/" \
-H "Upgrade-Insecure-Requests:1" \
-H "User-Agent:Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.115 Safari/537.36" \
--cookie "{cookie_content}" \
-o ./{file_name} \
{xcode_download_url}

替换cookie_content、file_name、xcode_download_url三个变量即可。cookie_content 和 xcode_download_url 都可以在用浏览器下载Xcode的时候看到,file_name就是保存的名字。

ps:速度贼快~下载5个多g的xcode10.2只用了半个多小时耶~

你可能感兴趣的:(mac,xcode)