Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to start debug session on the Android emulator when airplane mode is enabled. #9301

Open
MaxxDelusional opened this issue Jul 26, 2024 · 4 comments
Assignees
Labels
Area: Debugger Issues using or interacting with the debugger.

Comments

@MaxxDelusional
Copy link

Description

When I try to debug my Maui Android app in Visual Studio, I am unable to launch the app on the Android emulator when the emulator is in Airplane Mode.

On the emulator, I can see my app launch with the default splashscreen (purple with .Net label), but it never gets past this point. In the debug output, I can see that it stops at this line.

[monodroid-debug] Trying to initialize the debugger with options: --debugger-agent=transport=dt_socket,loglevel=0,address=10.0.2.2:59908,embedding=1,timeout=1722005134

Disabling airplane mode when the app is in this hung state will allow the debugger to continue, and the app will launch as expected.

My Emulator has the following specs:

  • API: 33
  • OS: Android 13.0
  • Processor: x86_64
  • Memory: 1GB
  • Google APIs: Included

Steps to Reproduce

  • Launch the Android Emulator
  • Put the emulator in Airplane mode
  • Create a new .Net MAUI App
  • Set the build target to be the running emulator
  • Press F5 to start a debug session

Expected:

Default (Click me) app to launch on the Android emulator with debugger attached.

Actual:

App launches on Android emulator but is stuck on splash screen.

Link to public reproduction project repository

No response

Version with bug

8.0.61 SR6.1

Is this a regression from previous behavior?

Not sure, did not test other versions

Last version that worked well

Unknown/Other

Affected platforms

Android

Affected platform versions

No response

Did you find any workaround?

Airplane mode can easily be toggled from the ADB command prompt with the following commands.

adb shell cmd connectivity airplane-mode disable
adb shell cmd connectivity airplane-mode enable

This makes it a bit easier to ensure that airplane mode is disabled before debugging, but it's still not a complete solution. The app should be able to launch when airplane mode is disabled.

Relevant log output

No response

Copy link

Hi I'm an AI powered bot that finds similar issues based off the issue title.

Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you!

Closed similar issues:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.

@ninachen03
Copy link

This issue has been verified using Visual Studio 17.11.0 Preview 5 (8.0.70 & 8.0.61 & 8.0.3). Can repro it.

@MaxxDelusional
Copy link
Author

This issue is bigger than I had originally realized.

At first, I thought airplane mode was only preventing the app from launching on the emulator, but with further testing, I can see that the debugger does not work at all when the emulator is in airplane mode.

This makes it impossible to debug offline scenarios using the emulator.

@mattleibow mattleibow transferred this issue from dotnet/maui Sep 12, 2024
@dotnet-policy-service dotnet-policy-service bot added the needs-triage Issues that need to be assigned. label Sep 12, 2024
@jpobst
Copy link
Contributor

jpobst commented Sep 13, 2024

.NET for Android debugging works over networking protocols to establish a connection between the app and the IDE. As such, an active network connection is required.

The only way to debug an offline scenario will be the classic "add logging and read the logs" method.

@jpobst jpobst added Area: Debugger Issues using or interacting with the debugger. and removed needs-triage Issues that need to be assigned. labels Sep 13, 2024
@jpobst jpobst self-assigned this Sep 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Debugger Issues using or interacting with the debugger.
Projects
None yet
Development

No branches or pull requests

3 participants