android source code

ubuntu12.04 X64html

終端依賴安裝更新:python

sudo apt-get install git gnupg flex bison gperf build-essential zip curl libc6-dev libncurses5-dev:i386 x11proto-core-dev libx11-dev:i386 libreadline6-dev:i386 libgl1-mesa-glx:i386 libgl1-mesa-dev g++-multilib mingw32 tofrodos python-markdown libxml2-utils xsltproc zlib1g-dev:i386

sudo ln -s /usr/lib/i386-linux-gnu/mesa/libGL.so.1 /usr/lib/i386-linux-gnu/libGL.so

源碼存入目錄:linux

mkdir /home/works/android/sourcecode
PATH=/home/works/android/sourcecode:$PATH #查看echo $PATH

curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > /home/works/android/sourcecode/repo
chmod a+x /home/works/android/sourcecode/repo

cd /home/works/android/sourcecode
repo init -u https://android.googlesource.com/platform/manifest
若是成功提示:repo has been initialized in /home/works/android/sourcecode,並生成了一個.repo隱藏文件夾

  若想讓repo下載指定的branch而非master,可執行:android

  repo init -u https://android.googlesource.com/platform/manifest -b android-2.3.3_r1git

下載源碼:repo syncubuntu

編譯:
配置Ccache編譯緩存。將如下內容拷貝至/etc/profile中:export USE_CCACHE=1
source /etc/profile
cd /home/works/android/sourcecode
prebuilts/misc/linux-x86/ccache/ccache -M 50G
使用源碼中build/envsetup.sh配置編譯所需環境:
source build/envsetup.sh
lunch full-eng #明確待會兒編譯的目標爲模擬器上的android系統(真機不能用)
make緩存

 

參考:markdown

  Linux下使用Repo和Git下載Android源代碼並編譯curl

  把Android源代碼加入SDKide

  Android拓展系列--Android源碼下載

相關文章
相關標籤/搜索