Problem when changes files in cocos2d-x jsb 2.2.2

Problem when changes files in cocos2d-x jsb 2.2.2
0.0 0


I have a project created with cocos2d-x using javascript, it works perfectly.

So, I created a javascript project using the ‘tools/project-creator/’ .

For default, the project runs a file called ‘cocos2d-jsb.js’ through the following script.


But I want to create another name for this file, like ‘main.js’ to run the script this way


I add the file to xcode, I run the project, the project compile successfully, but I receive the following error:

Cocos2d: JS: :0:can't open main.js: No such file or directory

Any idea how resolve that, I’ll appreciate any help.


Hi, @fabiobh

You need to add your file into build phase of your project, then it can be found: Xcode project -> Build Phases -> Copy Bundle Resources -> add your main.js



Hi @pandamicro

It works for me now, thank you so much for your help!