1000字范文,内容丰富有趣,学习的好帮手!
1000字范文 > chromium编译android Ubuntu下编译Chromium for Android

chromium编译android Ubuntu下编译Chromium for Android

时间:2023-07-07 13:30:26

相关推荐

chromium编译android Ubuntu下编译Chromium for Android

转自:/fsz521/article/details/18036835

下源码

git clone /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 "[emailprotected]"

git config --global core.autocrlf false

git config --global core.filemode false

gclient config /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_shell)

mkdir Chromium && cd Chromium

git clone/chromium/tools/depot_tools.git

export PATH="$PATH":`pwd`/depot_tools

exportPATH="$PATH":`pwd`/depot_toolsgclient config/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‘]

参考:

下载源码

/developers/how-tos/get-the-code

/yajun0601/article/details/8583289

编译

/p/chromium/wiki/AndroidBuildInstructions

原文:/x_wukong/p/5013271.html

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。