In certain components, Cocos use different code for JSB (Simulator and Native Mobile) environment and Web environment. That’s why they are different.
Yes, take a look at this.
Depends on what you want to debug. If you want to step through the Obj-C or C++ code underlying Cocos Creator JS, Xcode is useful, just build the project in ‘default’ template and you may do so. If you want to debug the JS scripts, I would suggest using Google Chrome console or VSCode if your game does not support web.