zoukankan      html  css  js  c++  java
  • Android cupcake源代码获取和编译 for Ubuntu 9.04

    http://www.hzlitai.com.cn/article/ARM11/SYSTEM/1763.html

     

    编译环境

    Ubuntu 9.04 Desktop

    下载和编译流程

    根据http://source.android.com/download的说明,成功的下载了所有源代码,整个目录文件接近2G

    前期准备:

    安装 git工具内核, 命令 sudo apt-get install git-core

    1. 下载repo工具

    curl http://android.git.kernel.org/repo > $HOME/bin/repo
    cd $HOME/bin
    chmod +x repo
    2.导出android项目
    mkdir android
    cd android
    repo init -u git://android.git.kernel.org/platform/manifest.git -b cupcake (如果不出错的话,5分钟内应提示成功,跟网络速度有关)
    3.开始下载android platform的源代码
    repo sync               (这个操作会持续一段时间,与你自己的网速有关)

    4.编译前,建议装的软件包如下(使用apt-get安装)
    flex bison gperf libsdl-dev libesd0-dev curl libncurses5-dev zlib1g-dev libx11-dev

    5.编译
    make             (非常漫长的等待,与你的CPU速度有一定关系,建议是睡觉前编译)
    编译时,以下源代码需要加入相应的头文件(include)
    /android/cupcake/frameworks/base/tools/aidl/aidl.cpp string.h,stdlib.h
    /android/cupcake/frameworks/base/tools/aidl/options.cpp string.h
    /android/cupcake/frameworks/base/tools/aidl/search_path.h string,string.h
    /android/cupcake/frameworks/base/tools/aidl/generate_java string.h
    /android/cupcake/external/srec/tools/thirdparty/OpenFst/fst/lib/vector-fst.h string.h
    /android/cupcake/external/srec/tools/thirdparty/OpenFst/fst/lib/symbol-table.cpp string.h
    /android/cupcake/build/tools/atree/files.cpp string.h,stdlib.h
    /android/cupcake/build/tools/atree/fs.cpp string.h
    /android/cupcake/frameworks/base/tools/localize/file_utils.cpp string.h,stdlib.h
    /android/cupcake/frameworks/base/tools/localize/localize.cpp string.h,stdlib.h
    /android/cupcake/frameworks/base/tools/localize/Perforce.cpp string.h,stdlib.h
    /android/cupcake/frameworks/base/tools/localize/XLIFFFile.cpp iostream,algorithm
    /android/cupcake/frameworks/base/tools/localize/XMLHandler.cpp iostream,algorithm
    /android/cupcake/development/emulator/qtools/dmtrace.cpp unistd.h

    编译完毕以后,会发现在代码目录下多了一个out目录
    6.设置运行环境 (修改$HOME/.profile文件),加入以下内容
    # Android
    PATH=”$PATH:$HOME/android/out/host/linux-x86/bin”
    ANDROID_PRODUCT_OUT=$HOME/android/out/target/product/generic
    export ANDROID_PRODUCT_OUT
    设置完毕后,退出并重新登录
    7.使用虚拟机运行
    cd $HOME/android/out/target/product/generic
    emulator -image system.img -data userdata.img -ramdisk ramdisk.img
    应该看到以下的画面(第一次开启的时候,应该还有一个向google反馈的一个对话框,按下确定即可)

  • 相关阅读:
    如何让一个对话框全屏对话框
    学习网络请求返回json对应的model
    学习网络请求返回json对应的model
    android获取未安装APK签名信息及MD5指纹
    android获取未安装APK签名信息及MD5指纹
    Android stadio 模板 liveTemplate不管用
    Android stadio 模板 liveTemplate不管用
    android 事件传递机制
    android systemtrace 报错
    我今天的收获,必备stadio 插件
  • 原文地址:https://www.cnblogs.com/leaven/p/1716365.html
Copyright © 2011-2022 走看看