`

ndk source Downloading the Source Tree 【部分译】

阅读更多

http://source.android.com/source/downloading.html

 

在ubuntu Linux下,如果没有安装git,curl,那么执行下面2个命令

sudo apt-get install git

sudo apt-get install curl

然后按照下面执行(需要注册一个google账户,最好gmail)

 

Downloading the Source Tree

Installing Repo

安装Repo

Repo是一个整合的git工具

$ mkdir ~/bin 创建目录,用于存放repo $ PATH=~/bin:$PATH ,添加到运行环境


  •  

  •  

  • Download the Repo script and ensure it is executable:

    $ curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo 下载并存为repo文件
  •  $ chmod a+x ~/bin/repo 修改为可执行文件
    
    
  •  

     

     

    Repo is a tool that makes it easier to work with Git in the context of Android. For more information about Repo, see Version Control.

    To install, initialize, and configure Repo, follow these steps:

    • Make sure you have a bin/ directory in your home directory, and that it is included in your path:

      $ mkdir ~/bin $ PATH=~/bin:$PATH
      
      
    •  

    •  

    • Download the Repo script and ensure it is executable:

      $ curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo $ chmod a+x ~/bin/repo
      
      
    • The SHA-1 checksum for repo is e1fd3bef059d152edf4d0522590725d317bc637f

    Initializing a Repo client

    After installing Repo, set up your client to access the android source repository:

    • Create an empty directory to hold your working files. If you're using MacOS, this has to be on a case-sensitive filesystem. Give it any name you like:

      $ mkdir WORKING_DIRECTORY $ cd WORKING_DIRECTORY
      
      
    • Run repo init to bring down the latest version of Repo with all its most recent bug fixes. You must specify a URL for the manifest, which specifies where the various repositories included in the Android source will be placed within your working directory.

      $ repo init -u https://android.googlesource.com/platform/manifest 同步主trunk版本
      
      

      To check out a branch other than "master", specify it with -b:

      $ repo init -u https://android.googlesource.com/platform/manifest -b android-4.0.1_r1 指定需要同步的版本为android-4.0.1_r1
      
      
    • When prompted, please configure Repo with your real name and email address. To use the Gerrit code-review tool, you will need an email address that is connected with a registered Google account. Make sure this is a live address at which you can receive messages. The name that you provide here will show up in attributions for your code submissions.

    这里面具体版本可以在该网页上看到,如2.3.3_r1等。

    A successful initialization will end with a message stating that Repo is initialized in your working directory. Your client directory should now contain a .repo directory where files such as the manifest will be kept.

    Getting the files

    To pull down files to your working directory from the repositories as specified in the default manifest, run

    $ repo sync

     

    
    

    The Android source files will be located in your working directory under their project names. The initial sync operation will take an hour or more to complete. For more about repo sync and other Repo commands, see Version Control.

    Verifying Git Tags

    Load the following public key into your GnuPG key database. The key is used to sign annotated tags that represent releases.

    $ gpg --import

     

    
    

    Copy and paste the key(s) below, then enter EOF (Ctrl-D) to end the input and process the keys.

    -----BEGIN PGP PUBLIC KEY BLOCK----- Version: GnuPG v1.4.2.2 (GNU/Linux) mQGiBEnnWD4RBACt9/h4v9xnnGDou13y3dvOx6/t43LPPIxeJ8eX9WB+8LLuROSV lFhpHawsVAcFlmi7f7jdSRF+OvtZL9ShPKdLfwBJMNkU66/TZmPewS4m782ndtw7 8tR1cXb197Ob8kOfQB3A9yk2XZ4ei4ZC3i6wVdqHLRxABdncwu5hOF9KXwCgkxMD u4PVgChaAJzTYJ1EG+UYBIUEAJmfearb0qRAN7dEoff0FeXsEaUA6U90sEoVks0Z wNj96SA8BL+a1OoEUUfpMhiHyLuQSftxisJxTh+2QclzDviDyaTrkANjdYY7p2cq /HMdOY7LJlHaqtXmZxXjjtw5Uc2QG8UY8aziU3IE9nTjSwCXeJnuyvoizl9/I1S5 jU5SA/9WwIps4SC84ielIXiGWEqq6i6/sk4I9q1YemZF2XVVKnmI1F4iCMtNKsR4 MGSa1gA8s4iQbsKNWPgp7M3a51JCVCu6l/8zTpA+uUGapw4tWCp4o0dpIvDPBEa9 b/aF/ygcR8mh5hgUfpF9IpXdknOsbKCvM9lSSfRciETykZc4wrRCVGhlIEFuZHJv aWQgT3BlbiBTb3VyY2UgUHJvamVjdCA8aW5pdGlhbC1jb250cmlidXRpb25AYW5k cm9pZC5jb20+iGAEExECACAFAknnWD4CGwMGCwkIBwMCBBUCCAMEFgIDAQIeAQIX gAAKCRDorT+BmrEOeNr+AJ42Xy6tEW7r3KzrJxnRX8mij9z8tgCdFfQYiHpYngkI 2t09Ed+9Bm4gmEO5Ag0ESedYRBAIAKVW1JcMBWvV/0Bo9WiByJ9WJ5swMN36/vAl QN4mWRhfzDOk/Rosdb0csAO/l8Kz0gKQPOfObtyYjvI8JMC3rmi+LIvSUT9806Up hisyEmmHv6U8gUb/xHLIanXGxwhYzjgeuAXVCsv+EvoPIHbY4L/KvP5x+oCJIDbk C2b1TvVk9PryzmE4BPIQL/NtgR1oLWm/uWR9zRUFtBnE411aMAN3qnAHBBMZzKMX LWBGWE0znfRrnczI5p49i2YZJAjyX1P2WzmScK49CV82dzLo71MnrF6fj+Udtb5+ OgTg7Cow+8PRaTkJEW5Y2JIZpnRUq0CYxAmHYX79EMKHDSThf/8AAwUIAJPWsB/M pK+KMs/s3r6nJrnYLTfdZhtmQXimpoDMJg1zxmL8UfNUKiQZ6esoAWtDgpqt7Y7s KZ8laHRARonte394hidZzM5nb6hQvpPjt2OlPRsyqVxw4c/KsjADtAuKW9/d8phb N8bTyOJo856qg4oOEzKG9eeF7oaZTYBy33BTL0408sEBxiMior6b8LrZrAhkqDjA vUXRwm/fFKgpsOysxC6xi553CxBUCH2omNV6Ka1LNMwzSp9ILz8jEGqmUtkBszwo G1S8fXgE0Lq3cdDM/GJ4QXP/p6LiwNF99faDMTV3+2SAOGvytOX6KjKVzKOSsfJQ hN0DlsIw8hqJc0WISQQYEQIACQUCSedYRAIbDAAKCRDorT+BmrEOeCUOAJ9qmR0l EXzeoxcdoafxqf6gZlJZlACgkWF7wi2YLW3Oa+jv2QSTlrx4KLM= =Wi5D -----END PGP PUBLIC KEY BLOCK-----

     

    
    

    After importing the keys, you can verify any tag with

    $ git tag -v TAG_NAME

     

    
    

    Next: Build the code

    You now have a complete local copy of the Android codebase. Continue on to building....

     

     

    ---------------------------------------------------------

    我在ubuntu linux 服务器上去编译,结果一大堆错误

    机器:2.6.35-22-server #33-Ubuntu SMP Sun Sep 19 20:48:58 UTC 2010 x86_64 GNU/Linux

    Java 1.6

    按照上述步骤后,执行

    make

    错误如下:

    ============================================
    PLATFORM_VERSION_CODENAME=REL
    PLATFORM_VERSION=2.3.3
    TARGET_PRODUCT=generic
    TARGET_BUILD_VARIANT=eng
    TARGET_SIMULATOR=
    TARGET_BUILD_TYPE=release
    TARGET_BUILD_APPS=
    TARGET_ARCH=arm
    HOST_ARCH=x86
    HOST_OS=linux
    HOST_BUILD_TYPE=release
    BUILD_ID=GRI40
    ============================================
    /bin/bash: prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi-gcc: No such file or directory
    /bin/bash: prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi-gcc: No such file or directory
    /bin/bash: bison: command not found
    find: `frameworks/base/frameworks/base/docs/html': No such file or directory
    find: `out/target/common/docs/gen': No such file or directory
    find: `frameworks/base/frameworks/base/docs/html': No such file or directory
    find: `out/target/common/docs/gen': No such file or directory
    find: `frameworks/base/frameworks/base/docs/html': No such file or directory
    find: `out/target/common/docs/gen': No such file or directory
    find: `frameworks/base/frameworks/base/docs/html': No such file or directory
    find: `out/target/common/docs/gen': No such file or directory
    find: `frameworks/base/frameworks/base/docs/html': No such file or directory
    find: `out/target/common/docs/gen': No such file or directory
    host C: acp <= build/tools/acp/acp.c
    In file included from /usr/include/features.h:387,
                     from /usr/include/stdlib.h:25,
                     from build/tools/acp/acp.c:11:
    /usr/include/gnu/stubs.h:7: fatal error: gnu/stubs-32.h: No such file or directory
    compilation terminated.
    make: *** [out/host/linux-x86/obj/EXECUTABLES/acp_intermediates/acp.o] Error 1

    ------------------------------------------------------------------

    后来,下载ndk7,在Cygwin 中编译hello-jni,顺利通过。

     

     

     

    分享到:
    评论

    相关推荐

      jni-ndk学习+ue+source+图片

      JNI(Java Native Interface)是Java平台的一个重要组成部分,它允许Java代码和其他语言写的代码进行交互。NDK(Native Development Kit)是Google提供的一个用于在Android平台上开发原生代码的工具集,通常用于优化...

      android ndk jni demo source code

      Android NDK和JNI是Android应用开发中的重要组成部分,它们允许开发者使用C++或者其他原生代码来实现性能敏感或需要高效计算的部分。这个"android ndk jni demo source code"是针对这一主题的一个示例项目,它已经...

      Android C++高级编程使用NDK [ Pro Android C++ with the NDK ]书源码

      NDK允许开发者用C++编写部分应用程序,直接与硬件交互,以提高运行效率和降低内存占用。 1. **C++在Android中的应用**:Android NDK提供了C++支持,使得开发者可以使用标准模板库(STL)、多线程、模板等C++特性,...

      NDK Google android ndk

      ### Android NDK详解 #### 一、Android NDK概述 Android NDK(Native Development Kit)是一组工具集合,旨在让Android应用开发者能够将C或C++编写的原生代码集成到其应用程序中。这一功能对于那些希望利用底层...

      mac--ndk配置

      保存并退出,然后执行`source ~/.bash_profile`(或`source ~/.zshrc`)使更改生效。 三、验证NDK安装 在终端输入`ndk-build --version`,如果正确配置了环境变量,你应该能看到NDK的版本信息,这表明安装成功。 ...

      Pro Android C with the NDK.

      android 的C和C++开发Pro Android C with the NDK

      android-ndk-r16b-windows-x86_64.zip

      Android NDK(Native Development Kit)是谷歌为Android平台提供的一款用于开发原生代码的应用程序工具集,它允许开发者使用C和C++等低级语言编写部分应用程序,从而提高性能、利用硬件加速等功能。"android-ndk-r16...

      android-ndk(android-ndk-r23b-windows.zip)

      NDK是Android应用开发中的一个重要组成部分,它允许开发者使用原生代码(如C、C++)来编写部分应用程序,从而利用底层的硬件性能,提高程序运行效率,尤其是在处理图形计算、物理模拟和游戏引擎等高性能需求的场景下...

      android-ndk(android-ndk-r25b-linux.zip)

      在Android应用开发中,NDK扮演着至关重要的角色,它允许开发者使用原生代码(如C和C++)来编写部分应用,以提高性能、利用硬件加速功能或复用现有的C/C++库。 1. **JNI(Java Native Interface)**: JNI是Java...

      安卓NDK很好的例程

      安卓NDK(Native Development Kit)是Google为Android平台提供的一项技术,它允许开发者使用C、C++等原生代码编写应用程序的一部分,以实现高性能计算或访问底层硬件功能。NDK通常用于游戏开发、图像处理、物理模拟...

      android-ndk(android-ndk-r25b-windows.zip)

      **JNI(Java Native Interface)**是Android NDK的核心组成部分,它提供了Java和本地代码之间的接口。开发者可以通过JNI在Java应用中调用C/C++库,或者在C/C++代码中调用Java方法。这对于需要高效处理的计算任务,如...

      AndroidStudio中使用NDK编译器笔记

      在Android开发中,NDK(Native Development Kit)是一个重要的工具集,它允许开发者使用C/C++编写部分应用程序,以利用底层硬件性能或者调用特定的系统库。这篇笔记主要介绍了如何在Android Studio中配置和使用NDK...

      第一个NDK程序

      **NDK(Native Development Kit)**是Android平台开发中的一个重要工具集,它允许开发者使用C、C++等原生代码来编写部分应用模块,以实现高性能、低级别的硬件交互或者利用现有的C/C++库。本篇文章将深入探讨如何...

      Android Studio 1.5 NDK

      # Specifies the name of the NDK library that # you want CMake to locate. log ) # Specifies libraries CMake should link to your target library. target_link_libraries( # Specifies the target library...

      android-ndk(android-ndk-r25b-darwin.zip)

      对于需要高效运算的部分,如图形处理、物理模拟、加密算法等,使用NDK可以实现更快的运行速度。 3. **库的使用**:通过NDK,开发者可以直接在Android应用中使用C/C++编写的库,这大大扩展了可利用的开源库资源,...

      android studio ndk配置

      在Android开发领域,NDK(Native Development Kit)是一个不可或缺的工具,它允许开发者使用C/C++语言编写部分或全部应用程序,以实现高性能计算和利用硬件特性。本篇将详细讲解如何在Android Studio中配置NDK,以及...

      ndk c6455 dsp ndk c6455

      ti dsp ndk c6455ti dsp ndk c6455 ti dsp ndk c6455 ti dsp ndk c6455 ti dsp ndk c6455

      MASTERING_ANDROID_NDK

      掌握 Android NDK构建系统 - 第1部分:使用ndk-build的技术 本文不是“Hello world!” - NDK的类型教程。虽然我仍然会快速介绍ndk-build的基本知识,但它不是本文的重点。相反,我将总结一些非常有用的NDK技术和我...

      ubuntu下android ndk编译环境搭建详细描述

      Android NDK(Native Development Kit)是一套工具,允许开发者使用C/C++编写部分应用代码,以提高性能或者利用特定硬件功能。以下是对该过程的详细描述: 一、安装基础软件 1. 更新系统:首先确保Ubuntu系统是...

    Global site tag (gtag.js) - Google Analytics