[[["わかりやすい","easyToUnderstand","thumb-up"],["問題の解決に役立った","solvedMyProblem","thumb-up"],["その他","otherUp","thumb-up"]],[["わかりにくい","hardToUnderstand","thumb-down"],["情報またはサンプルコードが不正確","incorrectInformationOrSampleCode","thumb-down"],["必要な情報 / サンプルがない","missingTheInformationSamplesINeed","thumb-down"],["翻訳に関する問題","translationIssue","thumb-down"],["その他","otherDown","thumb-down"]],["最終更新日 2025-09-04 UTC。"],[[["\u003cp\u003eCloud Code's watch mode allows for rapid application changes during development or debugging, offering a faster feedback loop in Kubernetes and emulated Cloud Run sessions.\u003c/p\u003e\n"],["\u003cp\u003eWatch mode can be set to "On demand," where manual triggering is required via the "Trigger Build and Deploy" button or specified keyboard shortcuts, or "On file save" for automatic rebuilds and redeploys when changes are saved, though the latter is unavailable in debug mode.\u003c/p\u003e\n"],["\u003cp\u003eThe "Trigger Build and Deploy" function, which defaults to \u003ccode\u003eOption+Cmd+Comma\u003c/code\u003e on Mac OS and \u003ccode\u003eCtrl+Alt+Comma\u003c/code\u003e on Windows, can have custom key bindings configured in the IDE's Keymap settings.\u003c/p\u003e\n"],["\u003cp\u003eWhen debugging with "On demand" mode, triggering a rebuild and redeploy will terminate and reattach the debugger, and a prompt will appear to confirm this action before proceeding.\u003c/p\u003e\n"],["\u003cp\u003eUsing watch mode, a developer can fix a bug during a debug session, trigger a rebuild and redeployment, then reattach the debugger to verify changes without restarting the application manually.\u003c/p\u003e\n"]]],[],null,["# Watch modes in Cloud Code for IntelliJ\n\nCloud Code allows you to quickly apply changes to your application during\na development or debug session for a faster feedback loop. This lets you run your Kubernetes and\nemulated Cloud Run sessions in *watch mode*.\n\nTo learn more about how deployment works, please see the\n[Skaffold documentation.](https://skaffold.dev/docs/workflows/dev/#file-watcher-and-watch-modes)\n\nSettings for Kubernetes and Cloud Run configurations\n----------------------------------------------------\n\nYou can configure watch mode in the Cloud Code Kubernetes and Cloud Run configurations at **Run** \\\u003e **Edit configurations** on the **Run** tab:\n\n### Customizing the Trigger Build and Deploy keymap\n\nThe default key bindings for **Trigger Build and Deploy** are:\n\n- Mac OS: `Option+Cmd+Comma`\n- Windows: `Ctrl+Alt+Comma`\n\nTo change the default key bindings:\n\n1. Navigate to **Preferences** \\\u003e **Keymap**.\n2. In the Keymap search bar, enter \"trigger build and deploy\".\n3. Right-click the Trigger Build and Deploy search result and select **Add Keyboard Shortcut**.\n4. Enter shortcut combination you prefer (for example, `Shift+R`) and click **OK** , then click **OK** in the Preferences window. This adds your new key binding to the Trigger Build and Deploy function, so that both the default and your new key binding will work.\n5. You can also remove the default key binding by right-clicking the Trigger Build and Deploy search result and selecting the **Remove** option.\n\nApplying changes while debugging\n--------------------------------\n\nWith Cloud Code, you can debug an application while making changes to, and\niterating on, source code. This is available for Kubernetes development and Cloud Run local\ndevelopment.\n| **Note:** Certain runtimes support other modes of live updating; for example, Java and HotSwap over JDWP. HotSwap, while limited by the types of changes supported, maintains your debugger state. This design, which operates over [Skaffold](/skaffold) debug, assumes the debugger will be destroyed and reattached on change. These other modes of updating code will continue to be supported independently.\n\nTo apply changes to your code while debugging, perform the following:\n\n1. Ensure On-demand mode is enabled in **Run** \\\u003e **Edit Configurations** (the default option).\n2. Launch the run configuration in debug mode by clicking **Debug**.\n\n### Common use case\n\nThis section outlines a common scenario of how you can debug with watch mode enabled in your IDE.\n\n\n#### Debugging a Kubernetes application with watch mode enabled\n\nYou're a developer building an application that runs on Kubernetes, and use Cloud Code to iterate on your app. You discovered a bug in your code.\n\n1. You launch the Develop on Kubernetes run configuration, and:\n 1. Select **On demand** to rebuild and redeploy the app.\n 2. Launch the run configuration in debug mode by clicking **Debug**.\n2. You set a breakpoint near the expected bug, launch the app, and use the debugger to figure out what the bug is.\n3. You fix the bug while the development session is still running (the debugger is still attached). You now want to confirm that the issue is fixed.\n4. You trigger On-demand mode which tells Cloud Code and [Skaffold](/skaffold) to rebuild and redeploy the application, by clicking **Trigger Build and Deploy** or pressing `Option+Cmd+Comma` on Mac OS or `Ctrl+Alt+Comma` on Windows (the default key bindings).\n5. A notification appears and asks you to confirm: \"Redeploying your changes will cause the debugger to be stopped and reattached, potentially losing your current debug state\". You have the option to either cancel, continue, or to never be notified again.\n6. After clicking **continue**:\n - The debugger is terminated\n - The application is rebuilt and redeployed\n - The debugger is reattached\n7. You can now verify the changes and debug again as needed.\n\nGet support\n-----------\n\nTo submit feedback or report an issue in your IntelliJ IDE, go to **Tools** \\\u003e **Cloud Code** \\\u003e **Help / About** \\\u003e **Submit\nfeedback or report an issue** to report an issue on [GitHub](https://github.com/GoogleCloudPlatform/cloud-code-intellij/issues)."]]