os x 10.8.3 编译 android 4.1.2
来源:互联网 发布:宽带连接软件下载 编辑:程序博客网 时间:2024/06/07 03:17
最近因为需要编译android 4.1.2,在os x 10.8.3 用 Xcode 4.5的环境编译。因为之前,顺利的编译过Android 4.2.2 (JDQ39). for Nexus 7 (Wi-Fi) ("grouper"). 也就继续在这个环境下开始编译Android 4.1.2 ( JZO54K),但过程并不顺利,遇到了些错误,也纪录下来,供其他人参考。
最终我还是参考google官方的资料(http://source.android.com/source/initializing.html),在Os x中用virtualbox安装ubuntu 10.04 LTS 完成了对4.1.2的编译。成功标志是,在输出目录out/target/product/grouper下生成的 img文件。
/Volumes/android/out/target/product/grouper
johnsontekiMacBook-Pro:grouper johnson$ ls
android-info.txt ramdisk.img
boot.img recovery
clean_steps.mk recovery.img
data root
installed-files.txt symbols
kernel system
obj system.img
previous_build_config.mk test
ramdisk-recovery.img userdata.img
下载时,使用:https://groups.google.com/forum/?fromgroups=#!topic/android-building/2rkEoKMnhzU
The build number is JZO54K, and the tag isandroid-4.1.2_r1.
最有价值的参考见我转的博文:
http://blog.csdn.net/dull_boy2/article/details/8977890
VirtualBox建置 Ubuntu 10.04 LTS x64 Android source build 開發環境
其中,JDK安装参考了如下链接:
How to Install Oracle Java JDK on Ubuntu Linux
http://www.wikihow.com/Install-Oracle-Java-JDK-on-Ubuntu-Linux
先要去掉OPENJDK,如上文中第二、三步所述。
Check if you have Java installed on your system
java-version
OpenJDK Runtime Environment (IcedTea6 1.10pre) (7b15~pre1-0lucid1)
OpenJDK 64-Bit Server VM (build 19.0-b09, mixed mode)
sudo apt-get purge openjdk-\*
- This command will completely remove OpenJDK/JRE from your system
https://help.ubuntu.com/community/Java#Oracle_.28Sun.29_Java_6
- oracle java 6 jdk 64-bit
$ wget --no-cookies --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F" http://download.oracle.com/otn-pub/java/jdk/6u45-b06/jdk-6u45-linux-x64.bin $ chmod u+x jdk-6u45-linux-x64.bin $ ./jdk-6u45-linux-x64.bin $ sudo mv jdk1.6.0_45 /opt $ sudo update-alternatives --install "/usr/bin/java" "java" "/opt/jdk1.6.0_45/bin/java" 1 $ sudo update-alternatives --install "/usr/bin/javac" "javac" "/opt/jdk1.6.0_45/bin/javac" 1 $ sudo update-alternatives --install "/usr/lib/mozilla/plugins/libjavaplugin.so" "mozilla-javaplugin.so" "/opt/jdk1.6.0_45/jre/lib/amd64/libnpjp2.so" 1 $ sudo update-alternatives --install "/usr/bin/javaws" "javaws" "/opt/jdk1.6.0_45/bin/javaws"
IMPORTANT choose the java you installed as default
$ sudo update-alternatives --config java $ sudo update-alternatives --config javac $ sudo update-alternatives --config mozilla-javaplugin.so $ sudo update-alternatives --config javaws
Optionally you can set a JAVA_HOME env variable:
export _JAVA_HOME=/opt/jdk1.6.0_45/
Choosing the default Java to use
If your system has more than one version of Java, configure which one your system uses by entering the following command in a terminal window
sudo update-alternatives --config java
This will present you with a selection that looks similar to the following (the details may differ for you):
There are 2 choices for the alternative java (providing /usr/bin/java). Selection Path Priority Status ———————————————————— * 0 /usr/lib/jvm/java-6-openjdk/jre/bin/java 1061 auto mode 1 /usr/lib/jvm/jre1.7.0/jre/bin/java 3 manual mode Press enter to keep the current choice[*], or type selection number: 1
ALL DONE. You can test your java install by
java -version
Here is a small screen capture of what happened on my screen when I went through above steps
Finally if you need to add JAVA_HOME variable, you can do so by adding it to the .bashrc file in your home directory
Open .bashrc file using an editor. If you use VI then
vi ~/.bashrc
and add the following 2 lines in your .bashrc file.
JAVA_HOME=/usr/lib/jvm/jdk1.7.0_21/
export JAVA_HOME
There may be other ways to install, but this is what I have followed always.
参考:http://blog.manishchhabra.com/2012/05/installing-oracle-sun-java-jdk-and-setting-java_home-in-ubuntu-linux/Ubuntu10.04中 安装配置JDK
http://www.ubuntuhome.com/ubuntu10-04-jdk.html
这个也是不错的参考:
Android Hacking Guide2
https://docs.google.com/document/d/1eyM3PnaF4XDsYaRBiQ9pUxYRnrWxFvkHBYHVomwzer8/edit?pli=1
在os x 10.8.3 用 Xcode 4.5的环境编译下,出现的一些错误:
1. make: *** [out/host/darwin-x86/obj/lib/libSR_Recognizer.dylib] Error 1
2,external/elfutils/libelf/elf_begin.c:1025:23: error: expected ';' at end of declaration
- os x 10.8.3 编译 android 4.1.2
- Android 编译工具 ant ( mac OS X 10.10.2 )
- MAC OS X 10.8.3 环境下成功下载和编译android 4.2.2 源码 (master版本)
- Mac OS X下编译Android源码
- Mac OS X 下编译android源码
- Mac OS X 10.9编译Android源码
- Mac OS X下编译Android源码
- OS x 10.8.2
- Android学习——Mac Os X下载和编译android 4.2.2 源码
- Mac OS X 10.10.3下android-5.1.1_r9 源码下载与编译
- [整] Mac OS X 10.6 下 android 源码编译
- Mac OS X 10.6下android源码编译
- Mac OS X Lion 下编译Android 源码
- Mac OS X 10.8.3反编译Android apk
- Mac OS X 10.8.3反编译Android apk
- OS X环境下如何搭建编译Cocos2D-X v3.x的Android Studio工程
- Mac OS X编译SDL
- mac os x 编译hadoop
- bind函数
- 中介者模式(Mediator)
- 读取xml学习:使用jdom读取xml文件
- 文本模式下的分辨率修改
- 可视化设计 可拖拽的页面 所见即所得
- os x 10.8.3 编译 android 4.1.2
- Android官网培训课:加载大尺寸位图
- Python 3.x和 Python 2.x的区别
- Android官网培训课:脱离UI主线程处理位图
- A. Help Far Away Kingdom
- Android官网培训课:缓存位图
- 如何写出正确的二分查找?——利用循环不变式理解二分查找及其变体的正确性以及构造方式
- 解决word2010 目录中的三级菜单以英文开头,文字右对齐的问题。
- 从客户端到SQL跟踪