[xabt] Default Java (JDWP) debugging to disabled - #12625
Open
jonathanpeppers wants to merge 1 commit into
Open
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This PR changes the default behavior of the debugging run targets so Java debugging is disabled by default unless explicitly enabled via $(_AndroidAllowJavaDebugging).
Changes:
- Set
$(_AndroidAllowJavaDebugging)default toFalsewhen it is not explicitly provided. - Keep explicit property overrides working by only applying the default when the property is empty.
File summaries
| File | Description |
|---|---|
| src/Xamarin.Android.Build.Debugging.Tasks/Xamarin.Android.Common.Debugging.targets | Changes the default value of $(_AndroidAllowJavaDebugging) in the _Run target property initialization. |
Review details
- Files reviewed: 1/1 changed files
- Comments generated: 1
- Review effort level: Lite
davidnguyen-tech
approved these changes
Sep 1, 2026
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
This is a smaller alternative to #12589 for the pre-runtime Waiting For Debugger race seen in the VS Code MAUI F5 path. The extension launches Android apps through
dotnet build -t:RunwithAndroidAttachDebugger=true. Today,_Rundefaults Java debugging on, which addsam start -D, opens a temporary JDWP connection throughConnectJdwpAsync(), and relies on theAndroid.Debug.waitForDebugger()gate. That JDWP startup sequence can race before the managed runtime is ready.VS Code only needs managed debugging for this scenario. Defaulting
$(_AndroidAllowJavaDebugging)toFalsebypasses the JDWP connection and wait gate entirely, while preserving$(_AndroidAllowJavaDebugging)=Trueas an explicit opt-in.The JDWP path appears to have originated as a workaround for Windows Subsystem for Android, which is now retired. Rather than add more JDWP readiness protocol handling to .NET 11, this keeps the .NET 11 change minimal ahead of removing the obsolete path in .NET 12.
This addresses the pre-runtime wait race only; it does not address the separate post-runtime RemoteCoreCLR EventStream race.
Testing
Xamarin.Android.Common.Debugging.targetsas XML