Cocos - How to create a Mac specific game (not iOS) - cocos2d-x

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

Related

is there any way to connect flashdevelop to genymotion or bluestack

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)

Cocos2d-js: “Can’t find right android-platform for project”

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.

Using "cocos run" command with cocos2d-js 3.0alpha on sample js-moonwarrior

I just discovered that the new commandline in cocos2d-js (3.0alpha on OS X 10.9.2) is awsome. With two commands you can create a project and then deploy it on web, android, ios and mac. I tried web and android and it worked instantly.
Then I tried to run the sample game js-moonwarriors which comes together with the framework using
cocos run -p android
from within the project directory. But it stops with the error:
Can't find the projects directories in this project.
No idea. What is missing?
Update: cocos2d-js 3.0alpha2 is out and everything is working fine.
I got an answer to that from cocos2d-x forum:
Hi, this functionality is missing in 3.0 alpha, but tomorrow we will release 3.0 alpha2, and the issue have been solved, you can use cocos command to compile and run js-tests and moon warriors.
Apparently alpha 2 has not been released yet, and I cloned their git branch and it's still not fixed. I suspect it's due to the lack of "framework" directory, so I tried:
ln -s ../../frameworks .
ln -s ~/prj/c2x/cocos2d-js/samples/js-tests/project frameworks/runtime-src
Unfortunately instead of showing samples, it simply shows Hello World. I even did
rgrep . 'Hello World'
And pretty sure the string is not there. Weird.

cocos2d-x 3.0 rc1, create project on Windows

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

How to install cocos2d-x in windows8 and VS2013

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