Cocos2dx3.0 development environment and Android compilation environment in windows, cocos2dx3.0android

Source: Internet
Author: User

Cocos2dx3.0 development environment and Android compilation environment in windows, cocos2dx3.0android

Cocos2dx was updated to version 3.x and has not been changed. Now the development team requires a uniform version change, so I will record the process of setting up the environment.

I. Build a development environment in Windowns

1. The required tool 1)cocos2d-x-3.0rc0.zip http://cn.cocos2d-x.org/download/ by Writing blog, the latest version is V3.2. 2) VS2012 http://www.baidu.com/s? Wd = VS2012 3) Python https://www.python.org/download/releases/2.7.8/ this depends on your system version 2. Install VS2012 this should not need to be explained too much .. 3. Installing Python is very simple. You can install Python one by one. After installation, add the Python installation path to the environment variable. Right-click a computer and choose Properties> advanced system Settings> advanced> environment variables. Find the Path in the system variables and click Edit to insert the Python installation Path, I installed it by default, so the path is C: \ Python27. Note the semicolon when inserting it here. Click "OK" and start cmd. Enter "python" and press Enter. The configuration is successful as shown in the following figure. (If you fail to log out of the computer, you can)
4. Configure cocos2dx3.0 development environment will cocos2d-x-3.0rc0.zip decompress to any path, my is C: \ cocos2d-x-3.0rc0, find setup. py in this directory, directly double-click to run, the following screen appears:
Press enter to log out of the computer. After logging on again, start cmd and enter cocos and press Enter. If the following page appears, the configuration is successful.
Here we can see some basic cocos usage. Let's create a new project. Execute cocos new in cmd to see how to use this command.
For example, to create a project named test under c: \ projects, run the following command: cocos new-p com. kuki. test-l cpp-d c: \ projects test.
Shows the creation process.
After the creation is successful, we can open test. sln under the c: \ projects \ test \ proj. win32 Directory and use VS2012 for development. So far, the development environment in windows has been set up.
2. Build Android compiling environment 1. required tools 1) Android SDK http://developer.android.com/sdk/installing/index.html? Pkg = tools 2) Android NDK http://developer.android.com/tools/sdk/ndk/index.html#Installing 3) Java JDK http://www.oracle.com/technetwork/java/javase/downloads 4) Apache Ant http://ant.apache.org/bindownload.cgi 2. you only need to decompress the environment variables NDK and Ant. After the SDK is decompressed, you need to use SDK Manager.exe to update the Android platform tool you need. Here I put it in the c: \ Android directory, and the JDK installation process is also very simple, one way to next, the installation path is C: \ Program Files \ Java \ jdk1.8.0 _ 11. 1) create a JAVA_HOME variable in the system variable with the value C: \ Program Files \ Java \ jdk1.8.0 _ 11. 2) create a classpath variable with the value :.; % JAVA_HOME % \ lib; % JAVA_HOME % \ lib \ tools. jar (note that ". ", indicating the current Path) 3) add % JAVA_HOME % \ bin in the Path variable; % JAVA_HOME % \ jre \ bin; C: \ Android \ ant \ bin (here we need to modify it based on our own situation) then run setup in the root directory of cocos2dx. py associates with NDK, SDK, and Ant. Enter the path. Here are the c: \ Android \ ndk c: \ Android \ sdk c: \ Android \ ant \ bin (note the bin directory) After configuration is complete, run setup again. py. If shown in, all configurations are correct. In this case, you need to cancel the computer to make the configuration take effect.
Now, the Android compilation environment is configured, and you can finally package the apk! If cpp is added, add the new cpp to the android. mk file of proj. Android/jni. You can use UE instead of notepad. Start cmd, cd to the project directory, execute cocos compile-p android, and start compilation. After compilation, the apk file is in the project path \ bin \ debug \ android directory.

In addition, if an error is prompted during apk Compilation: Android platform not specified, searching a default one... No valid android platform found, will not generate apk.
In this case, you need to add the platform number, for example, cocos run-p android -- ap 19. The specified Android platform version is 19.
For detailed cocos command instructions, see help cocos -- help
Compilation of android programs in windows

The answer is probably that you open the simulator in advance and use it directly.

Build an android compiling environment in Ubuntu 1010

The first floor is nonsense. Do you dare to say that there is not much difference between android compiled from the source code in windows and linux? Are you afraid of thunder?
Why is android an open-source OS? Could you open a source on windows for me to see?
On csdn, I used ubuntu 10.04 to compile the 2.3.3 source code. Of course, if you know linux as 0, you can't do it anymore.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.