you can use Lua debugger tool to debug your lua code
- import wax and mobedebug, like podfile
pod 'wax', :path=>'../../'
pod 'mobdebug', :path=>'../../tools/mobdebug'
- download ZeroBraneStudio
- run ZeroBraneStudio: double click
zbstudio/ZeroBraneStudioorsh zbstudio.sh - import lua code: click the 6th button
, choose your lua code's root directory - start debug server: click Project->Start Debugger Server.
- run this code before you enter debug
wax_start(nil, nil);//must start before debug
extern void luaopen_mobdebug_scripts(void* L);
luaopen_mobdebug_scripts(wax_currentLuaState());
- add
require('mobdebug').start('YOUR_MAC_IP_ADDRESS')to your lua code. if you use simulator'YOUR_MAC_IP_ADDRESS'can be empty - launch your app,when
require('mobdebug').start()is invoked, ZeroBraneStudio's dock will become active, then you should add breakpoint.
step into:
step over:
step out:
run to cursor:
continue:
kill app:
remote console:print variable, or call function
watch:watch some variable
stack:show the lua stack
