The first thing to do with Mac OS is to build the environment. Mac OS is easy to use thanks to the long-Windows+xshell development model. I use it mostly at home to tinker with something, and I can write something after work.
There are some places that are not quite fit, because the MOC OS is UNIX-based OS, so many of the commands are more standard, not as random as Linux, which leads me to write some of the scripts to run a bit of a problem. In order to be able to adapt to Mac OS and Linux system, usually in the use of commands and write shell scripts to standardize some, the option after the command, rather than arbitrarily placed in another location.
1. MacPorts
A necessary tool in Mac OS, ports equivalent to the Apt-get under Linux, we usually install some command line tools can be installed quickly through ports. Android Xcode is required before installing ports and can be installed in the store. Then download the MacPorts and install it.
http://guide.macports.org/#installing. Xcode
$ Curl-o HTTPS://Distfiles.MacPorts.org/MacPorts/MacPorts-2.3.3.tar.bz2
$ tar xf macports - 2.3 . 3.tar bz2
$ cd macports - 2.3 . 3 /
$ ./configure
$ make
$ sudo make install
2. JDK
This is the Android development necessary environment, Google recommended compiling Android 5.0.x and above version using 7U71 version, I tried the 8u40 version, the results of the compilation of Android 5.1.1 source code when the API is outdated and other errors.
No open JDK in Mac OS can use Oracle JDK only, for https://www.oracle.com/technetwork/java/javase/downloads/ Java-archive-downloads-javase7-521261.html#jdk-7u71-oth-jpr
3. Android Studio
This is Google's recommended Android development environment, this is the Android application development of the weapon Ah, Android Studio is not the power of doubt. I've been using eclipse at the company because I don't write apps very often and I should use it at home. It takes up a lot of space, and I'm pretty smooth with this installation, and it's very fast when I update the SDK tools, and I'm not using stairs.
Http://developer.android.com/sdk/index.html
Train:
Windows (with SDK, no SDK)
Https://dl.google.com/dl/android/studio/install/1.2.1.1/android-studio-bundle-141.1903250-windows.exe
Https://dl.google.com/dl/android/studio/install/1.2.1.1/android-studio-ide-141.1903250-windows.exe
Linux
Https://dl.google.com/dl/android/studio/ide-zips/1.2.1.1/android-studio-ide-141.1903250-linux.zip
Mac OS
Https://dl.google.com/dl/android/studio/install/1.2.1.1/android-studio-ide-141.1903250-mac.dmg
4. NDK
This is my usual development is necessary environment, the current version is r10e. This environment is also very easy to build, directly download and then unzip, and then set the environment variables just fine. Linux and Mac are bin format, is also a compression format, chmod and Execute permissions can be executed directly, and then extract a android-ndk-r10e folder.
Train
Windows
? http://dl.google.com/android/ndk/android-ndk-r10e-windows-x86.exe
Http://dl.google.com/android/ndk/android-ndk-r10e-windows-x86_64.exe
Linux
Http://dl.google.com/android/ndk/android-ndk-r10e-linux-x86.bin
Http://dl.google.com/android/ndk/android-ndk-r10e-linux-x86_64.bin
Mac OS X 64bit
Http://dl.google.com/android/ndk/android-ndk-r10e-darwin-x86_64.bin
5. Android Source code
Peacetime development is inseparable from the Android source code, Android source code is the crystallization of many excellent engineers, in peacetime development can be used for reference in a particularly large number of places. Most of the time I'll just take some of the useful stuff out of it and use it somewhere else, not to reinvent the wheel. But the domestic environment to download dozens of G files is not an easy thing, here to thank Codeaurora, we can download to the latest in the Android source code without the need for stairs, Qualcomm Platform Android Source (Android for MSM).
https://www.codeaurora.org/
# repo
$ git clone git://Codeaurora.org/Quic/La/Tools/repo && cd repo && export path= $PATH: $PWD
# android 5.1.0
$ repo init-u git://Codeaurora.org/Quic/La/Platform/Manifest-b aosp-New/Android-Wear-5.1.0_R1&&Repo Sync
If you have downloaded the Android source, then you can compile the next, Mac OS and Linux in the compilation environment is a little different, you can not directly configure the environment after the direct implementation of M integration. In Mac OS you need to compile in the case-sensitive file system, and you need to reset the size of the file descriptor (the number of FD). Specific details directly read the official note: http://source.android.com/source/initializing.html
6. Dash
is a Mac OS software, the first time in contact with the Mac OS in the store's development tools to find it, it provides a variety of languages, development platform documents, but also a big tool AH.
MAC OS Android Development environment build-macports, NDK, SDK, Android source code