如何设置cocos2x控制台工具路径?
How to setup cocos2x console tool path?
我在这里设置 cocos2d-x 作为概述:http://www.codeproject.com/Articles/801093/Writing-Games-with-Cplusplus-for-Android-on-a-Mac
Setup.py 具有所有预期的输出,
./setup.py
Setting up cocos2d-x...
->Check environment variable COCOS_CONSOLE_ROOT ->Search for environment variable COCOS_CONSOLE_ROOT...
->COCOS_CONSOLE_ROOT is found : /Users/john/Documents/Projects/Cocos2d/cocos2d-x-3.5/tools/cocos2d-console/bin
->Check environment variable COCOS_TEMPLATES_ROOT ->Search for environment variable COCOS_TEMPLATES_ROOT...
->COCOS_TEMPLATES_ROOT is found : /Users/john/Documents/Projects/Cocos2d/cocos2d-x-3.5/templates
->Configuration for Android platform only, you can also skip and manually edit "/Users/john/.bash_profile"
->Check environment variable NDK_ROOT ->Search for environment variable NDK_ROOT...
->NDK_ROOT is found : /Users/john/Documents/Projects/Android/android-ndk-r9d
->Check environment variable ANDROID_SDK_ROOT ->Search for environment variable ANDROID_SDK_ROOT...
->ANDROID_SDK_ROOT is found : /Users/john/Documents/Projects/Android/adt-bundle-mac-x86_64-20140321/sdk
->Check environment variable ANT_ROOT ->Search for environment variable ANT_ROOT...
->ANT_ROOT is found : /Users/john/Documents/Projects/ANT/apache-ant-1.9.4/bin
Please execute command: "source /Users/john/.bash_profile" to make
added system variables take effect
但我不能直接运行 cocos:
例如:cocos
我总是要输入完整路径:
例如:
/Users/john/Documents/Projects/Cocos2d/cocos2d-x-3.5/tools/cocos2d-console/bin/cocos
因此,我无法 运行 ./build_native.py 等来生成我的 android 构建,因为它会出错:sh: cocos: command not found
我 运行 setup.py 说我应该执行的 "source /Users/john/.bash_profile"
命令,但这没有区别。
我该如何纠正这个问题?
(Cocos2dx 3.5)
编辑:
当我在终端中键入:"export" 时,我找不到任何用于设置环境变量的行:
NDK_ROOT
COCOS_CONSOLE_ROOT
我该如何纠正这个问题?
我手动将 cocos 控制台根目录添加到 bash_profile。
这是我的做法:
在终端中,输入:
open ~/.bash_profile
它将在 TextEdit 中打开。
添加这些行:
export COCOS_CONSOLE_ROOT=/Users/barisatamer/Documents/workspace-game/Engine_Source/cocos2d-x-3.4/tools/cocos2d-console/bin
export PATH=$COCOS_CONSOLE_ROOT:$PATH
我在这里设置 cocos2d-x 作为概述:http://www.codeproject.com/Articles/801093/Writing-Games-with-Cplusplus-for-Android-on-a-Mac
Setup.py 具有所有预期的输出,
./setup.py
Setting up cocos2d-x... ->Check environment variable COCOS_CONSOLE_ROOT ->Search for environment variable COCOS_CONSOLE_ROOT... ->COCOS_CONSOLE_ROOT is found : /Users/john/Documents/Projects/Cocos2d/cocos2d-x-3.5/tools/cocos2d-console/bin
->Check environment variable COCOS_TEMPLATES_ROOT ->Search for environment variable COCOS_TEMPLATES_ROOT... ->COCOS_TEMPLATES_ROOT is found : /Users/john/Documents/Projects/Cocos2d/cocos2d-x-3.5/templates
->Configuration for Android platform only, you can also skip and manually edit "/Users/john/.bash_profile"
->Check environment variable NDK_ROOT ->Search for environment variable NDK_ROOT... ->NDK_ROOT is found : /Users/john/Documents/Projects/Android/android-ndk-r9d
->Check environment variable ANDROID_SDK_ROOT ->Search for environment variable ANDROID_SDK_ROOT... ->ANDROID_SDK_ROOT is found : /Users/john/Documents/Projects/Android/adt-bundle-mac-x86_64-20140321/sdk
->Check environment variable ANT_ROOT ->Search for environment variable ANT_ROOT... ->ANT_ROOT is found : /Users/john/Documents/Projects/ANT/apache-ant-1.9.4/bin
Please execute command: "source /Users/john/.bash_profile" to make added system variables take effect
但我不能直接运行 cocos:
例如:cocos
我总是要输入完整路径: 例如:
/Users/john/Documents/Projects/Cocos2d/cocos2d-x-3.5/tools/cocos2d-console/bin/cocos
因此,我无法 运行 ./build_native.py 等来生成我的 android 构建,因为它会出错:sh: cocos: command not found
我 运行 setup.py 说我应该执行的 "source /Users/john/.bash_profile"
命令,但这没有区别。
我该如何纠正这个问题?
(Cocos2dx 3.5)
编辑:
当我在终端中键入:"export" 时,我找不到任何用于设置环境变量的行:
NDK_ROOT
COCOS_CONSOLE_ROOT
我该如何纠正这个问题?
我手动将 cocos 控制台根目录添加到 bash_profile。
这是我的做法:
在终端中,输入:
open ~/.bash_profile
它将在 TextEdit 中打开。 添加这些行:
export COCOS_CONSOLE_ROOT=/Users/barisatamer/Documents/workspace-game/Engine_Source/cocos2d-x-3.4/tools/cocos2d-console/bin
export PATH=$COCOS_CONSOLE_ROOT:$PATH