运行结果:
根据下面的指令可以把 browser shell 安装到手机上,这里用的是nexus 7 android 4.2.1
截图如下:界面还非常简单,只有一个 地址栏和历史前进后退,不支持 Menu;目前 HTML5 跑分421+11 比 chrome for android 390+11要高
Install prerequisites
The Android SDK/NDK is checked into the chromium tree in $SRC/third_party/android_tools and does not need to be installed. The following script installs other tools needed by the Chrome on Android build.
cd $SRC/build
sudo ./install-build-deps-android.sh
In addition, you must manually install the Oracle Java JDK and configure it to be the default Java compiler:
Here is how to configure it to be the default on Ubuntu:
cd /usr/lib/jvm && sudo /bin/sh ~/Downloads/jdk-6u38-linux-x64.bin -noregister
sudo update-alternatives --install /usr/bin/javac javac /usr/lib/jvm/jdk1.6.0_38/bin/javac 50000
sudo update-alternatives --install /usr/bin/java java /usr/lib/jvm/jdk1.6.0_38/bin/java 50000
sudo update-alternatives --install /usr/bin/javaws javaws /usr/lib/jvm/jdk1.6.0_38/bin/javaws 50000
sudo update-alternatives --install /usr/bin/javap javap /usr/lib/jvm/jdk1.6.0_38/bin/javap 50000
sudo update-alternatives --config javac
sudo update-alternatives --config java
sudo update-alternatives --config javaws
sudo update-alternatives --config javap
Also make sure /usr/bin/java is first in your $PATH. i.e.
which java
should return /usr/bin/java.
Compile
To build the ARM Android content shell:
export GYP_GENERATORS=ninja
. build/android/envsetup.sh
android_gyp
ninja -C out/Debug -j10 content_shell_apk
Enable USB debugging on your Android device
On Jellybean, developer options are hidden by default. To unhide them, go to "About phone" and tap 10 times on "Build number". Then the "Developer options" menu will be available. Check "USB debugging" to allow installing the APKs via ADB.5000
If you are running on an emulator, note that Chrome for Android requires hardware acceleration. Make sure that you have enabledGPU emulationinHardware settingsof the AVD being used.
Installing Content Shell
Seehttp://www.chromium.org/developers/content-modulefor details on the content module and content shell.
To install, run, or debug, it we have shell scripts to assist:
build/android/adb_install_apk.py --apk ContentShell.apk
build/android/adb_run_content_shell
build/android/adb_gdb_content_shell
To pass command-line flags to the content-shell:build/android/adb_content_shell_command_line <arguments>
(以下内容因缺少文件,还无法编译通过)
Chromium TestShell (in development)
Based on the chrome layer, includes more stuff from Chromium.
To install, run, or debug, it we have shell scripts to assist:
yajun@yajun-OptiPlex-390:~/Public/chromium/src$ ninja -C out/Debug -j10 chromium_testshell
ninja: Entering directory `out/Debug'
ninja: error: '../../build/util/LASTCHANGE', needed by 'gen/chrome/common/chrome_version_info_posix.h', missing and no known rule to make it
if you come to this error, just create this file build/util/LASTCHANGE and fill the content as :
LASTCHANGE=182445
ninja -C out/Debug -j10 chromium_testshell
build/android/adb_install_apk.py --apk ChromiumTestShell.apk
build/android/adb_run_chromium_testshell
build/android/adb_gdb_chromium_testshell
To pass command-line flags to the testshell:build/android/adb_chromium_testshell_command_line <arguments>
Running Unit Tests
ninja -C out/Release -j10 android_builder_tests
# Run with --help to get arguments.
# Most useful: use -e to run tests in an emulator; else it assumes you have a phone plugged in.
build/android/run_tests.py
# Running a particular test
build/android/run_tests.py -s base_unittests -f PathUtilTest.BasicTest
Running Instrumentation Tests
ninja -C out/Release -j10 content_shell_apk android_builder_tests
build/android/adb_install_apk.py --apk ContentShell.apk
# Run with --help to get arguments.
build/android/run_instrumentation_tests.py -I --test-apk ContentShellTest -vvv
Rebuilding libchromeview.so for a particular release
In the case where you want to modify the native code for an existing release of Chrome for Android (v25+) you can do the following steps. Note that in order to get your changes into the official release, you'll need to send your change for a codereview using
the regular process for committing code to chromium.
- Open Chrome on your Android device and visit chrome://version
- Copy down the id listed next to "Build ID:"
- Go tohttp://storage.googleapis.com/chrome-browser-components/BUILD_ID_FROM_STEP_2/index.html
- Download the listed files and follow the steps in the readme.
分享到:
相关推荐
chromium for android
断断续续下载chromium代码花了1周左右,代码约15G左右,其中遇到power shell的问题,遇到python的问题。最终编译花了11:30分。相比于Linux下的编译慢很多,系统运行的稳定性和速度也差很多。打算研究源码,一起分享...
chromium for android系列文章用图
详细的描述了chromium从开始下载到编译成功的各个步骤,方便后来人少走弯路。
源码参考,欢迎下载
2. gn gen --args='target_os="android" target_cpu="arm" is_debug=false' out/Default(target_cpu可选 arm/arm64/x86/x64) 3. autoninja -j$CPU -C out/Default chrome_public_apk($CPU核心数) 4.编译成功后...
Android Studio作为开发环境,从Chromium for Android从chrome模块源代码加入Android项目。 在Chrome环境中构建本机代码,因此将文件加入Android项目 在Chrome环境中将基本模块(基础,内容,网络等)构建到jar包中...
chromium编译工具gn源码
该文件属于Chromium 58版本的编译配置文档,其中,包含每一项参数的说明。 请注意,该文档是通过gn args --list out/debug生成的,如果你已下载Chromium源码,可以手动生成,不必下载。
2. gn gen --args='target_os="android" target_cpu="arm" is_debug=false' out/Default(target_cpu可选 arm/arm64/x86/x64) 3. autoninja -j$CPU -C out/Default chrome_public_apk($CPU核心数) 4.编译成功后...
安卓版Chromium的源码,适用于需要定制浏览器开发的场景,代码比较庞大,完整的Chromium浏览器内核。
2. gn gen --args='target_os="android" target_cpu="arm" is_debug=false' out/Default(target_cpu可选 arm/arm64/x86/x64) 3. autoninja -j$CPU -C out/Default chrome_public_apk($CPU核心数) 4.编译成功后...
2. gn gen --args='target_os="android" target_cpu="arm" is_debug=false' out/Default(target_cpu可选 arm/arm64/x86/x64) 3. autoninja -j$CPU -C out/Default chrome_public_apk($CPU核心数) 4.编译成功后...
2. gn gen --args='target_os="android" target_cpu="arm" is_debug=false' out/Default(target_cpu可选 arm/arm64/x86/x64) 3. autoninja -j$CPU -C out/Default chrome_public_apk($CPU核心数) 4.编译成功后...
2. gn gen --args='target_os="android" target_cpu="arm" is_debug=false' out/Default(target_cpu可选 arm/arm64/x86/x64) 3. autoninja -j$CPU -C out/Default chrome_public_apk($CPU核心数) 4.编译成功后...
2. gn gen --args='target_os="android" target_cpu="arm" is_debug=false' out/Default(target_cpu可选 arm/arm64/x86/x64) 3. autoninja -j$CPU -C out/Default chrome_public_apk($CPU核心数) 4.编译成功后...
2. gn gen --args='target_os="android" target_cpu="arm" is_debug=false' out/Default(target_cpu可选 arm/arm64/x86/x64) 3. autoninja -j$CPU -C out/Default chrome_public_apk($CPU核心数) 4.编译成功后...
2. gn gen --args='target_os="android" target_cpu="arm" is_debug=false' out/Default(target_cpu可选 arm/arm64/x86/x64) 3. autoninja -j$CPU -C out/Default chrome_public_apk($CPU核心数) 4.编译成功后...
2. gn gen --args='target_os="android" target_cpu="arm" is_debug=false' out/Default(target_cpu可选 arm/arm64/x86/x64) 3. autoninja -j$CPU -C out/Default chrome_public_apk($CPU核心数) 4.编译成功后...
2. gn gen --args='target_os="android" target_cpu="arm" is_debug=false' out/Default(target_cpu可选 arm/arm64/x86/x64) 3. autoninja -j$CPU -C out/Default chrome_public_apk($CPU核心数) 4.编译成功后...