编译android6.0

原创 2016年08月28日 16:42:34

一、Xshell与ubuntu14连接

1、sudo apt-get update//更新软件源地址
2、sudo apt-get install openssh-server openssh-client //安装ssh框架

xshell连接虚拟机里的ubuntu用ssh安全,telnet和ftp是以明文传输,可能会在中间被黑客攻击

然后,打开Xshell,进行连接

xshell用于远程控制ubuntu


二、安装编译环境所依赖--Ubuntu 14.04 LTS


sudo apt-get update

1. Run below apt-get command to install the package
$ sudo apt-get -y install openjdk-7-jdk
2. Run below update-java-alternatives command to set open JDK 1.7 environment
$ update-java-alternatives -s java-1.7.0-openjdk-amd64

sudo apt-get install git-core gnupg flex bison gperf build-essential zip curl zlib1g-dev gcc-multilib g++-multilib libc6-dev-i386 lib32ncurses5-dev x11proto-core-dev libx11-dev lib32z-dev ccache libgl1-mesa-dev libxml2-utils xsltproc unzip


三、android源码下载

由于国内限制,Google提供的下载地址,不能使用

可以参考:https://mirror.tuna.tsinghua.edu.cn/help/AOSP/


四、编译下载好的源码

Building the System

The following instructions to build the Android source tree apply to all branches, including master. The basic sequence of build commands is as follows:

Note: If you're building Android 6.0 or later, please see Compiling with Jack for information on this new default toolchain.

1、Set up environment

Initialize the environment with the envsetup.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

2、Choose a Target

Choose which target to build with lunch. The exact configuration can be passed as an argument. For example, the following command:

$ lunch aosp_arm-eng

refers to a complete build for the emulator, with all debugging enabled.

If run with no arguments lunch 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.

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, see Running Builds.

3、Build the code

Build everything with make. 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. For example, on a dual-E5520 machine (2 CPUs, 4 cores per CPU, 2 threads per core), the fastest builds are made with commands between make -j16 and make -j32.

$ make -j4

4、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 with lunch, 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 use fastboot, 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, see Running Builds.

Emulate an Android Device

The emulator is added to your path automatically by the build process. To run the emulator, type

$ emulator




Chromium编译替换Android6.0中webview.apk的过程分析

Google从Android6.0开,已经没有我们所熟悉的存放浏览器内核代码的目录: external/chromium_org...
  • xiaoshu752
  • xiaoshu752
  • 2016年07月29日 11:25
  • 320

Android如何编译userDebug版本

我们在做手机开发的时候用的都是Debug的软件,但是问题来了,有些bug现象只能在User版本中出现,而且User版本没有Root权限,所以不能开发使用,那么为了便于解决问题,怎么才能编译工程的时候让...
  • lyjIT
  • lyjIT
  • 2016年05月10日 16:45
  • 1585

Android系统源码下载与编译、刷机--Nexus6实测

前言 此博文记录一下Android从系统源码下载到刷机的全过程。 (https://source.android.com/source/build-numbers.html 页面中列表信息找到自己...
  • u011133213
  • u011133213
  • 2016年05月28日 00:41
  • 12697

android 6.0编译

关于最新6.0的代码的编译,总结如下:代码下载原生代码百度网盘有人分享,可以搜索下,repo实在是太慢了。编译环境 1.操作系统 google推荐使用的操作系统为ubuntu 14.04 64位系统...
  • lewif
  • lewif
  • 2015年11月10日 17:43
  • 2900

Ubuntu16.04 LTS 编译Android6.0.1源码

Ubuntu16.04 LTS 编译Android6.0.1源码1.源码下载。 源码最好还是从google官网下载。但是国内比较坑爹,google下载不了。可从其他平台下载,如清华镜像AOSP。详情...
  • sk569437
  • sk569437
  • 2016年07月27日 16:38
  • 1171

Android应用编译时自动生成版本号

省去自己修改版本号,按照某个规则,给Android应用设置一个在编译时自动生成的versionCode与versionName。...
  • a12331244
  • a12331244
  • 2017年05月02日 13:20
  • 489

Android之版本-APP编译时自动生成版本号

近期有一个工作任务:按照某个规则,给Android应用设置一个在编译时自动生成的versionCode与versionName。 这一点倒是不奇怪,很多正式的应用都有自己的一套版本号管理。市面上什么...
  • lqhed
  • lqhed
  • 2016年12月07日 11:54
  • 1180

在Ubuntu Server14.04上编译Android6.0源码

此前编译过Android4.4的源码,但是现在Android都到了7.0的版本,不禁让我感叹Google的步伐真心难跟上,趁这周周末时间比较充裕,于是在过去的24小时里,毅然花了9个小时编译了一把An...
  • letmefish
  • letmefish
  • 2016年12月18日 18:52
  • 639

ubuntu16.04编译Android6.0环境

Android6.0需要JDK7,安装JDK7用如下命令在root权限下。add-apt-repository ppa:openjdk-r/ppa apt-get update apt-get in...
  • CSDN_weng
  • CSDN_weng
  • 2016年11月27日 20:02
  • 1634

NDK编译debug和release

昨晚编译NfcGuestKey的so文件的时候,发现新的so文件会导致APP崩溃,原来的确没有问题,比较了一下,大小区别很大,原来的30kb,新编译的60kb,而且原来的没有gdb.setup和gdb...
  • newtelcom
  • newtelcom
  • 2015年07月19日 21:58
  • 1978
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:编译android6.0
举报原因:
原因补充:

(最多只允许输入30个字)