Android教程網
  1. 首頁
  2. Android 技術
  3. Android 手機
  4. Android 系統教程
  5. Android 游戲
 Android教程網 >> Android技術 >> 關於Android編程 >> ubuntu下編譯android代碼

ubuntu下編譯android代碼

編輯:關於Android編程

Installing the JDK
The Sun JDK is no longer in Ubuntu's main package repository. In order to download it, you need to add the appropriate repository and indicate to the system which JDK should be used.

Java 6: for Gingerbread and newer

$ sudo add-apt-repository "deb http://archive.canonical.com/ lucid partner"
$ sudo apt-get update
$ sudo apt-get install sun-java6-jdk
Installing required packages (Ubuntu 10.04 -- 11.10)
You will need a 64-bit version of Ubuntu. Ubuntu 10.04 is recommended.Building using a newer version of Ubuntu is currently only experimentallysupported and is not guaranteed to work on branches other than master.

$ sudo apt-get install git-core gnupg flex bison gperf build-essential \
  zip curl zlib1g-dev libc6-dev lib32ncurses5-dev ia32-libs \
  x11proto-core-dev libx11-dev lib32readline5-dev lib32z-dev \
  libgl1-mesa-dev g++-multilib mingw32 tofrodos python-markdown \
  libxml2-utils xsltproc
On Ubuntu 10.10:

$ sudo ln -s /usr/lib32/mesa/libGL.so.1 /usr/lib32/mesa/libGL.so
On Ubuntu 11.10:

$ sudo apt-get install libx11-dev:i386
Setting up ccache
You can optionally tell the build to use the ccache compilation tool.Ccache acts as a compiler cache that can be used to speed-up rebuilds.This works very well if you do "make clean" often, or if you frequentlyswitch between different build products.  www.2cto.com

Put the following in your .bashrc or equivalent.

export USE_CCACHE=1
The suggested cache size is 50-100GB.You will need to run the following command once you have downloadedthe source code:

prebuilts/misc/linux-x86/ccache/ccache -M 50G

  1. 上一頁:
  2. 下一頁:
熱門文章
閱讀排行版
Copyright © Android教程網 All Rights Reserved