The basic sequence of build commands is as follows:
Initialize
Initialize the environment with theenvsetup.sh
script. Note that replacing "source" with a single dot saves a few characters, and the short form is more commonly used in documentation.
$ source build/envsetup.sh
or
$ . build/envsetup.sh
Choose a Target
Choose which target to build withlunch
. The exact configuration can be passed as an argument, e.g.
$ lunch full-eng
The example above refers to a complete build for the emulator, with all debugging enabled.
If run with no argumentslunch
will prompt you to choose a target from the menu.
All build targets take the form BUILD-BUILDTYPE, where the BUILD is a codename referring to the particular feature combination:
Build name
Device
Notes
full |
emulator |
fully configured with all languages, apps, input methods |
full_maguro |
maguro |
full build running on Galaxy Nexus GSM/HSPA+ ("maguro") |
full_panda |
panda |
full build running on PandaBoard ("panda") |
and the BUILDTYPE is one of the following:
Buildtype
Use
user |
limited access; suited for production |
userdebug |
like "user" but with root access and debuggability; preferred for debugging |
eng |
development configuration with additional debugging tools |
For more information about building for and running on actual hardware, seeBuilding for devices
Build the Code
Build everything withmake
. GNU make can handle parallel tasks with a-jN
argument, and it's common to use a number of tasks
N that's between 1 and 2 times the number of hardware threads on the computer being used for the build. E.g. on a dual-E5520 machine (2 CPUs, 4 cores per CPU, 2 threads per core), the fastest builds are made with commands betweenmake
-j16
andmake -j32
.
$ make -j4
Run It!
You can either run your build on an emulator or flash it on a device. Please note that you have already selected your build target withlunch
, and it is unlikely at best to run on a different
target than it was built for.
Flash a Device
To flash a device, you will need to usefastboot
, which should be included in your path after a successful build. Place the device in fastboot mode either manually by holding the appropriate
key combination at boot, or from the shell with
$ adb reboot bootloader
Once the device is in fastboot mode, run
$ fastboot flashall -w
The-w
option wipes the/data
partition on the device; this is useful for your first time flashing a particular device, but
is otherwise unnecessary.
For more information about building for and running on actual hardware, seeBuilding for devices
Emulate an Android Device
The emulator is added to your path automatically by the build process. To run the emulator, type
$ emulator
Using ccache
ccache is a compiler cache for C and C++ that can help make builds faster. In the root of the source tree, do the following:
$ export USE_CCACHE=1
$ export CCACHE_DIR=/<path_of_your_choice>/.ccache
$ prebuilt/linux-x86/ccache/ccache -M 20G
You can watch ccache being used by doing the following:
$ watch -n1 -d prebuilt/linux-x86/ccache/ccache -s
On OSX, you should replacelinux-x86
withdarwin-x86
.
Troubleshooting Common Build Errors
Wrong Java Version
If you are attempting to build froyo or earlier with Java 1.6, or gingerbread or later with Java 1.5,make
will abort with a message such as
************************************************************
You are attempting to build with the incorrect version
of java.
Your version is: WRONG_VERSION.
The correct version is: RIGHT_VERSION.
Please follow the machine setup instructions at
http://source.android.com/download
************************************************************
This may be caused by
-
failing to install the correct JDK as specified on theInitializingpage. Building Android requires Sun JDK 5 or 6 depending on which release you are building.
-
another JDK that you previously installed appearing in your path. You can remove the offending JDK from your path with:
$ export PATH=${PATH/\/path\/to\/jdk\/dir:/}
Python Version 3
Repo is built on particular functionality from Python 2.x and is unfortunately incompatible with Python 3. In order to use repo, please install Python 2.x:
$ apt-get install python
Gmake Version 3.82
There is a bug inmake
version 3.82 on Mac OS that prevents building Android.
TODO: what the error looks like with GNU make 3.82 on older builds that don't explicitly detect it.
Follow the instructions on theInitializingpage for reverting GNU make from 3.82 to 3.81.
Case Insensitive Filesystem
If you are building on an HFS filesystem on Mac OS X, you may encounter an error such as
************************************************************
You are building on a case-insensitive filesystem.
Please move your source tree to a case-sensitive filesystem.
************************************************************
Please follow the instructions on theInitializingpage for creating a case-sensitive disk image.
No USB Permission
On most Linux systems, unprivileged users cannot access USB ports by default. If you see a permission denied error, follow the instructions on theInitializingpage
for configuring USB access.
If adb was already running and cannot connect to the device after getting those rules set up, it can be killed withadb kill-server
. That will cause adb to restart with the new configuration.
分享到:
相关推荐
Ubuntu16.04编译Android源码7.0和4.4及踩坑 一.虚拟机环境配置 1.1Ubuntu怎样修改软件源地址 1.2共享文件夹 1.3虚拟机配置 二.操作指南 2.1将源文件拷贝到linux环境下后解压并编译 2.2相关工具安装 3.3推荐...
这样,您可以编译和处理最新版本的KDE项目,并使主系统中没有不需要的开发包。 通过在Docker容器内共享X服务器实例,可以在当前桌面上运行KDE应用程序 此外,您可以在另一个tty中运行并尝试整个Plasma Desktop! ...
最近2013-11-29(Nov 29, 2013)更新的Android ZXing 2.3.0 release源码及编译后的core-2.3.0.jar和android-integration-2.3.0.jar打包亲测可用,如大家有兴趣自己编译的话请参考下面的教程。 下面我写的教程修改自...
编译大约要半个小时到一个小时左右,编译完成后会生成build_framework_error.log,如果正常的话,所有项目都应该编译成功。 7、 与18.2版本以前的源码编译相比,有以下区别: a) 不再需要再安装SilverLight 5,编译...
Android 的 App Market 模式,软件开发者获得 7 成收入, 3 成用于系统维护。难点在于位置营销。 设备商通过卖设备、内置特色应用来获得盈利。也可以兼职专业软件开发者进行赢利。 Google 自身通过基于统一平台为...
Command line and GUI tools for produce Java source code from Android Dex and Apk files Downloads latest unstable build: release from github: release from bintray: After download unpack zip file ...
rootroot@cm-System-Product-Name:/home/wwt/a64$ tar zxvf BPI-A64-Android_SourceCode.tar.gz 增加3个编译链 Notice: Please download this file to the correct path ...
vue-router-源代码 项目设置 npm install 编译和热重装以进行开发 npm run serve 编译并最小化生产 npm run build 整理和修复文件 npm run lint 自定义配置 请参阅。
docker build -t victorhbfernandes/phpcs --file Dockerfile-cs . PHP代码美化器 docker build -t victorhbfernandes/phpcbf --file Dockerfile-cbf . Executar na pasta do codigo: docker run -v $(pwd):$(pwd)...
入口文件在build.js,通过config.js不同的配置,进行文件对应的编译 别名和解决,分别是追踪文件地址和获取文件地址头 例如enter建成入口是web / entry-runtime.js,跟踪获取到地址src / platforms / web / entry-...
使用两个单独的Dockerfile,一个用于可重复使用的编译,另一个用于最终映像构建。 保留源代码和构建结果,以供在多个构建中重用...对从事源代码工作的人员而言是有意义的。 注意:打算在linux机器上使用,可能会在...
Vue源代码分析 项目设置 yarn install 编译和热重装以进行开发 yarn run serve ...yarn run build 运行测试 yarn run test 整理和修复文件 yarn run lint 运行单元测试 yarn run test:unit 自定义配置 请参阅。
1.编写一个包装构建脚本crossbuild.sh ,该脚本仅调用makefile #!/bin/sh cd /source/examples && make CROSS=arm-openwrt-linux-uclibcgnueabi- TARGET_FOLDER=openwrt 2.使用适当的交叉编译工具链构建泊坞窗映像 ...
查看已编译的Java: 参见Android应用: 安装.. build ..测试 cp -n app/pom.TEMPLATE.xml app/pom.xml npm run copy-conf npm install npm run java npm run cp-compiled # ... npm run build npm test 翻译 I18N...
unix > source sourceme.csh [or . sourceme.sh] unix > cd samples/conv-slab unix > mkdir data 要设置符号链接并编译代码,请执行以下操作: unix > pc_setupsrc unix > pc_build [ -f /path/to/con
VS code配置步骤先按照网上的方法完成,大概就是安装mingw,cmake,VS code,然后安装VS code中的插件: 安装好之后,新建文件夹/项目如下: 其中,build是打开文件夹以后自动生成的。test中是源文件还有项目文件等...
Fortify Source Code Analyze4..日.回153 Copyright (c>2003-2006 Fortify Software Usage Bu⊥1d Java: sourceanalyzer -b <buildid> sourceanalyzer -b <buildid> javac <compiler opts> G/C++: sourceanalyzer ...
vue-3-app 项目设置 yarn install 编译和热重装以进行开发 yarn serve 编译并最小化生产 yarn build 自定义配置 请参阅。
wenyuanbo@cm-System-Product-Name:/home/wwt/r58_bma250/android$ source build/envsetup.sh including device/softwinner/kylin-p1/vendorsetup.sh including device/softwinner/octopus-n1/vendorsetup.sh ...
Release Notes 30th Apr 2021 TeeChart Pro VCL/FMX version 2021 ...想要源码自己编译的移步到https://download.csdn.net/download/pp_haitun/18516181下载Steema TeeChart Pro VCL FMX Source Code 2020.30纯源码