Nazir Doğan Code Blog

Running Cocos2d-js Project on Android and iOS

| Comments

If you created Cocos2d-js native project.(if you dont create yet .pleas follow this link) You can run on Android and OS devices or simulators. Running project so easy

-


cd directory/to/projectName
// its for compiling apps
cocos compile -p ios|mac|android|web
// its for running apps
cocos run -p ios|mac|android


-

 

Simulator Screen Shot 15 Dec 2015 01.29.25

if you get error like  "Can't find iOS target" or "Can't find Mac target" .You can run with code shown  below  for  iOS platform . For this example FirstCocosGame is project name. You must change with your own.

 cocos run  --platform ios  -t FirstCocosGame-mobile

for Mac platform

cocos compile --platform mac -t FirstCocosGame-desktop

Comments