After setting up the COCOS2DX environment, you can use the Cocos directive to create a new COCOS2DX project, compile and run the COCOS2DX project, etc.
- Let's take a look at the cocos2dx-3.x version of the directory.
- Under this directory, hold down the SHIFT key while you right-click, hold shift+ right mouse button, click here to open the Command window.
- In the command window that opens, enter the COCOS-HELP directive to see all relevant instructions for cocos, such as compiling the directive compile, creating the project Directive new, and so on.
- Enter Cocos Compile-help to see all parameters and Parameters used in the compilation instructions.
- Other Cocos directives can use similar methods to view specific parameters that are available, such as using Cocos new-help to view all the parameters that are available for creating COCOS2DX projects.
- Creating an item with the new command now, you need to put download-deps.py and setup.py in the COCOS2DX project directory first.
- If you have already done this, you will not have to execute the 2 files.
Using Cocos new to create a project, you can refer to the usage in Cocos new-help. More parameters are used as follows:
-P is the package name
-L is a file format with CPP, LUA, JS
-D is the storage path for the new project
Basically, that's all we need.
Enter Cocos new project name –P package name –l cpp–d Path Enter is created successfully for example:
After successful, find this project
- Use the Cocos Compile command to compile the generated hellomytest to build the APK. Note: The previous path is the path to the current project.
After success, you can see
- You can also use the same Cocos compile directive to generate the APK for the test case that comes with the engine.
After success, look at the APK build path.
COCOS2D Learning Notes 2--cocos command-line directives use