Debug with Cloud Shell Editor

The Cloud Shell Editor allows you to easily debug your application. With the editor's debugging support, you skip manual setup like setting up port forwarding or injecting language-specific debug arguments. You can create launch configurations, set breakpoints, and inspect variables, all in the editor.

Debug actions

To access the Cloud Shell Editor's debugging support, click Debug View icon Debug in the Activity bar. Sample applications come with a launch.json file needed to run and debug your application. If your application doesn't have one, you're prompted in the Debug View to create one.

In the Debug View, start a debugging session by clicking Start Debugging icon Start. When prompted, choose the context to run your app in and, if applicable, the image registry to use.

After your debugging session starts, you can manage it with the Debugging action icons: Pause, Step over, Step in, Step out, Restart, Stop.

Debugging start icon along with pause, step over, step in, step out, restart, and stop icons

Set breakpoints

To set or toggle breakpoints, click in the editor margin next to the line you want to break at. Red circles are active breakpoints and gray circles are inactive breakpoints. If a breakpoint can't be registered with the debugger when a session starts, it changes to a gray-outlined hollow circle.

Setting a breakpoint at line 45

When running a debugging session, the app stops at the breakpoint and you can inspect the Variables panel in the Debug View to inspect variable values as the app is paused.

Debugging session showing app paused at breakpoint and variable values in scope

Additional Kubernetes debugging support

With the Cloud Shell Editor, you can debug Kubernetes applications on a local cluster (like minikube or Docker Desktop) or a remote cluster on GKE or any other Cloud provider. You can also attach a debugger to a Kubernetes pod.

Refer to the Debugging Kubernetes applications using the Cloud Shell Editor guide for more details.