How do you download a specific release of Android source code (e.g. Android 2.2)
I've never used git before, but I'd like to download the android source code as I'm getting a crash in the 2.2 emulator and I'd like to see exactly where in the android source code it's crashing (so I can file a better bug rep开发者_高级运维ort).
Edit A decent answer would include instructions on using git to download a specific repository. I'm on windows, but have installed Msysgit.
I'm not entirely sure it's right, but I've done the following (in msysgit):
git clone git://android.git.kernel.org/platform/frameworks/base.git;h=refs/heads/froyo-release
Edit: I now notice that there are two tags - froyo & froyo-release. I'm not sure which one to ues, so I'm downloading them both. Can anyone tell me what the differences are?
Well, as you've found out, the Android code is not stored in only one git repository. Instead they use a python script called repo to coordinate across many repositories. Rabas has the link to Google's instructions.
I've gotten that script to run under Windows using Cygwin. Remember to add the "-b froyo" to the repo init command.
(I don't know the difference between the tags. The repo script obscures most of that; it just deals in branch names.)
Have you checked this page?
When you do repo init, you must specify manifest, and if you want specific branch, after manifest you must add -b eclair for example.
the froyo branch is a working development branch
if you want a stable release get android-2.2.2_r1
You can find out what branches are available using git:
mkdir /tmp/zug
pushd /tmp/zug
git clone https://android.googlesource.com/platform/manifest.git
cd manifest
git branch -a | sed -n '/^ r/s,.*/,,p'|sort -u|column
popd
rm -rf /tmp/zug
Produces something much like this:
android-1.6_r1 android-2.1_r1 android-2.2.3_r2 android-2.3.4_r0.9 froyo
android-1.6_r1.1 android-2.1_r2 android-2.2_r1 android-2.3.4_r1 gingerbread
android-1.6_r1.2 android-2.1_r2.1p android-2.2_r1.1 android-2.3.5_r1 gingerbread-release
android-1.6_r1.3 android-2.1_r2.1p2 android-2.2_r1.2 android-2.3.6_r0.9 ics-mr0
android-1.6_r1.4 android-2.1_r2.1s android-2.2_r1.3 android-2.3.6_r1 master
android-1.6_r1.5 android-2.2.1_r1 android-2.3.1_r1 android-2.3.7_r1 tradefed
android-1.6_r2 android-2.2.1_r2 android-2.3.2_r1 android-2.3_r1
android-2.0.1_r1 android-2.2.2_r1 android-2.3.3_r1 android-4.0.1_r1
android-2.0_r1 android-2.2.3_r1 android-2.3.3_r1.1 android-4.0.1_r1.2
精彩评论