cancel
Showing results for 
Search instead for 
Did you mean: 
Subscribe

Hello everyone,

I'm facing a persistent issue while trying to debug my SAP MDK application locally on Windows using an Android emulator. The debug session starts correctly and hits breakpoints, but it terminates immediately whenever I type anything in the Debug Console within VS Code. I’d really appreciate help in understanding and resolving this behavior.

In addition to that, when I try to run the "MDK Attach on Android" debug configuration in VS Code, the application is not automatically (re)installed on the emulator with the updated bundle. I need to run the application in "MDK Launch on Android" mode to install the app, which breaks the expected debug flow. I've tried use the both modes to debug.

Debugger Steps

  1. Open the MDK project in Visual Studio Code.

  2. Run the Build Task (Ctrl+Shift+B) to generate the latest metadata.
  3. Start the application using the debug configuration (e.g., “MDK: Debug on Android”).
  4. Set a breakpoint inside a .js rule or action file.
  5. Once the app launches in the Android emulator, the debugger correctly pauses at the breakpoint.
  6. However, as soon as I type any command or expression in the Debug Console, the entire debug session terminates unexpectedly.

This makes it impossible to inspect variables or evaluate expressions dynamically during debugging.

Development Environment

  • Operation System: Windows 11 Pro Edition x64
  • Version: 24H2
  • SO Compilation: 26100.4770
  • Android SDK 35
  • Android SDK Build-tools 35.0.1
  • Java development Kit 17.0.14
  • Node 20.19.0
  • Native Script 8.9.2
  • Android Studio + SDK installed and configured
  • VS Code + MDK Extension  installed and configured

Steps Taken

  1. Installed the MDK SDK locally and executed create-client.cmd to generate the project.
  2. Verified environment variables:
    - ANDROID_HOME
    - JAVA_HOME
  3. Ran `tns doctor` successfully (no errors).
  4. Started the project using the SAP MDK VS Code extension
  5. The app launches on the emulator and hits the debugger line inside a .js script.
 

What I've Already Tried

  • Updated and adjusted launch.json with different "trace", "sourceMaps", and "watch" settings.

  • Reinstalled NativeScript CLI and Android SDKs.
  • Tried running VS Code in both Admin and normal modes.
  • Updated all VS Code extensions.
  • Tested with different emulators (x86, x86_64).

 

0 Likes
View Entire Topic
Chris1973
Active Contributor

Hi @jfreitas91 

Thank you for the details provided.

Following our investigation into the debugging issues with SAP MDK on Windows and Android emulators, here is a quick summary:

Debug Console Crash

This is a known limitation. The Debug Console doesn’t support dynamic input during paused breakpoints in MDK/NativeScript apps. Debugging should be done using breakpoints, variable inspection, and console.log outputs.

Attach Mode Not Reinstalling App

This is by design. The Attach mode is only for connecting to a running app and won’t trigger a reinstall. You should use MDK Launch on Android to deploy updates.

Here are our recommendations:

Ensure you

Ensure you use MDK Launch on Android for deployment and debugging combined.

Ensure to avoid entering commands into the Debug Console. Instead use logging and variable inspection tools instead.

Then, consider raising an SAP support ticket if dynamic evaluation in the Debug Console is critical to your workflow. As of now, it’s not officially supported.

I hope this gives clarity. I am happy to help if you have further questions.

If you find my response helpful, kindly accept the answer and award a Kudos to this post. Your support is appreciated.

Best regards

Chris

jfreitas91
Explorer
0 Likes
Do you know if this issue occurs only on Windows or also on macOS?