I've downloaded Cocos2d-x 3.0 rc1 on my Windows machine. I'm trying to figure out how to build and create a new game project. On older versions there was a script. How is it done on Windows with the new version?
I had the same problem, here is how I solved it:
cd cocos2d-x
./setup.py
Close and open the terminal again then:
cocos new MyGame -p com.your_company.mygame -l cpp -d A_FILE_PATH_FOR_YOUR_PROJECT
Related
I am new to Cocos2d and followed the guide for creating a new game on GameFromScratch.com.
What terminal command do I use to create a system specific game such as for Mac or iOS? I'd rather do this so that I don't create a bloated game folder.
Thanks
To run on mac machine, use
cocos run -p mac. And
to create build for mac, first run command cocos compile -p mac and then go to the directory cocos2d-x/build and open and run the xcode project.
The detailed process is provided here
cocos2d-x readme
I use native overlay to load swf on starling but touch didnt work in emulator i want to connect flashdevelop to genymotion or bluestack. how can I do?
Make sure yours PATH environment includes path to /SDK/platforms-tools (or wherever your adb program is)
Then open commandline (terminal or cmd.exe), and run following command
adb install YourAppName.APK
This install flash APK to android virtual machine (as any other APK application package)
I new with cocos2Dx and wanna create game for Android with using C++. I use proj.win32 and don't now how build .apk. Can I do this?
Make entry of your .cpp files in Android.mk that exist in jni folder. Find jni folder inside proj.android project module.
LOCAL_SRC_FILES := hellocpp/main.cpp \
../../Classes/AppDelegate.cpp \
../../Classes/HelloWorldScene.cpp
run this command on console
cocos deploy -s ./projects/MyGame -p andoird -m release
where ./projects/MyGame is your project root folder -m release indicated you want .apk in release mode otherwise use debug
If want some Android related code then first import your project into eclipse then put your Android related code then deploy or even through eclipse you can deploy.
I changed to new versions of Android SDK and NDK.
When I execute the command "cocos run -p android" in any cocos project directory, also a newly created one, then it compiles all sources correctly, but stops trying to build an apk, with the message:
Can't find right android-platform for project : "/Applications/MAMP/htdocs/42words/frameworks/runtime-src/proj.android". The android-platform should be equal/larger than 10
The Env-Variables are set to:
ANDROID_SDK_ROOT=/Applications/adt-bundle-mac-x86_64-20140702
NDK_ROOT=/Applications/android-ndk-r10
ANT_ROOT=/usr/local/Cellar/ant/1.9.3/bin
And they are correct. At
/Applications/adt-bundle-mac-x86_64-20140702/sdk/platforms
there is a android-20 folder. If I call cocos with
cocos run -p android --ap 20
Then the message is
The directory "android-20" can't be found in android SDK
What am I missing?
I had the same problem when I replaced my old copy of the Android SDK with the one from the Cocos Store.
Can't find right android-platform for project : "/Users/CurrentUser/ProjectName/frameworks/runtime-src/proj.android". The android-platform should be equal/larger than 16
Easy fix! Run android found at /android-sdk/tools/android and make sure that the Android version (in this case API 16) is downloaded.
here is my android_sdk_root, you lose /sdk?
export ANDROID_SDK_ROOT=/Project/adt-bundle-mac-x86_64-20131030/sdk
if not this reason, you can find this log in tools/cocos-console/plugins/project_compile/build_android.py
def check_android_platform(self, sdk_root, android_platform, proj_path, auto_select):
if you use python ,it's easy to find the reason by log
To me, the problem can be solve by installing the older version of android sdk. Open your android ndk folder and check for the newest version of the NDK. If it is android-21 for example, then you open AndroidSDK Manager, and install AndroidSDK Build tools 21. After that, try again to run your project.
In addition, depend on your target device, you may also want to install an equivalent Android SDK platform.
I want to install cocos2d-x on my windows8 but i download this "http://bit.ly/18xmkJ9" from "http://cocos2d-x.org/download" in the tutorial says that i must execute a .bat in there or in some other pages says that i neet to create a project in VS, but when i try to do what they say in the tutorial i dont see anithing that is shown.
I'm very lost and help needed.
Could anybody say me hoy to createand start a project on cocos2d?
I have answer the similar question here.
Before cocos2d-x 2.1.2, you can still use templates in VS. However, you can only use python to create project
Install python 2.7
Open command line in Windows
Go to your cocos2d-x-2.1.5\tools\project-creator folder
Run create_project.py. Usage:
create_project.py -project YourProjectName -package com.example.PakcageName -language cpp
-language option:[cpp | lua | javascript]
Your project will be created in cocos2d-x-2.1.5\projects
Then find the win32.proj , open ***.sln