Check existing Java
Input this command in terminal.javac -version
The reply is...
javac 1.x.x_xx
No Java runtime present, requesting install.You need to download JDK if the version is lower than 1.8 or no java.
Java SE Development Kit 8
http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
Install Android Studio
Currently version is 2.1.https://developer.android.com/intl/ja/sdk/index.html
How installing it.
https://developer.android.com/intl/ja/sdk/installing/index.html
Download Android NDK
Here you go.https://developer.android.com/intl/ja/ndk/downloads/index.html
Unzip, then set any place you like.
例: /Users/(UserName)/Android/android-ndk-r11c
Download Apache ANT
Here you go.http://ant.apache.org/bindownload.cgi
Unzip, then set any place you like.
例: /Users/(UserName)/Android/apache-ant-1.9.7
Install Cocos2d-x
Execute setup.py, check this article.https://fnet-tech.blogspot.jp/2016/05/cocos2d-x-310.html
Input these paths.
->Please enter the path of NDK_ROOT (or press Enter to skip):
Like this: /Users/(UserName)/Android/android-ndk-r11c
->Please enter the path of ANDROID_SDK_ROOT (or press Enter to skip):
Like this: /Users/(UserName)/Library/Android/sdkSDK path is same as this if you installed Android Studio for standard.
->Please enter the path of ANT_ROOT (or press Enter to skip):
Like this: /Users/(UserName)/Android/apache-ant-1.9.7/binThis path needs "bin" to the end, not just apache-ant folder.
Please execute command: "source /Users/(UserName)/.bash_profile" to make added system variables take effectCopy and paste the command, then execute it.
source /Users/(UserName)/.bash_profile
Done!