The official Chinese documents provided
Http://cn.cocos2d-x.org/article/index?type=cocos2d-x&url=/doc/cocos-docs-master/manual/framework/native/v2 /getting-started/setting-up-development-environments/linux-environment-setup/ How-to-run-helloworld-and-tests-on-linux/zh.md
Below is a blog written by blogger
http://xuzhiwei.blog.51cto.com/978424/1401434
According to the blog, I'm going to configure the environment, and I'll do it.
Little Brother Development environment is Ubuntu
1 Configuring the Environment
[Email protected]:~$ cd /home/moziqi/software/cocos2d-x-3.5[email protected]:~/software/ cocos2d-x-3.5$ ./start.pybash: ./start.py: does not have that file or directory [email protected]:~/software/ cocos2d-x-3.5$ ./setup.pysetting up cocos2d-x...->check environment variable Cocos_console_root ->search for environment variable cocos_console_root ... ->cocos_console_root not found -> add cocos_ Console_root environment variable... ->added cocos_console_root=/home /moziqi/software/cocos2d-x-3.5/tools/cocos2d-console/bin->check environment variable cocos_ Templates_root ->search for environment variable cocos_templates_root ... ->cocos_templates_root not found -> add cocos_ templates_root environment variable... ->added cocos_templates_root=/home/moziqi/software/cocos2d-x-3.5/ templates->configuration for android platform only, you can also skip and manually edit "/HOME/MOZIQI/.BASHRC"->check environment variable NDK_ROOT ->Search for environment variable NDK_ROOT... ->ndk_root not found ->search for command ndk-build in system... ->command ndk-build not found - >Please enter the path of NDK_ROOT (or press enter to Skip):/home/moziqi/software/android-ndk-r9d -> add ndk_root environment Variable... ->added ndk_root=/home/moziqi/software/android-ndk-r9d->check environment variable android_sdk_root ->search for environment variable android_sdk_root... ->ANDROID_SDK_ROOT not found ->Search for command android in system... ->command android not found ->Please enter the path of ANDROID_SDK_ROOT (Or press enter  TO SKIP):/home/moziqi/software/android-studio/adt-bundle-linux-x86_64-20140702/sdk -> Add ANDROID_SDK_ROOT environment variable... ->Added android_sdk_root=/home/moziqi/software/android-studio/adt-bundle-linux-x86_64-20140702/sdk->check environment variable ant_root ->search for environment variable ant_root... ->ant_root not found ->search for Command ant in system... ->command ant not found ->please enter the path of ant_root (or press enter to skip):/home/moziqi/software/ apache-ant-1.9.4 ->error: "/home/moziqi/software/apache-ant-1.9.4" is not a valid path of ant_root. ignoring it. a backup file "/home/moziqi/.bashrc.backup" is created for "/home/moziqi/. BASHRC ". please execute command: "SOURCE /HOME/MOZIQI/.BASHRC" to make added system variables take effect[email protected]:~/software/cocos2d-x-3.5$ source / home/moziqi/.bashrc[email protected]:~/software/cocos2d-x-3.5$
2. Create a project using COCOS2DX
[Email protected]:~$ cd /home/moziqi/software/cocos2d-x-3.5[email protected]:~/software/ cocos2d-x-3.5$ cocos -h/home/moziqi/software/cocos2d-x-3.5/tools/cocos2d-console/bin/cocos.py 1.5 - cocos console: a command line tool for cocos2d-xavailable commands:run Compiles & deploy project and then runs it on the targetluacompile minifies and/or compiles lua filesdeploy Deploy a project to the targetpackage Manage package for cocoscompile Compiles The current project to binaryframework manage frameworks for the p rojectnew creates a new Projectjscompile minifies and/or compiles js filesavailable arguments:-h, --helpShow this help information-v, --versionShow the version of this command toolexample:/home/moziqi/software/cocos2d-x-3.5/tools/ Cocos2d-console/bin/cocos.py new --help/home/moziqi/software/cocos2d-x-3.5/tools/cocos2d-console/bin /cocos.py run --help[email protected]:~/software/cocos2d-x-3.5$ cocos new - husage: cocos new [-h] [-p package_name] -l {cpp,lua,js} [-d directory] [-t TEMPLATE_NAME] [--ios-bundleid IOS_BUNDLEID] [--mac-bundleid mac_bundleid] [-e engine_path] [--portrait] [--no-native] [project_name] creates a new projectpositional arguments: project_name set the project nameoptional arguments: -h, --help show this help message and exit -p PACKAGE_NAME, --package PACKAGE_NAME set a package name for project -l {cpp,lua,js }, --language {cpp,lua,js} major programming language you want to use, should be [cpp | lua | js] -d directory, --directory directory set generate project directory for project -t template_name, -- template template_name Set the template name You want create from --ios-bundleid ios_bundleid set a bundle id for ios project --mac-bundleid MAC_BUNDLEID set a bundle id for mac project -e engine_path, --engine-path ENGINE_PATH Set the path of cocos2d-x/cocos2d-js engine --portrait Set the project be portrait.lua/js project arguments: --no-native &nbSp; no native support. [Email protected]:~/software/cocos2d-x-3.5$ cocos new -p com.mo.coco -l cpp -d /home/moziqi/software/android-studio-work/cocos2dx test3.5running command: new > Copy template into /home/moziqi/software/android-studio-work/cocos2dx/test3.5> Copying cocos2d-x files...> Rename project name from ' Hellocpp ' to ' test3.5 ' > Replace the project name from ' hellocpp ' to ' test3.5 ' > Replace the project package name from ' Org.cocos2dx.hellocpp ' to ' Com.mo.coco ' > Replace the mac bundle id from ' org.cocos2dx.hellocpp ' to ' Com.mo.coco ' > replace the ios bundle id from ' org.cocos2dx.hellocpp ' to ' Com.mo.coco ' [email protected]:~/software/cocos2d-x-3.5$
Normally run OK, just create a directory for the directory
Android Studio Cocos2d-x Learning, configuring to run