Create Cocos2d-x project from Mac terminal in Xcode and Eclipse normal run environment configuration

Source: Internet
Author: User

First, create a project that can run both in Xcode and Eclipse:

1.
Open the Mac terminal, enter the Tools/project-creator in the Cocos2d-x directory, execute the command
./create_project.py-project [Project name]-package [package name]-language [using the language CPP or Java, etc.]
You can then see the newly generated project in the projects in the Cocos2d-x directory.

2. Place the created item in the D:\cocos2d\cocos2d-x-2.1.4\projects directory, if no Projects folder can create a

3. Import Android Project Proj.android

4. Import the Cocos2d-x library file D:\cocos2d\cocos2d-x-2.1.4\cocos2dx\platform\android\java\src the file into the project src directory, refresh the project to see the imported package.

5. Select the SDK for the corresponding device: Select the item, right-select Properties->android, select the SDK version OK to save.

6. The corresponding version information in the Androidmanifest.xml

7. Set environment variable Ndk_module_path: = d:\cocos2d\cocos2d-x-2.1.4;d:\cocos2d\cocos2d-x-2.1.4\cocos2dx\platform\third_party\ Android\prebuilt

8. Set Tool Chain editor:current toolchain = No toolchain; Current builder = Android Builder

9. Jni folder, add:
Windows under
Ndk_module_path: = d:\cocos2d\cocos2d-x-2.1.4;d:\cocos2d\cocos2d-x-2.1.4\cocos2dx\platform\third_party\android\ prebuilt

App_cflags + =-wno-error=format-security

Mac under
Ndk_module_path: =/users/eachbaby3/documents/cocos2d-x/cocos2d-x-2.1.4;/users/eachbaby3/documents/cocos2d-x/ Cocos2d-x-2.1.4/cocos2dx/platform/third_party/android/prebuilt

App_cflags + =-wno-error=format-security
To Application.mk

10. Import the resources from the project resource bundle into the Assets folder and refresh it.

Ii. porting projects completed from Xcode to eclipse (same as above 2-10 steps)

1. Modify the Android.mk file
Add cocos2d Path
$ (call import-add-path,$ (Local_path)/platform/third_party/android/prebuilt)
$ (call Import-add-path,/users/eachbaby3/documents/cocos2d-x/cocos2d-x-2.1.4) \
$ (Call Import-add-path,/users/eachbaby3/documents/cocos2d-x/cocos2d-x-2.1.4/cocos2dx/platform/third_party/ Android/prebuilt) \

My_cpp_list: = $ (wildcard $ (local_path)/*.cpp)
My_cpp_list + = $ (wildcard $ (local_path)/hellocpp/*.cpp)
My_cpp_list + = $ (wildcard $ (local_path)/.. /.. /classes/*.cpp)

Local_src_files: = $ (my_cpp_list:$ (Local_path)/%=%)

2. Modify the main class name of the makefile file

3. Select the General->code analysis mode for use project settings, cancel all selected bugs

Zoom in from 1024 to 960 times 0.9375

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.