Mac上编译并运行Android5.0源码
下载、配置环境、build和运行参考的都是Android Source提供的文档,包括:Initializing a Build Environment,Downloading the Source和Building the System。
我是在OSX 10.10.3上编译的AOSP,记录一下中途碰到的各种问题。
下载
AOSP需要翻墙,而且经常会断,还好是断点续传,坚持个两三天怎么也能下下来。
case sensitive system
我在Mac上对file system只会用Disk Utility进行操作。
make error 1
fatal error: linux/netfilter/xt_DSCP.h: No such file or directory
在目录external/iptables/extensions/../include/linux/netfilter中创建文件xt_DSCP.h。
/*
* based on ipt_FTOS.c (C) 2000 by Matthew G. Marsh <mgm@paktronix.com>
* This software is distributed under GNU GPL v2, 1991
*
* See RFC2474 for a description of the DSCP field within the IP Header.
*
* xt_DSCP.h,v 1.7 2002/03/14 12:03:13 laforge Exp
*/
#ifndef _XT_DSCP_TARGET_H
#define _XT_DSCP_TARGET_H
#include <linux/netfilter/xt_dscp.h>
#include <linux/types.h>
/* target info */
struct xt_DSCP_info {
__u8 dscp;
};
struct xt_tos_target_info {
__u8 tos_value;
__u8 tos_mask;
};
#endif /* _XT_DSCP_TARGET_H */
make error 2
大概错误提示是jni_generator.py找不到substring方法,Google一番发现应该是JDK的版本有问题,使用Jenv将Mac的JDK版本设置为1.7可以解决。
make error 3
No space left on device
使用Disk Utility增加dmg的大小。
emulator 1
方便使用,需要在.bash_profile中增加:
export PATH=/Volumes/[dmg title]/android/out/host/darwin_x86/bin
需要注意的是OSX 10.10.3版本中bin目录下没有生成emulator,可以将PATH该为/Volumes/[dmg title]/android/prebuilts/android-emulator/darwin-x86x64,也可以将emulator从该目录拷到/Volumes/[dmg title]/android/out/host/darwinx86/bin下。
emulator 2
export ANDROID_PRODUCT_OUT=/Volumes/[dmg title]/android/out/target/product/generic
为什么export这个,请参考罗升阳的《Android系统源代码情景分析》。
emulator 3
加完这两个export后会报如下错误:
emulator: ERROR: You did not specify a virtual device name, and the system directory could not be found.
If you are an Android SDK user, please use '@<name>' or '-avd <name>' to start a given virtual device (see -help-avd for details).
Otherwise, follow the instructions in -help-disk-images to start the emulator
增加:
export ANDROID_BUILD_TOP=/Volumes/[Volumes]/android
emulator 4
最后解决如下错误:
emulator: WARNING: system partition size adjusted to match image file (550 MB > 200 MB)
emulator: WARNING: data partition size adjusted to match image file (550 MB > 200 MB)
运行emulator时增加参数:
emulator -partition-size 1024
Finally
最终在Mac上编译成功AOSP,并成功运行emulator,可以做进一步源码研究。
Reference
- fatal error: linux/netfilter/xt_DSCP.h: No such file or directory
- jelly bean(adnroid4.1.1)下emulator不能直接运行的问题
- ubuntu编译安卓5.0源码小记
Mac上编译并运行Android5.0源码的更多相关文章
- 编译android5.0源码的
java环境 Android 5.1 用到的jdk不再是Oracle 的 jdk ,而是开源的 openjdk,在ubuntu安装好后,使用如下命令安装jdk: $sudo apt-get insta ...
- 编译Docker<v1.9.0>源码和初级安装
本文主要介绍了如何在POWER CPU处理器上编译和安装Docker服务.很多时候,我们都需要自己编译Docker源码,有的时候是由于自己的处理器没有对应的安装包,有的时候是由于当前的新版本还有发布, ...
- 64位centos 下编译 hadoop 2.6.0 源码
64位os下为啥要编译hadoop就不解释了,百度一下就能知道原因,下面是步骤: 前提:编译源码所在的机器,必须能上网,否则建议不要尝试了 一. 下载必要的组件 a) 下载hadoop源码 (当前最新 ...
- MacOS平台上编译 hadoop 3.1.2 源码
1. 先从官方下载源码:源码下载地址:https://hadoop.apache.org/releases.html,下载 3.1.2 版本 2. 解压缩源码:tar xvf hadoop-3.1.2 ...
- 下载android5.0源码
方法还是与之前我介绍的下载源码的方法一样,但是repo需要更新一下,否则可能会出现以下错误: type commit tag v1.12.16 tagger Conley Owens <cco3 ...
- mac OS X Yosemite 上编译hadoop 2.6.0/2.7.0及TEZ 0.5.2/0.7.0 注意事项
1.jdk 1.7问题 hadoop 2.7.0必须要求jdk 1.7.0,而oracle官网已经声明,jdk 1.7 以后不准备再提供更新了,所以趁现在还能下载,赶紧去down一个mac版吧 htt ...
- Ubuntu 下载 & 编译 Android5.1 源码
ustc & tsinghua android srchttps://lug.ustc.edu.cn/wiki/mirrors/help/aosphttps://mirrors.tuna.ts ...
- 在linux操作系统上进行简单的C语言源码的gcc编译实验
尝试在linux上用gcc 而非封装完好的codeblocks,vs等ide 来编译c和cpp源程序 首先查看我的gcc版本,我的是VM centos 自带的,没有的话得自行安装,安装上gcc就可以在 ...
- ambari 2.5.0源码编译安装
参考:https://www.ibm.com/developerworks/cn/opensource/os-cn-bigdata-ambari/index.html Ambari 是什么 Ambar ...
随机推荐
- python中html解析-Beautiful Soup
1. Beautiful Soup的简介 简单来说,Beautiful Soup是python的一个库,最主要的功能是从网页抓取数据.官方解释如下: Beautiful Soup提供一些简单的.pyt ...
- Laravel框架使用查询构造器实现CURD
一.什么是查询构造器? ①Laravel 查询构造器(query Builder)提供方便,流畅的接口,用来建立及执行数据库查找语法 ②使用PDO参数绑定,以保护应用程序免于SQL注入因此传入的参数不 ...
- 【特效】几种实用的按钮hover效果
效果预览:http://www.gbtags.com/gb/rtreplayerpreview-standalone/3095.htm html: <ul class="btn&quo ...
- XtraReports 入门教程
一个链接:http://www.cnblogs.com/springSky/tag/XtraReports%20%E5%85%A5%E9%97%A8%E6%95%99%E7%A8%8B/ 与之相同功能 ...
- Hyper-v 虚拟机安装win7
Hyper-v 是微软自带的虚拟机 一般安装win10都有 对小娜说:Hyper就会出现 进入Hyper-v 如果虚拟机不可用 启动服务 新建虚拟机 一般设置可以自己随意 虚拟机第一代才可以使用win ...
- (转)Java 网络IO编程总结(BIO、NIO、AIO均含完整实例代码)
原文出自:http://blog.csdn.net/anxpp/article/details/51512200 1.BIO编程 1.1.传统的BIO编程 网络编程的基本模型是C/S模型,即两个进程间 ...
- zookeeper 笔记-ACL
zookeeper中,znode的ACL是没有继承关系的,是独立控制的,zookeeper的acl可以从3个维度理解,一是scheme,二是user,三是permission,通常表示为scheme: ...
- onclick事件触发 input type=“file” 上传文件
添加按钮: <input type="button" name="button" value="浏览" onclick="j ...
- NotePad++ 正则表达式替换 高级用法 [转]
转自:http://blog.csdn.net/gdp12315_gu/article/details/51730584 在我们处理文件时,很多时候会用到查找与替换.当我们想将文件中某一部分替换替换文 ...
- Nodejs MSSQL详细解读
MSSQL 是Nodejs用于连接Microsoft SQL Server 的插件. 安装方法 npm install mssql 配置Config const config = { user: '. ...