局域网内搭建Android SDK更新源

工作杂记,后期有时间整理:


cd /var/www/nginx-default/android/repository

rsync -avP /home/gg/android-tools/143/sdksrc/html/android/repository/ ./
rsync -avP /home/gg/android-tools/198/sdksrc/html/android/repository/ ./

sed -e 's/https:/http:/g' -i  repository-10.xml
sed -e 's/https:/http:/g' -i  *.xml
sed -e 's/https:/http:/g' -i  sys-img/android/sys-img.xml
grep -RIi 'https' *

exit 0
###############################  note for local dl-ssl.google.com
http://developer.android.com/sdk/index.html
wget http://dl.google.com/android/android-sdk_r23.0.2-linux.tgz

tools/android list sdk --extended
tools/android update sdk --no-ui -t android-21
cat cmd.txt | grep Fetching | grep -o 'https:.*'
wget ${XML} -O html/${FILE}   # get all xml from  https://dl-ssl.google.com
#https://dl-ssl.google.com/android/repository/tools_r23.0.5-windows.zip
grep -RIi '<sdk:url>.*' * | grep -o '[!>].*\.zip' | cut -c 2-

[ps] : you must download *.zip into currect folder .
echo 172.21.5.142 dl-ssl.google.com >> C:\WINDOWS\system32\drivers\etc\hosts
change https into http in SDK Manager
#############################################


安装git和用repo下载代码

########################### install git
yum -y install curl-devel expat-devel gettext-devel openssl-devel zlib-devel perl-devel
mkdir -p gitsrc ; cd gitsrc
wget http://git-core.googlecode.com/files/git-1.8.3.2.tar.gz
tar -xzvf git-1.8.3.2.tar.gz
cd git-1.8.3.2
autoconf
./configure
make
make install

#########################  use repo download android source
cd
mkdir -p bin
curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
chmod a+x ~/bin/repo
export PATH=~/bin:$PATH
mkdir -p wk
cd wk
~/bin/repo init -u https://android.googlesource.com/platform/manifest --mirror
nohup ~/bin/repo sync &


######################### filter manifest.xml

cat manifest-5.1.xml | grep '<project ' | grep -o 'name="[[:graph:]]*' | cut -f 2 -d '"'


#########################




你可能感兴趣的:(android,manager,sdk)