Android Automotive开发之一《编译自己的SDK 》 // TOBEDONE
自己动手编译最新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) 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: //
Updated: //
Table of content:
- License
- Foreword
- Building an SDK for MacOS and Linux
- Building an SDK for Windows
- Building an ADT plugin for Eclipse
- Conclusion
----------
- License
----------
Copyright (C) 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.
-----------
- 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.
--------------------------------------
- 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 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 .
------------------------------
- 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
-------------------------------------
- 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: minute 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 - 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.
-------------
- 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-
Android Automotive开发之一《编译自己的SDK 》 // TOBEDONE的更多相关文章
- 【Android 系统开发】 编译 Android文件系统 u-boot 内核 并烧写到 OK-6410A 开发板上
博客地址 : http://blog.csdn.net/shulianghan/article/details/40299813 本篇文章中用到的工具源码下载 : -- ok-6410A 附带的 A ...
- Android Automotive开发之一《环境: JDK7&JDK8切换 》
http://ubuntuhandbook.org/index.php/2015/01/install-openjdk-8-ubuntu-14-04-12-04-lts/ 安装OpenJDK8 sud ...
- 【Android 系统开发】CyanogenMod 13.0 源码下载 编译 ROM 制作 ( 手机平台 : 小米4 | 编译平台 : Ubuntu 14.04 LTS 虚拟机)
分类: Android 系统开发(5) 作者同类文章X 版权声明:本文为博主原创文章 ...
- 【Android 应用开发】Android 开发环境下载地址 -- 百度网盘 adt-bundle android-studio sdk adt 下载
19af543b068bdb7f27787c2bc69aba7f Additional Download (32-, 64-bit) Package r10 STL debug info androi ...
- 【流媒体开发】VLC Media Player - Android 平台源码编译 与 二次开发详解 (提供详细800M下载好的编译源码及eclipse可调试播放器源码下载)
作者 : 韩曙亮 博客地址 : http://blog.csdn.net/shulianghan/article/details/42707293 转载请注明出处 : http://blog.csd ...
- [Android Pro] 开发一流Android SDK
cp from : https://blog.csdn.net/dd864140130/article/details/53558011 本篇文章已授权微信公众号 guolin_blog (郭霖)独家 ...
- [Android Pro] 开发一流的 Android SDK:Fabric SDK 的创建经验
cp from : https://academy.realm.io/cn/posts/oredev-ty-smith-building-android-sdks-fabric/ Ty Smith T ...
- Windows下搭建Android NDK开发环境及命令行编译
首先说明本文内的相关安装操作参考<Pro Android C++ with the NDK>一书. 安装 Windows搭建Android NDK开发环境需要安装如下部分(同时需要配置对应 ...
- windows下用ADT进行android NDK开发的具体教程(从环境搭建、配置到编译全过程)
郑重申明:如需转载本博客,请注明出处,谢谢! 这几天在学习android NDK的开发.那么首先让我们来看看android NDK开发的本质是什么. NDK(Native Development Ki ...
随机推荐
- 用java单例模式实现面板切换
1.首先介绍一下什么是单例模式: java单例模式是一种常见的设计模式,那么我们先看看懒汉模式: public class Singleton_ { //设为私有方法,防止被外部类引用或实例 priv ...
- Android Weekly Notes Issue #219
Android Weekly Issue #219 August 21st, 2016 Android Weekly Issue #219 ARTICLES & TUTORIALS Andro ...
- iOS从零开始学习直播之音频4.歌词
上一篇讲了歌曲的切换,这一篇主要讲歌词部分的实现. 先看效果图.当歌手唱到这句歌词时候,我们要标记出来,这里显示字体为黄色. 1.获取歌词 一般歌词都是一个链接.类似于"http ...
- java对xml节点属性的增删改查
学习本文之前请先看我的另一篇文章JAVA对XML节点的操作可以对XML操作有更好的了解. package vastsum; import java.io.File; import java.io.Fi ...
- [Erlang 0109] From Elixir to Erlang Code
Elixir代码最终编译成为erlang代码,这个过程是怎样的?本文通过一个小测试做下探索. 编译一旦完成,你就看到了真相 Elixir代码组织方式一方面和Erlang一样才用非常 ...
- MySQL 索引
MySQL索引的建立对于MySQL的高效运行是很重要的,索引可以大大提高MySQL的检索速度. 打个比方,如果合理的设计且使用索引的MySQL是一辆兰博基尼的话,那么没有设计和使用索引的MySQL就是 ...
- db2学习笔记--数据类型对表的影响
创建表的时为列选择合适的数据类型,可以提高数据库性能. 1.选择合适的数据类型,避免出现数据类型转换.例如日期,有人使用字符串来存放日期.时间戳,最后我们还要在程序中使用to_date做数据类型转换, ...
- Linux shell脚本编程(一)
Linux shell脚本编程: 守护进程,服务进程:启动?开机时自动启动: 交互式进程:shell应用程序 广义:GUI,CLI GUI: CLI: 词法分析:命令,选项,参数 内建命令: 外部命令 ...
- 萌新笔记——C++里创建 Trie字典树(中文词典)(二)(插入、查找、导入、导出)
萌新做词典第二篇,做得不好,还请指正,谢谢大佬! 做好了插入与遍历功能之后,我发现最基本的查找功能没有实现,同时还希望能够把内存的数据存入文件保存下来,并可以从文件中导入词典.此外,数据的路径是存在配 ...
- linux分区机制(MBR GPT)简介