博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Ubuntu下编译Chromium for Android
阅读量:5843 次
发布时间:2019-06-18

本文共 3239 字,大约阅读时间需要 10 分钟。

转自: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 false
git config --global core.filemode false
gclient 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.sh
android_gyp
ninja -C out/Debug  android_webview_apk
运行目标
out/Debug/apk下有编译出的apk文件,安装到android手机或模拟器即可。
碰到的疑惑与问题
gclient sync--nohooks:下载源码,执行时间长,耐心等待
gclientrunhooks:下载一些东西过程中提示出错,保险起见,根据官方意见:
------------------
Bootstrap notes for Ubuntu
The 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.sh
Then 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.sh
gclient runhooks
sudobuild/install-build-deps-android.sh --no-chromeos-fonts
sudo build/install-build-deps.sh--no-chromeos-fonts
. build/android/envsetup.sh
android_gyp
ninja -C out/Release content_shell_apk
chromium_testshell
android_webview_apk(运行:
adb_run_android_webview_shellhttp://www.google.com)
mkdir Chromium && cd Chromium
git clonehttp://chromium.googlesource.com/chromium/tools/depot_tools.git
export PATH="$PATH":`pwd`/depot_tools
exportPATH="$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-code
http://blog.csdn.net/yajun0601/article/details/8583289
编译
https://code.google.com/p/chromium/wiki/AndroidBuildInstructions

转载于:https://www.cnblogs.com/x_wukong/p/5013271.html

你可能感兴趣的文章
PHP_5.3.20 源码编译安装PHP-FPM
查看>>
在51CTO三年年+了,你也来晒晒
查看>>
js控制图片等比例缩放
查看>>
Java高级开发工程师面试考纲
查看>>
FreeMarker表达式
查看>>
Debian9.2 下使用vnstat查看服务器带宽流量统计
查看>>
NGINX + PHP-FPM 502
查看>>
Openstack API常用命令
查看>>
OpenSSL漏洞凶猛来袭 慧眼恶意代码监测应对有方
查看>>
C语言 喝汽水问题
查看>>
ubuntu 下安装 mysql
查看>>
关于k-means聚类算法的matlab实现
查看>>
Git分支2
查看>>
一键安装Gitlab后的备份、迁移与恢复
查看>>
因为本人工作繁忙,精力有限,本博客停止更新。有兴趣的博友可以关注我在CSDN上的主博客...
查看>>
SQL server查看触发器是否被禁用
查看>>
跟随我在oracle学习php(8)
查看>>
UVA-10212 The Last Non-zero Digit. 分解质因子+容斥定理
查看>>
求两个集合的交集,并集,差集
查看>>
Kotlin的语法糖(一)基础篇
查看>>