Skip to content

AndroidBuildingTheSDK

Kees Jongenburger edited this page Mar 29, 2011 · 7 revisions

Building the Android SDK.

Running make sdk ‘normally’ should create a SDK that can be used under Linux. I don’t know how to create a windows SDK. However
to create an exact copy of the Android SDK you will need to tweak a few things.

First ensure the following works.

#
#
#
source build/envsetup.sh
lunch sdk-eng

#
# override build/core/version_defaults.mk 
# so PLATFORM_VERSION is an official version.
export PLATFORM_VERSION=9
#============================================
#PLATFORM_VERSION_CODENAME=REL
#PLATFORM_VERSION=2.3.1
#TARGET_PRODUCT=sdk
#TARGET_BUILD_VARIANT=eng
#TARGET_SIMULATOR=false
#TARGET_BUILD_TYPE=release
#TARGET_BUILD_APPS=
#TARGET_ARCH=arm
#HOST_ARCH=x86
#HOST_OS=linux
#HOST_BUILD_TYPE=release
#BUILD_ID=GINGERBREAD
#============================================
make sdk

For building Android 2.2 Java 1.5 was required and checked. For 2.3 the check was removed(like already was in the master branch) and the system now build properly.

Building the windows sdk can be done in at least two ways
1) under windows with cygwin see development/build/tools/make_windows_sdk.sh
2) under linux using mingw32 and the Android build system

#
# follow the same prodecure as above and after that run
#
make PRODUCT-sdk-win_sdk
android -v
Warning: Ignoring platform 'android-2.3.1': tools/aapt is missing.
#
# In android 2.2 every delivered platform contained a subdirectory called tools
# starting with 2.3 the sdk release now has put them somewhere else but (at 
# time of writing) the emulator tool still expects it in the tools directory
# see http://developer.android.com/sdk/installing.html#sdkContents 
# so link the generic platform-tools to the 2.3.1 platform.
android-sdk-linux_x86/platforms/android-2.3.1$ ln -s ../../platform-tools tools

Clone this wiki locally