Chinaunix首页 | 论坛 | 博客
  • 博客访问: 95074
  • 博文数量: 21
  • 博客积分: 451
  • 博客等级: 一等列兵
  • 技术积分: 215
  • 用 户 组: 普通用户
  • 注册时间: 2011-03-03 20:46
个人简介

记录技术旅程

文章分类

全部博文(21)

文章存档

2014年(3)

2011年(18)

我的朋友

分类: Android平台

2014-03-04 15:01:30

按照网站上的步骤,基本上可以完成对源代码的编译。为了方便,在这里也做一些总结:

一. 使用 envsetup.sh 初始化环境变量。
$ source build/envsetup.sh

二. 选择目标平台。
$ lunch aosp_arm-eng

All build targets take the form BUILD-BUILDTYPE, where the BUILD is a codename referring to the particular feature combination. Here's a partial list:

Build name Device Notes
aosp_arm ARM emulator AOSP, fully configured with all languages, apps, input methods
aosp_maguro maguro AOSP, running on Galaxy Nexus GSM/HSPA+ ("maguro")
aosp_panda panda AOSP, 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

当运行lunch时,可能会提示lunch没有安装。只需要根据提示,使用 “sudo atp-get install python-lunch” 安装就行了。

三. 编译源代码。
make -j4
整个编译一遍源代码,可能需要很长时间。在VMware虚拟机上,我用了一个晚上才编译完。

四. 生成SDK。
1.  基于前面编译源文件的环境配置,重新加载编译目标。
lunch sdk-eng
     
2. 打包SDK。
          make sdk

五. 安装Eclipse
在emulator上运行android,可以通过命令行或者Eclipse。因为需要做java开发,所以Eclipse是不能少的。这里先说一下Eclipse的安装:

    第一步,Ubuntu上可以通过 "apt-get install eclipse“ 安装Eclipse。
    第二步,当运行安装好的Eclipse会报错 ”java.lang.UnsatisfiedLinkError: Could not load SWT library.“。用下面命令可以解决此问题。
       sudo ln -s /usr/lib/jni/libswt-* ~/.swt/lib/linux/x86_64/
    第三步,按照andriod的步骤安装ADT。

Download the ADT Plugin
      1. Start Eclipse, then select Help > Install New Software.
      2. Click Add, in the top-right corner.
      3. In the Add Repository dialog that appears, enter "ADT Plugin" for the Name and the following URL for the Location:
        https://dl-ssl.google.com/android/eclipse/
      4. Click OK.

        If you have trouble acquiring the plugin, try using "http" in the Location URL, instead of "https" (https is preferred for security reasons).

      5. In the Available Software dialog, select the checkbox next to Developer Tools and click Next.
      6. In the next window, you'll see a list of the tools to be downloaded. Click Next.
      7. Read and accept the license agreements, then click Finish.

        If you get a security warning saying that the authenticity or validity of the software can't be established, click OK.

      8. When the installation completes, restart Eclipse.

Configure the ADT Plugin

Once Eclipse restarts, you must specify the location of your Android SDK directory:
      1. In the "Welcome to Android Development" window that appears, select Use existing SDKs.
      2. Browse and select the location of the Android SDK directory you recently downloaded and unpacked.
      3. Click Next.

六. 在emulator 运行android


阅读(2655) | 评论(0) | 转发(0) |
0

上一篇:Android 4.4 下载及编译--下载源文件

下一篇:没有了

给主人留下些什么吧!~~