80,471
社区成员




------------------------------ 3- Building an SDK for Windows
------------------------------
A- SDK pre-requisite
--------------------
First you need to build an SDK for MacOS and Linux. The Windows build works by updating an existing MacOS or Linux SDK zip file and replacing the unix binaries by Windows binaries.
B- Cygwin pre-requisite & code checkout
---------------------------------------
Second you need to install Cygwin and configure it:
- Get the installer at http://sources.redhat.com/cygwin/
- When installing Cygwin, set Default Text File Type to Unix/binary, not DOS/text. This is really important, otherwise you will get errors when trying to checkout code using git.
- Packages that you must install or not:
- Required packages: autoconf, bison, curl, flex, gcc, g++, git, gnupg, make, mingw-zlib, python, zip, unzip.
- Suggested extra packages: diffutils, emacs, openssh, rsync, vim, wget.
- Packages that must not be installed: readline.
Once you installed Cygwin properly, checkout the code from git as you did for MacOS or Linux. Make sure to get the same branch, and if possible keep it as close to the other one as possible:
$ mkdir ~/my-android-git
$ cd ~/my-android-git
$ repo init -u git://android.git.kernel.org/platform/manifest.git -b cupcake $ repo sync
C- Building the Windows SDK
---------------------------
Now it's time to build that Windows SDK. You need:
- The path to the MacOS or Linux SDK zip.
- A directory where to place the final SDK. It will also hold some temporary files.
- The build number will be extracted from the SDK zip filename, but this will only work if that build number has no underscores in it. It is suggested you just define SDK_NUMBER (and not BUILD_NUMBER!) on the command line before invoking the script.
Note that the "SDK number" is really a free identifier of your choice. It doesn't need to be strictly a number. As always it is suggested you avoid too much punctuation and special shell/make characters. Underscores cannot be used.
To summarize, the steps on the command line would be something like this:
$ mkdir ~/mysdk
$ export SDK_NUMBER=${USER}-`date +%Y%m%d-%H%M%S`
$ cd ~/my-android-git
$ development/build/tools/make_windows_sdk.sh /path/to/macos/or/linux/sdk.zip ~/mysdk
This will take a while to build some Windows-specific binaries, including the emulator, unzip the previous zip, rename & replace things and rezip the final Windows SDK zip file. A typical build time should be around 5-10 minutes.