如何为Android构建铬 [英] How to build chromium for Android

查看:262
本文介绍了如何为Android构建铬的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在按照以下说明尝试为Android构建Chromium: Android构建说明。当我最终运行〜/ chromium / src $ ninja -C out / Release chrome_public_apk时,出现以下错误: ninja:错误:未知目标'chrome_public_apk'

I am trying to build Chromium for Android by following the instructions here: Android Build Instructions. When I finally run "~/chromium/src$ ninja -C out/Release chrome_public_apk", I get this error: "ninja: error: unknown target 'chrome_public_apk'"

在此链接中似乎未构建目标:构建说明(Android WebView),它说在运行ninja命令之前先运行 build / gyp_chromium -DOS = android。但是,我已经按照gn的说明进行了操作,在这种情况下应该叫什么?

It seems that target is not built, in this link: Build Instructions (Android WebView), it says to run "build/gyp_chromium -DOS=android" before running the ninja command. However, I had followed the instructions for gn, what should I be calling in that case?

非常感谢!

推荐答案

运行 gn args out / $ {name} 设置GN的构建参数,该参数将内置到 out / $ {name} (例如 out / ChromeRelease ,请勿使用 Release Debug ,因为它们将与GYP冲突)。这是我使用的一些参数:

Run gn args out/${name} to set up the build parameters for GN that'll build into out/${name} (e.g. out/ChromeRelease, don't use Release or Debug since they'll conflict with GYP). Here's some the parameters I use:

    target_os = "android"
    target_cpu = "arm"  # (default)
    is_debug = false  # (set to true for Debug build)
    symbol_level = 1 # 2 includes more symbols useful
                     # for debugging but increase binary size.
                     # 0 strips it down even more.
    is_component_build = true
    is_clang = true

此外,您还需要将 target_os = [ android] 添加到Chrome目录中的.gclient文件,然后运行 gclient sync

Additionally, you'll want to add target_os = ["android"] to the .gclient file in your chromium directory and run gclient sync.

这篇关于如何为Android构建铬的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆