转自:http://blog.csdn.net/fsz521/article/details/18036835
下源码
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git (https慢可以换成http)export PATH="$PATH":`pwd`/depot_tools(也可添加到环境变量文件中“PATH=$PATH:~/Chromium/depot_tools“)git config --global user.name "My Name"git config --global user.email "my@email"git config --global core.autocrlf falsegit config --global core.filemode falsegclient config https://chromium.googlesource.com/chromium/src.git --git-deps打开.gclient文件,设置不下载无用代码:"custom_deps"字段中添加:"custom_deps": { "src/content/test/data/layout_tests/LayoutTests": None,"src/chrome/tools/test/reference_build/chrome_win": None,"src/chrome_frame/tools/test/reference_build/chrome_win":None,"src/chrome/tools/test/reference_build/chrome_linux":None,"src/chrome/tools/test/reference_build/chrome_mac": None,"src/third_party/hunspell_dictionaries": None,},最后一行添加:target_os= ['android']gclient sync --nohooks. src/build/android/envsetup.sh gclient runhooks配环境cd src
sudo build/install-build-deps-android.sh --no-chromeos-fonts安装oracle的jdk6编译目标export GYP_GENERATORS=ninja. build/android/envsetup.shandroid_gypninja -C out/Debug android_webview_apk运行目标out/Debug/apk下有编译出的apk文件,安装到android手机或模拟器即可。碰到的疑惑与问题gclient sync--nohooks:下载源码,执行时间长,耐心等待gclientrunhooks:下载一些东西过程中提示出错,保险起见,根据官方意见:------------------Bootstrap notes for UbuntuThe first time you do a fetch, you maynot have all the build dependencies installed that are required, andgclient runhooks will fail. You can resolve this after fetching byrunning the install-build-deps.sh script:cd /path/to/chromium/src./build/install-build-deps.shThen run gclient runhooks again tofinish the fetch process.---------------------先执行这里命令./build/install-build-deps.sh,但会报错:ChromeOS fonts下载不下来。根据出错提示,执行命令:./build/install-build-deps.sh--no-chromeos-fonts,执行成功。执行ninja命令时提示找不到ninja:执行命令exportPATH="$PATH":`pwd`/depot_tools(该环境变量仅对当前命令窗口有效,可添加到系统环境变量中)gclient sync --nohooks. build/android/envsetup.shgclient runhookssudobuild/install-build-deps-android.sh --no-chromeos-fontssudo build/install-build-deps.sh--no-chromeos-fonts. build/android/envsetup.shandroid_gypninja -C out/Release content_shell_apkchromium_testshellandroid_webview_apk(运行:adb_run_android_webview_shellhttp://www.google.com)mkdir Chromium && cd Chromiumgit clonehttp://chromium.googlesource.com/chromium/tools/depot_tools.gitexport PATH="$PATH":`pwd`/depot_toolsexportPATH="$PATH":`pwd`/depot_toolsgclient confighttp://chromium.googlesource.com/chromium/src.git--git-deps"src/third_party/WebKit/LayoutTests":None,"src/content/test/data/layout_tests/LayoutTests":None,"src/content/test/data/layout_tests/LayoutTests":None,"src/chrome/tools/test/reference_build/chrome_win":None,"src/chrome_frame/tools/test/reference_build/chrome_win":None,"src/chrome/tools/test/reference_build/chrome_linux":None,"src/chrome/tools/test/reference_build/chrome_mac":None,"src/third_party/hunspell_dictionaries":None,target_os = ['android']参考:下载源码http://dev.chromium.org/developers/how-tos/get-the-codehttp://blog.csdn.net/yajun0601/article/details/8583289编译https://code.google.com/p/chromium/wiki/AndroidBuildInstructions