table of Contents
1 Introduction
As a programmer, when writing code breakpoint debugging is very convenient! Easy to find a problem, we believe that every programmer is extremely convenient! Here to share breakpoint debugging method Cocos creator typescript of!
2, Configuration
Make sure before you start that you have cocoscreator, chrome browser installed, visual code three software! Opens creator open a sample project or a self hello world project.
2.1, configuration VsCode environment
Here you can refer to the official configuration, Click here to view the specific configuration .
2.2, VsCode install plug-ins (Debugger for chrome)
VSCode open, meander-shaped cross-click button, as shown, filled directly into Debugger for chrome in the search box and then click the installation.
2.3, set Creator script editor
Double-click inside the creator HelloWorld.js project directory will be opened visual vode (creator Editor File -> Settings -> Data Edit -> External Script Editor needs to be configured to visual code), vsCode Code here is your installation path. exe.
My directory as shown:
2.4, VsCode configuration settings
Click on the button with a worm circled the visual code on the left sidebar, and then the gear button, as shown:
this time there will be several options on the right, select chrome, this time will generate a launch.json file, as shown:
in this case, the editor enters creator complete the configuration developer -> VS code workflow -> Add Chrome Debug configuration, launch.json contents of the above documents will be adapted to look like the following:
2.5, showing the effect of
Here we have configured the! At this time, keep the creator editor opens in the next breakpoint inside the visual code, press F5 to run the project, which started to get stuck into the interface breakpoint (remember to modify the code to run before the first compilation).
3. Conclusion
The End
Well, today's share on here, if inadequacies also hope you correct me in time, feel free to discuss the exchange! ! !
Like friends, please Bangding, thumbs up, comment! You certainly inexhaustible power of my writing!