The next step is using the
cocos command. It is a cross-platform tool with which you can create a new project, build it, run it, and deploy it. The
cocos command works for all Cocos2d-x supported platforms and you don't need to use an IDE if you don't want to. In this recipe, we take a look at this command and explain how to use it.
cocoscommand help by executing it with the
--helpparameter, as follows:
$ cocos --help
First, we create a new Cocos2d-x project with the
cocos new command, as shown here:
$ cocos new MyGame -p com.example.mygame -l cpp -d ~/Documents/
The result of this command is shown the following screenshot:
new parameter ...