How to build Android Windows SDK

来源:互联网 发布:北航软件学院 院长 编辑:程序博客网 时间:2024/05/01 02:54

 

0. Build sdk in Linux
  $ cd mydroid
  $ make PRODUCT-sdk-sdk


1. Install jdk in Windows to E:/Java/jdk1.6.0_21


2. Install cygwin:
  - Download the latest version of cygwin from http://www.cygwin.com/
  - Install cygwin
  - Required packages:
            autoconf, bison, curl, flex, gcc, gcc-g++, git, gnupg, make, gettext, gettext-devel, ncurses, libncurses-devel
            mingw-zlib, python, zip, unzip
  - Suggested extra packages:
            diffutils, emacs, openssh, rsync, vim, wget.
  - Packages that must not be installed: readline.

3. export PATH=$PATH:/cygdrive/e/Java/jdk1.6.0_21/bin/

4. download android source in cygwin
  $ mkdir ~/mydroid
  $ cd ~/mydriod
  $ repo init -u git://android.git.kernel.org/platform/manifest.git -b android2.2-r1.1
  $ repo sync

5. Install textinfo
  $ wget http://ftp.gnu.org/gnu/texinfo/texinfo-4.9.tar.bz2
  $ tar jvfx textinfo-4.9.tar.bz2
  $ cd textsinfo
  $ ./configure --prefix=/usr
  $ make
  $ make install

6. Install android toolchain from
  $ wget http://android.git.kernel.org/pub/android-toolchain-20081019.tar.bz2
  $ tar jvfx android-toolchain-20081019.tar.bz2
  $ cd android-toolchain-20081019
  $ ./configure --target=arm-eabi --prefix=XXX
  $ make build
  $ make install

7. Build windows sdk
  $ copy android-sdk_eng.me_linux-x86.zip from Linux to out/host/linux-x86/sdk/
  $ export SDK_NUMBER=${USER}-`date +%Y%m%d-%H%M%S`
  $ cd mydroid
  $ mkdir -p out/host/windows-x86/sdk
  $ development/build/tools/make_windows_sdk.sh out/host/linux-x86/sdk/android-sdk_eng.me_linux-x86.zip out/host/windows-x86/sdk

Note:
1). Add acp to fucntion_build() in development/build/tool/make_windows_sdk.sh as below:
    make /
        acp aapt aidl /
        etc1tool /
        prebuilt /
        dexdump dmtracedump /
        hprof-conv /
        mksdcard /
        sdklauncher sqlite3 /
        zipalign /
        || die "Build failed"

2). adb and fastboot have problem, so remove them in make_windows_sdk.sh
3). Remove cp *.dll in make_windows_sdk.sh, modify as below:
    #cp -v out/host/windows-x86/bin/*.{exe,dll} "$TOOLS"/
    cp -v out/host/windows-x86/bin/*.exe "$TOOLS"/
4). Because we can't build adb, so please copy adb.exe from downloaded windows sdk, and make a zipped file again.

 

原创粉丝点击