LoginSignup
22
20

More than 5 years have passed since last update.

VisualStudioCodeでElectronデバッグメモ

Last updated at Posted at 2015-12-10

VisualStudioCodeのデバッグ

このへんの記事を見て気づいたのだが、

Creating Desktop Applications With AngularJS and GitHub Electron
https://hansrwindhoff.wordpress.com/2015/05/05/debugging-task-runner-tasks-like-gulp-with-visual-studio-code-editordebugger/

Debugging task runner tasks (like Gulp) with Visual Studio Code editor/debugger
https://hansrwindhoff.wordpress.com/2015/05/05/debugging-task-runner-tasks-like-gulp-with-visual-studio-code-editordebugger/

VisualStudioCodeは今のところ(Ver 0.10.3)、Node.js と C# mono のデバッグができる。
で、Electronについてだが、Node.js同様に、--debug を付けることによってデバッグモードで起動するっぽい。

手順

  1. Electronアプリを $ electron --debug ./ と、デバッグモードで起動しておく。
  2. VisualStudioCode で、appフォルダを開く。
  3. 左ペインから、デバッグを選択し、設定を押す。Node.jsを選択し、launch.jsonを作成する。
  4. Attachを選択して起動すると、既に起動済みのElectronアプリと連携する。

ちなみに連携できるのはメインプロセス側で、フロントのBrowserWindow側プロセス(JavaScript)とは連携しない。
メインプロセス側処理はremoteで呼び出せるのだけど、利用方法としてはやや限定的かも。

22
20
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
22
20