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.
-
Open your app project folder in VS Code.
-
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. -
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.
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.
-
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. -
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.
-
The Flutter Inspector page can be opened by clicking the right most icon (🔍) in the Debug toolbar.
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.
-
Start an app in either debug or profile mode using the
flutter-tizen run
command. -
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.
The following resources provide more information on debugging and optimizing Flutter apps.