Skip to content

Commit

Permalink
Update Flipper Debugging docs
Browse files Browse the repository at this point in the history
Summary: Updated "Debugging" page in Flipper docs: added instructions about debugging from Visual Studio Code and Google Chrome.

Reviewed By: mweststrate

Differential Revision: D19578864

fbshipit-source-id: c88c8278feb7c90fe77bde1d883c73079f2147f9
  • Loading branch information
nikoant authored and facebook-github-bot committed Jan 27, 2020
1 parent 31df1db commit 1b3ef5f
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
Binary file added docs/assets/debugging-from-google-chrome.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/debugging-from-vscode.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 16 additions & 0 deletions docs/extending/debugging.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,28 @@ id: debugging
title: Debugging
---

## Built-in Developer Tools

Flipper is built on Electron which itself is built on Chromium. This means we can debug Flipper using Chrome's developer tools. Flipper will also automatically install the React devtools extension allowing you to have better insight into what is going on in your plugin.

You can open the dev tools from the menu with `View` > `Toggle Developer Tools` or pressing ⌥⌘I on a Mac.

In addition to helping you with the JavaScript, the JS console will also display uncaught exceptions thrown from the client plugin in response to Flipper method calls.

## Google Chrome Developer Tools

As an alternative to using built-in Developer Tools you can also attach to the running Flipper instance from Google Chrome Developer Tools. Sometimes this is useful, because the version of Dev Tools in Google Chrome is more recent than the embedded one, and it is possible to easily install additional extensions if required.

To attach the running Flipper instance open new tab in Google Chrome, navigate to "http://localhost:9122" and choose "Flipper" in the opened list.

![Attach From Google Chrome](/docs/assets/debugging-from-google-chrome.png)

## Visual Studio Code

If you prefer to use the same editor for both coding and debugging, you can attach to the running Flipper instance for debugging right from Visual Studio Code. To do this, start Flipper in development mode (`yarn start`), select `Debug and Run` tab in VSCode, and run task `Attach to Running Renderer`. By default this task is set as the first one,so you can just press `F5` to run it.

![Attach From Visual Studio Code](/docs/assets/debugging-from-vscode.png)

## Plugin missing

If a plugin you created is not showing up there might be two potential classes of problems: Either there is a problem on the mobile side or on the desktop side. Understanding where the problem is rooted helps debugging it.
Expand Down

0 comments on commit 1b3ef5f

Please sign in to comment.