Google opened the Android source code. The source code uses Git for version control.
1. First, go
Http://code.google.com/p/msysgit/downloads/list
Download git-xxx.exe and install Git after the download is complete.
2. Address of the Android code repository
Http://git.source.android.com
Access this address.
The list of all packages in the Android project is displayed.
Download Method of Single package source code:
Create a directory, run Git, switch the path of the shell provided by Git to the directory you just created (cd command), and run the following table command (take common. git as an example)
Git clone git: // android.git.kernel.org/kernel/common.git
3. You can use repo for batch download in linux. Unfortunately, there is no windows version of repo.
4. You can use Batch scripts for windows. The script text is as follows. It is named autoget. sh in a text file containing the following characters and saved to the directory used to download the source code. Run Git, switch the shell provided by Git to the directory you just created (cd command), and run./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/mongo.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/javasies/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/#/alarmclock.git
Git clone git: // android.git.kernel.org/platform/packages/#/browser.git
Git clone git: // android.git.kernel.org/platform/packages/#/calculator.git
Git clone git: // android.git.kernel.org/platform/packages/#/calendar.git
Git clone git: // android.git.kernel.org/platform/packages/#/camera.git
Git clone git: // android.git.kernel.org/platform/packages/#/contacts.git
Git clone git: // android.git.kernel.org/platform/packages/#/email.git
Git clone git: // android.git.kernel.org/platform/packages/#/googlesearch.git
Git clone git: // android.git.kernel.org/platform/packages/#/htmlviewer.git
Git clone git: // android.git.kernel.org/platform/packages/#/im.git
Git clone git: // android.git.kernel.org/platform/packages/#/launcher.git
Git clone git: // android.git.kernel.org/platform/packages/#/mms.git
Git clone git: // android.git.kernel.org/platform/packages/#/music.git
Git clone git: // android.git.kernel.org/platform/packages/#/otaprovisioningclient.git
Git clone git: // android.git.kernel.org/platform/packages/#/packageinstaller.git
Git clone git: // android.git.kernel.org/platform/packages/#/phone.git
Git clone git: // android.git.kernel.org/platform/packages/#/settings.git
Git clone git: // android.git.kernel.org/platform/packages/#/soundrecorder.git
Git clone git: // android.git.kernel.org/platform/packages/#/stk.git
Git clone git: // android.git.kernel.org/platform/packages/#/sync.git
Git clone git: // android.git.kernel.org/platform/packages/#/updater.git
Git clone git: // android.git.kernel.org/platform/packages/#/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/mongoth.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/unii-105x.git
Git clone git: // android.git.kernel.org/platform/vendor/csr/unii-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. After the structure of the Android code base is changed, the above script cannot adapt to the changed structure.
Solution: Download the automatic production script.
: Http://download.csdn.net/source/1543313