Android Automotive开发之一《编译自己的SDK 》

自己动手编译最新Android源码及SDK : http://blog.csdn.net/dd864140130/article/details/51718187官方文档,怎样编译sdk : https://android.googlesource.com/platform/sdk/+/master/docs/howto_build_SDK.txt

Android N Car源码到手,但官方还没有发布最新的SDK,源码中开发应用就有很大的难度,有了自己的SDK,无论framework层如何变动,都可以在Android Studio中开发得心应手。

Copyright (C) 2009 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
     http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Subject: How to build an Android SDK & ADT Eclipse plugin.
Date:    2009/03/27
Updated: 2015/09/09
Table of content:
  0- License
  1- Foreword
  2- Building an SDK for MacOS and Linux
  3- Building an SDK for Windows
  4- Building an ADT plugin for Eclipse
  5- Conclusion
----------
0- License
----------
 Copyright (C) 2009 The Android Open Source Project
 Licensed under the Apache License, Version 2.0 (the "License");
 you may not use this file except in compliance with the License.
 You may obtain a copy of the License at
      http://www.apache.org/licenses/LICENSE-2.0
 Unless required by applicable law or agreed to in writing, software
 distributed under the License is distributed on an "AS IS" BASIS,
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 See the License for the specific language governing permissions and
 limitations under the License.
-----------
1- Foreword
-----------
This document explains how to build the Android SDK and the ADT Eclipse plugin.
It is designed for advanced users which are proficient with command-line
operations and know how to setup the pre-required software.
Basically it‘s not trivial yet when done right it‘s not that complicated.
--------------------------------------
2- Building an SDK for MacOS and Linux
--------------------------------------
First, setup your development environment and get the Android source code from
git as explained here:
  http://source.android.com/source/download.html
For example for the cupcake branch:
  $ mkdir ~/my-android-git
  $ cd ~/my-android-git
  $ repo init -u https://android.googlesource.com/platform/manifest -b master -g all,-notdefault,tools
  $ repo sync
Then once you have all the source, simply build the SDK using:
  $ cd ~/my-android-git
  $ . build/envsetup.sh
  $ lunch sdk-eng
  $ make sdk
This will take a while, maybe between 20 minutes and several hours depending on
your machine. After a while you‘ll see this in the output:
  Package SDK: out/host/darwin-x86/sdk/android-sdk_eng.<build-id>_mac-x86.zip
Some options:
- Depending on your machine you can tell ‘make‘ to build more things in
  parallel, e.g. if you have a dual core, use "make -j4 sdk" to build faster.
- You can define "BUILD_NUMBER" to control the build identifier that gets
  incorporated in the resulting archive. The default is to use your username.
  One suggestion is to include the date, e.g.:
  $ export BUILD_NUMBER=${USER}-`date +%Y%m%d-%H%M%S`
  There are certain characters you should avoid in the build number, typically
  everything that might confuse ‘make‘ or your shell. So for example avoid
  punctuation and characters like $ & : / \ < > , and .
------------------------------
3- Building an SDK for Windows
------------------------------
Full Windows SDK builds are now only supported on Linux -- most of the
framework is not designed to be built on Windows so technically the Windows
SDK is build on top of a Linux SDK where a few binaries are replaced. So it
cannot be built on Windows, and it cannot be built on Mac, only on Linux.
I‘ll repeat this again because it‘s important:
  To build the Android SDK for Windows, you need to use a *Linux* box.
A- Pre-requisites
-----------------
Before you can even think of building the Android SDK for Windows, you need to
perform the steps from section "2- Building an SDK for MacOS and Linux" above:
setup and build a regular Linux SDK. Once this working, please continue here.
Under Ubuntu, you will need the following extra packages:
$ sudo apt-get install tofrodos
tofrodos adds a unix2dos command
B- Building
-----------
To build, perform the following steps:
$ . build/envsetup.sh
$ lunch sdk-eng
$ make win_sdk
Note that this will build both a Linux SDK then a Windows SDK.
The result is located at
   out/host/windows/sdk/android-sdk_eng.${USER}_windows/
C- Building just the tools
--------------------------------------
You can also build isolated windows tools directly on Linux without building
the full SDK.
To build, perform the following steps:
  $ cd ~/my-android-git
  $ . build/envsetup.sh
  $ lunch sdk-eng
  $ make winsdk-tools
A specific tool can be built using:
  $ make host_cross_adb
Then the binaries are located at
  out/host/windows-x86/bin/adb.exe
-------------------------------------
4- Building an ADT plugin for Eclipse
-------------------------------------
We‘ve simplified the steps here.
It used to be that you‘d have to download a specific version of
Eclipse and install it at a special location. That‘s not needed
anymore.
Instead you just change directories to your git repository and invoke the
build script by giving it a destination directory and an optional build number:
  $ mkdir ~/mysdk
  $ cd ~/my-android-git   # <-- this is where you did your "repo sync"
  $ sdk/eclipse/scripts/build_server.sh ~/mysdk $USER
The first argument is the destination directory. It must be absolute. Do not
give a relative destination directory such as "../mysdk" -- this would make the
Eclipse build fail with a cryptic message:
  BUILD SUCCESSFUL
  Total time: 1 minute 5 seconds
  **** Package in ../mysdk
  Error: Build failed to produce ../mysdk/android-eclipse
  Aborting
The second argument is the build "number". The example used "$USER" but it
really is a free identifier of your choice. It cannot contain spaces nor
periods (dashes are ok.) If the build number is missing, a build timestamp will
be used instead in the filename.
The build should take something like 5-10 minutes.
When the build succeeds, you‘ll see something like this at the end of the
output:
  ZIP of Update site available at ~/mysdk/android-eclipse-v200903272328.zip
or
  ZIP of Update site available at ~/mysdk/android-eclipse-<buildnumber>.zip
When you load the plugin in Eclipse, its feature and plugin name will look like
"com.android.ide.eclipse.adt_0.9.0.v200903272328-<buildnumber>.jar". The
internal plugin ID is always composed of the package, the build timestamp and
then your own build identifier (a.k.a. the "build number"), if provided. This
means successive builds with the same build identifier are incremental and
Eclipse will know how to update to more recent ones.
-------------
5- Conclusion
-------------
This completes the howto guide on building your own SDK and ADT plugin.
Feedback is welcome on the public Android Open Source forums:
  http://source.android.com/discuss
If you are upgrading from a pre-cupcake to a cupcake or later SDK please read
the accompanying document "howto_use_cupcake_sdk.txt".
-end-
时间: 2024-11-25 12:34:42

Android Automotive开发之一《编译自己的SDK 》的相关文章

Android ndk开发swig编译jni接口配置文件(二)

之前写过一篇Android ndk开发swig编译jni接口.看这篇看不懂,看以去看看.c++与Java有些语言结构还是有一定区别,比如c++结构体,一些函数的返回值等都是有所不同,进行swig编译要进行一些预处理,也就是配置一下就行.下面说说几种情况. 一.一般情况下string,数组,枚举类型等配置Unix.i %module Survey %include "std_string.i" %include "arrays_java.i" %include &qu

【Android 系统开发】 编译 Android 系统 u-boot 内核 源码 并烧写到 OK-6410A 开发板上

博客地址 : http://blog.csdn.net/shulianghan/article/details/40299813  本篇文章中用到的工具源码下载 : -- ok-6410A 附带的 Android 光盘 下载地址 : http://pan.baidu.com/share/link?shareid=3662728609&uk=2754759285 ; -- 光盘所含内容 : Android 引导 u-boot 源码, Android 内核 源码, Android 系统源码, 交叉编

Android Automotive开发之一《环境: JDK7&amp;JDK8切换 》

http://ubuntuhandbook.org/index.php/2015/01/install-openjdk-8-ubuntu-14-04-12-04-lts/ 安装OpenJDK8 sudo add-apt-repository ppa:openjdk-r/ppa sudo apt-get update sudo apt-get install openjdk-8-jdk 切换方法 sudo update-alternatives --config java sudo update-

【Android 系统开发】CyanogenMod 13.0 源码下载 编译 ROM 制作 ( 手机平台 : 小米4 | 编译平台 : Ubuntu 14.04 LTS 虚拟机)

作者 : 韩曙亮 转载请注明出处 : http://blog.csdn.net/shulianghan/article/details/51592930 手机的两种模式 : 在下面有详细的图片示例; -- Recovery 模式 : 音量键增加 + 电源键, 长按上述组合键, 看到 "MI" 的 LOGO 后即进入 Recovery 模式; -- Fastboot 模式 : 音量键减小 + 电源键, 长按上述组合键, 看到 "FASTBOOT" 后, 即 进入 FA

【流媒体开发】VLC Media Player - Android 平台源码编译 与 二次开发详解 (提供详细800M下载好的编译源码及eclipse可调试播放器源码下载)

作者 : 韩曙亮  博客地址 : http://blog.csdn.net/shulianghan/article/details/42707293 转载请注明出处 : http://blog.csdn.net/shulianghan VLC 二次开发 视频教程 : http://edu.csdn.net/course/detail/355 博客总结 : -- 本博客目的 : 让 Android 开发者通过看本博客能够掌握独立移植 VLC Media Player 核心框架到自己的 app 中,

Android应用开发编译框架流程与IDE及Gradle概要

1 背景 建议阅读本文之前先阅读<Android Studio入门到精通>和<Groovy脚本基础全攻略>及<Gradle脚本基础全攻略>三篇博客作为背景知识,这样才能更好.更系统的串起来.本文的核心就是下图: 关于Gradle的Android插件本文不会过多的说明,只给一个抛砖引玉的提示,详细使用参见文档API及Gradle配置,其实个性化的构建配置一般都是Gradle与Groovy的编写,与Android插件没太多关系,所以重点还在Groovy与Gradle构建.

windows下用ADT进行android NDK开发的详细教程(从环境搭建、配置到编译全过程)

郑重申明:如需转载本博客,请注明出处,谢谢! 这几天在学习android NDK的开发,那么首先让我们来看看android NDK开发的本质是什么. NDK(Native Development Kit),即本地开发工具,简单地说,就是在开发android应用程序的时候,在java类中调用native函数,而native函数的接口也是在java类中定义的,但是native函数最终由本地的C/C++代码实现.简单地说,就是在java中调用C/C++函数.至于为什么要用NDK,我总结了一下,大致有以

Android 开源项目android-open-project开发工具及测试工具解析 开发效率工具,开发自测相关,测试工具,开发及编译环境,其他

主要介绍和Android开发工具和测试工具相关的开源项目. 一.开发效率工具 Parceler 通过注解及工具类自动完成实体类 Parcelable及值传递 项目地址:https://github.com/johncarl81/parceler Json2Java 根据JSon数据自动生成对应的Java实体类,还支持Parcel.Gson Annotations对应代码自动生成.期待后续的提取父类以及多url构建整个工程的功能 项目地址:https://github.com/jonfhancoc

[Android Pro] 开发一流Android SDK

cp from : https://blog.csdn.net/dd864140130/article/details/53558011 本篇文章已授权微信公众号 guolin_blog (郭霖)独家发布 自从前段时间离职后,因为个人的事情一直没有选择再工作,也导致原有的文章并没有按时产出.最近个人的事情整理的也差不多了,恰好有不少朋友来问有关SDK开发方面的事情,在此就做个简单的梳理,希望能帮助各位. 目前更多开发者热衷于应用开发,极少数的开发者才有机会从事SDK开发工作,而市面上关于SDK开