Skip to content

Latest commit

 

History

History
66 lines (38 loc) · 3.14 KB

debug-app.md

File metadata and controls

66 lines (38 loc) · 3.14 KB

Debugging apps

Debugging in VS Code

You can use VS Code's built-in debugging features to debug Flutter apps running on Tizen devices.

Note: The debugger can only attach to an already running app. Launching an app from VS Code is not currently supported.

  1. Open your app project folder in VS Code.

  2. Start the app in either debug or profile mode from command line (press Ctrl+` to open the integrated Terminal).

    # Start in debug mode (for debugging app code or inspecting UI).
    $ flutter-tizen run
    
    # Start in profile mode (for performance profiling).
    $ flutter-tizen run --profile

    Optional: The --start-paused option can be given to delay app execution until a debug session starts.

  3. Once the app launches, click the Run and Debug icon in the left menu bar, and make sure flutter-tizen: Attach (project) is selected as an active debug configuration.

    Debug configuration

    Note: If you can't find flutter-tizen: Attach (project) in the configuration list, it is likely that the app hasn't launched successfully, or the folder you opened in VS Code is not an app project folder.

  4. Click the Run (▷) button or press F5 to start debugging. It may take a few seconds for a debugger to connect to the running app.

    Connecting

  5. Once the debugger is connected, the Debug toolbar will appear on the top of the editor. You can now debug your code by setting breakpoints and examining variables in the editor (debug mode only). Also, Hot reload will be triggered whenever you make code changes.

    Debug toolbar

  6. The Flutter Inspector page can be opened by clicking the right most icon (🔍) in the Debug toolbar.

    Widget Inspector

    Also, additional DevTools commands become available in the Command Palette (Ctrl+Shift+P) while the debug session is active. DevTools is a suite of performance and debugging tools for Dart and Flutter. For detailed information on DevTools, visit Flutter Docs: DevTools.

    Command palette

Opening DevTools in browser

  1. Start an app in either debug or profile mode using the flutter-tizen run command.

  2. Once the app launches, you will see a message in your terminal that looks like:

    Flutter DevTools, a Flutter debugger and profiler, on Tizen SM-R800 is available at:
    http://127.0.0.1:9100?uri=http%3A%2F%2F127.0.0.1%3A...

    Open your browser and navigate to the URL.

    DevTools

Other resources

The following resources provide more information on debugging and optimizing Flutter apps.