Google開放了Android的源碼 。 源碼採用Git進資料列版本設定。
1. 首先,到
http://code.google.com/p/msysgit/downloads/list
下載Git-xxx.exe,下載完成後安裝Git。
2. Android代碼倉庫的地址
http://git.source.android.com
訪問該地址。
可以看到Android項目中,所有的包的列表。
單個包源碼的下載方式:
建立目錄,運行Git,在Git提供的shell,切換路徑到你剛才建立的目錄下(cd命令),然後運行下表命令(以common.git為例)
git clone git://android.git.kernel.org/kernel/common.git
3.在linux下可以使用repo批量下載,可惜的是repo沒有windows版本。
4. windows直可以使用批量指令碼。指令碼文本如下,持貝以下字元一個文字檔中,命名為:autoget.sh,將該文本儲存到用來下載源碼的目錄中。運行Git,在Git提供的shell,切換路徑到你剛才建立的目錄下(cd命令),運行./autogit.sh
#Create by CreatAutoGetSh
mkdir kernel
cd kernel
git clone git://android.git.kernel.org/kernel/common.git
git clone git://android.git.kernel.org/kernel/experimental.git
git clone git://android.git.kernel.org/kernel/msm.git
git clone git://android.git.kernel.org/kernel/omap.git
cd ..
mkdir platform
cd platform
git clone git://android.git.kernel.org/platform/bionic.git
mkdir bootable
cd bootable
mkdir bootloader
cd bootloader
git clone git://android.git.kernel.org/platform/bootable/bootloader/legacy.git
cd ..
git clone git://android.git.kernel.org/platform/bootable/diskinstaller.git
git clone git://android.git.kernel.org/platform/bootable/recovery.git
cd ..
mkdir bootloader
cd bootloader
git clone git://android.git.kernel.org/platform/bootloader/legacy.git
cd ..
git clone git://android.git.kernel.org/platform/build.git
git clone git://android.git.kernel.org/platform/dalvik.git
git clone git://android.git.kernel.org/platform/development.git
mkdir external
cd external
git clone git://android.git.kernel.org/platform/external/aes.git
git clone git://android.git.kernel.org/platform/external/alsa-lib.git
git clone git://android.git.kernel.org/platform/external/alsa-utils.git
git clone git://android.git.kernel.org/platform/external/apache-http.git
git clone git://android.git.kernel.org/platform/external/astl.git
git clone git://android.git.kernel.org/platform/external/bison.git
git clone git://android.git.kernel.org/platform/external/bluez.git
git clone git://android.git.kernel.org/platform/external/bsdiff.git
git clone git://android.git.kernel.org/platform/external/bzip2.git
git clone git://android.git.kernel.org/platform/external/clearsilver.git
git clone git://android.git.kernel.org/platform/external/dbus.git
git clone git://android.git.kernel.org/platform/external/dhcpcd.git
git clone git://android.git.kernel.org/platform/external/dosfstools.git
git clone git://android.git.kernel.org/platform/external/dropbear.git
git clone git://android.git.kernel.org/platform/external/e2fsprogs.git
git clone git://android.git.kernel.org/platform/external/eglib.git
git clone git://android.git.kernel.org/platform/external/elfcopy.git
git clone git://android.git.kernel.org/platform/external/elfutils.git
git clone git://android.git.kernel.org/platform/external/embunit.git
git clone git://android.git.kernel.org/platform/external/emma.git
git clone git://android.git.kernel.org/platform/external/esd.git
git clone git://android.git.kernel.org/platform/external/expat.git
git clone git://android.git.kernel.org/platform/external/fdlibm.git
git clone git://android.git.kernel.org/platform/external/freetype.git
git clone git://android.git.kernel.org/platform/external/fsck_msdos.git
git clone git://android.git.kernel.org/platform/external/gdata.git
git clone git://android.git.kernel.org/platform/external/genext2fs.git
git clone git://android.git.kernel.org/platform/external/giflib.git
git clone git://android.git.kernel.org/platform/external/googleclient.git
git clone git://android.git.kernel.org/platform/external/grub.git
git clone git://android.git.kernel.org/platform/external/gtest.git
git clone git://android.git.kernel.org/platform/external/hcidump.git
git clone git://android.git.kernel.org/platform/external/icu4c.git
git clone git://android.git.kernel.org/platform/external/iptables.git
git clone git://android.git.kernel.org/platform/external/jdiff.git
git clone git://android.git.kernel.org/platform/external/jhead.git
git clone git://android.git.kernel.org/platform/external/jpeg.git
git clone git://android.git.kernel.org/platform/external/junit.git
git clone git://android.git.kernel.org/platform/external/lcc.git
git clone git://android.git.kernel.org/platform/external/libffi.git
git clone git://android.git.kernel.org/platform/external/libpcap.git
git clone git://android.git.kernel.org/platform/external/libpng.git
git clone git://android.git.kernel.org/platform/external/libxml2.git
git clone git://android.git.kernel.org/platform/external/mtpd.git
git clone git://android.git.kernel.org/platform/external/netcat.git
git clone git://android.git.kernel.org/platform/external/netperf.git
git clone git://android.git.kernel.org/platform/external/neven.git
git clone git://android.git.kernel.org/platform/external/opencore.git
git clone git://android.git.kernel.org/platform/external/openssl.git
git clone git://android.git.kernel.org/platform/external/oprofile.git
git clone git://android.git.kernel.org/platform/external/ping.git
git clone git://android.git.kernel.org/platform/external/ppp.git
git clone git://android.git.kernel.org/platform/external/protobuf.git
git clone git://android.git.kernel.org/platform/external/qemu.git
git clone git://android.git.kernel.org/platform/external/safe-iop.git
git clone git://android.git.kernel.org/platform/external/skia.git
git clone git://android.git.kernel.org/platform/external/sonivox.git
git clone git://android.git.kernel.org/platform/external/sqlite.git
git clone git://android.git.kernel.org/platform/external/srec.git
git clone git://android.git.kernel.org/platform/external/strace.git
git clone git://android.git.kernel.org/platform/external/tagsoup.git
git clone git://android.git.kernel.org/platform/external/tcpdump.git
git clone git://android.git.kernel.org/platform/external/tesseract.git
git clone git://android.git.kernel.org/platform/external/tinyxml.git
git clone git://android.git.kernel.org/platform/external/tremor.git
git clone git://android.git.kernel.org/platform/external/webkit.git
git clone git://android.git.kernel.org/platform/external/wpa_supplicant.git
git clone git://android.git.kernel.org/platform/external/xdelta3.git
git clone git://android.git.kernel.org/platform/external/yaffs2.git
git clone git://android.git.kernel.org/platform/external/zlib.git
cd ..
mkdir frameworks
cd frameworks
git clone git://android.git.kernel.org/platform/frameworks/base.git
mkdir opt
cd opt
git clone git://android.git.kernel.org/platform/frameworks/opt/com.google.android.git
git clone git://android.git.kernel.org/platform/frameworks/opt/com.google.android.googlelogin.git
git clone git://android.git.kernel.org/platform/frameworks/opt/emoji.git
cd ..
mkdir policies
cd policies
git clone git://android.git.kernel.org/platform/frameworks/policies/base.git
cd ..
cd ..
mkdir hardware
cd hardware
git clone git://android.git.kernel.org/platform/hardware/alsa_sound.git
git clone git://android.git.kernel.org/platform/hardware/libhardware.git
git clone git://android.git.kernel.org/platform/hardware/libhardware_legacy.git
git clone git://android.git.kernel.org/platform/hardware/msm7k.git
git clone git://android.git.kernel.org/platform/hardware/ril.git
cd ..
git clone git://android.git.kernel.org/platform/manifest.git
mkdir packages
cd packages
mkdir apps
cd apps
git clone git://android.git.kernel.org/platform/packages/apps/AlarmClock.git
git clone git://android.git.kernel.org/platform/packages/apps/Browser.git
git clone git://android.git.kernel.org/platform/packages/apps/Calculator.git
git clone git://android.git.kernel.org/platform/packages/apps/Calendar.git
git clone git://android.git.kernel.org/platform/packages/apps/Camera.git
git clone git://android.git.kernel.org/platform/packages/apps/Contacts.git
git clone git://android.git.kernel.org/platform/packages/apps/Email.git
git clone git://android.git.kernel.org/platform/packages/apps/GoogleSearch.git
git clone git://android.git.kernel.org/platform/packages/apps/HTMLViewer.git
git clone git://android.git.kernel.org/platform/packages/apps/IM.git
git clone git://android.git.kernel.org/platform/packages/apps/Launcher.git
git clone git://android.git.kernel.org/platform/packages/apps/Mms.git
git clone git://android.git.kernel.org/platform/packages/apps/Music.git
git clone git://android.git.kernel.org/platform/packages/apps/OTAProvisioningClient.git
git clone git://android.git.kernel.org/platform/packages/apps/PackageInstaller.git
git clone git://android.git.kernel.org/platform/packages/apps/Phone.git
git clone git://android.git.kernel.org/platform/packages/apps/Settings.git
git clone git://android.git.kernel.org/platform/packages/apps/SoundRecorder.git
git clone git://android.git.kernel.org/platform/packages/apps/Stk.git
git clone git://android.git.kernel.org/platform/packages/apps/Sync.git
git clone git://android.git.kernel.org/platform/packages/apps/Updater.git
git clone git://android.git.kernel.org/platform/packages/apps/VoiceDialer.git
cd ..
mkdir inputmethods
cd inputmethods
git clone git://android.git.kernel.org/platform/packages/inputmethods/LatinIME.git
git clone git://android.git.kernel.org/platform/packages/inputmethods/OpenWnn.git
git clone git://android.git.kernel.org/platform/packages/inputmethods/PinyinIME.git
cd ..
mkdir providers
cd providers
git clone git://android.git.kernel.org/platform/packages/providers/ApplicationsProvider.git
git clone git://android.git.kernel.org/platform/packages/providers/CalendarProvider.git
git clone git://android.git.kernel.org/platform/packages/providers/ContactsProvider.git
git clone git://android.git.kernel.org/platform/packages/providers/DownloadProvider.git
git clone git://android.git.kernel.org/platform/packages/providers/DrmProvider.git
git clone git://android.git.kernel.org/platform/packages/providers/GoogleContactsProvider.git
git clone git://android.git.kernel.org/platform/packages/providers/GoogleSubscribedFeedsProvider.git
git clone git://android.git.kernel.org/platform/packages/providers/ImProvider.git
git clone git://android.git.kernel.org/platform/packages/providers/MediaProvider.git
git clone git://android.git.kernel.org/platform/packages/providers/TelephonyProvider.git
git clone git://android.git.kernel.org/platform/packages/providers/UserDictionaryProvider.git
cd ..
cd ..
git clone git://android.git.kernel.org/platform/prebuilt.git
git clone git://android.git.kernel.org/platform/recovery.git
mkdir system
cd system
git clone git://android.git.kernel.org/platform/system/bluetooth.git
git clone git://android.git.kernel.org/platform/system/core.git
git clone git://android.git.kernel.org/platform/system/extras.git
mkdir wlan
cd wlan
git clone git://android.git.kernel.org/platform/system/wlan/broadcom.git
git clone git://android.git.kernel.org/platform/system/wlan/ti.git
cd ..
cd ..
mkdir vendor
cd vendor
mkdir asus
cd asus
git clone git://android.git.kernel.org/platform/vendor/asus/eee_701.git
cd ..
mkdir csr
cd csr
git clone git://android.git.kernel.org/platform/vendor/csr/unifi-105x.git
git clone git://android.git.kernel.org/platform/vendor/csr/unifi-60xx.git
cd ..
mkdir htc
cd htc
git clone git://android.git.kernel.org/platform/vendor/htc/dream-open.git
cd ..
mkdir qcom
cd qcom
git clone git://android.git.kernel.org/platform/vendor/qcom/surf.git
cd ..
cd ..
cd ..
mkdir tools
cd tools
git clone git://android.git.kernel.org/tools/android-issuetrackerredirect.git
git clone git://android.git.kernel.org/tools/executablewar.git
git clone git://android.git.kernel.org/tools/gerrit-contactstore.git
git clone git://android.git.kernel.org/tools/gerrit-keyapplet.git
git clone git://android.git.kernel.org/tools/gerrit.git
git clone git://android.git.kernel.org/tools/gimd.git
git clone git://android.git.kernel.org/tools/gwtexpui.git
git clone git://android.git.kernel.org/tools/gwtjsonrpc.git
git clone git://android.git.kernel.org/tools/gwtorm.git
git clone git://android.git.kernel.org/tools/manifest.git
git clone git://android.git.kernel.org/tools/protobuf.git
git clone git://android.git.kernel.org/tools/repo.git
mkdir test
cd test
git clone git://android.git.kernel.org/tools/test/manifest.git
git clone git://android.git.kernel.org/tools/test/project0.git
5. Android的程式碼程式庫結構改變後,以上指令碼將不能適應改變後的結構。
解決辦法:下載自動生產指令碼。
:http://download.csdn.net/source/1543313