A live coding command line tool for cocos2d-js / cocos2d-x lua binding!
This tool do the same thing of Cocos Code IDE Live Coding feature.
No more waiting for the game to recompile or re-launch, now you are able to make live modifications to the game and see the real time results.
With this tools you can enjoy this feature freely with any code editor!!!
- Mac OS platform
- cocos2d-js 3.2 runtime or cocos2d-x lua-binding runtime(I didn't test it).
-
Build this project in XCode, it will generate a executable binary.
-
Launch a runtime Cococs2d App. (Runtime feature take effect under debug build by default.)
-
Run this binary in terminal with correct args, for example:
LiveRefresh 127.0.0.1 /your/project/root/folder -
Then, you can use Cocos Console command, such as
fps off、versionor your self custom commands. -
Do some modifications with your code or resources, then type
refreshcommand will check the diff between your project foler on your mac and your app r/w folder on your phone/simulator, and update files then reload. So, you could update your code lively! Enjoy it!!Notice: Every time you modify your code, you need run
refreshcommand to make them take effect.
This just some implementation tips, you can read the source code to check it out.
- Socket connect cocos console port, send/rev console command.
- Socket connect FileServer which defined in
Runtime.cpp, send/write file contents to app. - Use
sendrequestcustom command defined inRuntime.cppreadfileinfo_debug.jsonto check diff.
专为不折腾不舒服斯基们打造,快快试用吧,很cool的!ʅ(‾◡◝)