Starting programs using a launch.json startup configuration in Visual Studio Code

To start KasperskyOS Community Edition using a launch.json startup configuration:

  1. Open the program project directory in Visual Studio Code.
  2. On the side bar of Visual Studio Code, click Run and debug > create a launch.json file and then select KasperskyOS Debugger.

    This will create a debug configuration file named launch.json.

    The created .vscode/launch.json file contains sets of configurations with the following names:

    • (kos/gdb) Attach to process – configuration for connecting to the running process.
    • (kos/gdb) Launch & debug executable – configuration for running the executable file and connecting the debugger to the running process.
    • (kos/gdb) Launch & debug application – configuration for running the program and connecting the debugger to the running process.
    • (kos/gdb) Launch & debug qemu – configuration for running an emulator in debug mode.
    • (kos) Launch executable – configuration for running the executable file.
    • (kos) Launch application – configuration for running the program.
    • (kos) Launch qemu – configuration for running the emulator.
  3. In the created .vscode/launch.json file, find the (kos) Launch application section containing the application startup parameters:

    .vscode/launch.json (fragment)

    {

    "name": "(kos) Launch application",

    "type": "kosgdb",

    "request": "launch-app",

    "app": "app.id",

    "noDebug": "true"

    }

  4. Add the necessary parameters and their values to the found section.

    You can get a list of the available parameters in the tips that appear when you edit the file.

  5. Save the changes to the .vscode/launch.json file.
  6. Start the program:
    1. Return to the Run and debug tab.
    2. In the drop-down list in the upper part of the tab, select the (kos) Launch application startup configuration that you edited.
    3. Click the Build all targets button next to the drop-down list, or press the F5 key.

    Before starting the application, you may need to install the application on the device by using the KOS: Install package command or by setting the parameter preLaunchTask = "true" in the .vscode/launch.json file.

Page top