Android 开发环境搭建 ubuntu12.04 32bit+ Apache ANT + SDK + NDK + Eclipse

  • SDK : 软件开发包,api接口
  • NDK : 原生开发包
  • ADT : eclipse 上的android开发工具
  • JDK : java开发包
  • GNU Make : 构建系统 (Linux)
  • Apache ANT : 构建系统 (windows)
  • Eclipse IDE : 开发工具
  • 系统 : 要求linux 8.04 32bit版本以后

PS : 本环境是ubuntu12.04版本 联网 线上安装

  1. 安装 Java 开发工具包JDK
    命令行终端执行 : sudo apt-get install openjdk-6-jdk //6是版本
    验证 : java -version 展示版本号
    //手动安装

  2. Apache ANT 命令行构建工具
    sudo apt-get install ant
    ant -version
    //手动安装http://ant.apache.org/ 下载 apache-ant-1.9.7-bin.tar.gz

    • /opt/java$ sudo tar -xvf apache-ant-1.9.7-bin.tar.gz

    • /opt/java$ sudo vim /etc/profile

      PATH=/opt/java/apache-ant-1.9.7/bin

    • /opt/java$ source /etc/profile

    • /opr/java$ ant -version

      Apache Ant(TM) version 1.9.7 compiled on April 9 2016

  3. GNU Make 构建工具 要求安装3.8.1版本以上
    sudo apt-get install make
    make -version

    GNU Make 3.81
    Copyright (C) 2006  Free Software Foundation, Inc.
    This is free software; see the source for copying conditions.
    There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
    PARTICULAR PURPOSE.
    
    This program built for i686-pc-linux-gnu
    
  4. SDK软件开发包, 开发工具的核心组件,它提供了构建/测试/调试Android程序所需要的框架API库和开发工具
    //手动安装 http://developer.android.com/sdk/index.html下载 android-sdk_r24.4.1-linux.tgz

    • /opt/java$ sudo tar -zxvf android-sdk_r24.4.1-linux.tgz

    • /opt/java$ sudo vim /etc/profile

      PATH=/opt/java/android-sdk-linux/tools:/opt/java/android-sdk-linux/platforms

    • /opt/java$ source /etc/profile

    • /opr/java$ android -h

      错误 bash: /opt/java/android-sdk-linux/tools/android: Permission denied

    • chmod a+x /opt/java/android-sdk-linux/tools/android

    • /opt/java$ android -h

      成功 Usage:
      android [global options] action [action options]
      Global options:
      -h –help : Help on a specific command.
      -v –verbose : Verbose mode, shows errors, warnings and all messages.
      ……

  5. NDK Android原生开发包是SDK的伴随工具,可以让用户C++的原生编程语言开发Android应用程序.NDK提供了头文件/库/交叉编译工具链
    https://github.com/taka-no-me/android-cmake/blob/master/ndk_links.md 老版本下载目录
    下载 : android-ndk-r10d-linux-x86.bin

    • chmod a+x /opt/java/android-ndk-r10d-linux-x86.bin
    • /opt/java$ sudo ./android-ndk-r10d-linux-x86.bin

             .....
            Everything is Ok
      
    • /opt/java$ sudo vim /etc/profile

          PATH=/opt/java/android-ndk-r10d
      
    • /opt/java$ source /etc/profile

    • /opt/java$ ndk -build

      Android NDK: Could not find application project directory !    
      Android NDK: Please define the NDK_PROJECT_PATH variable to point to it.    
      /opt/java/android-ndk-r10d/build/core/build-local.mk:148: *** Android NDK: Aborting    .  Stop.
      
  6. Eclipse安装
    http://www.eclipse.org/ 下载

你可能感兴趣的:(Android)