Merged
Conversation
I found two issues testing `dotnet run`: * If you have two devices connected, first is an arm64 device, second is x86_64 emulator. ~~ Issue 1 ~~ * The `_ResolveMonoAndroidSdks` MSBuild target sets `$(AdbTarget)` based on `$(Device)` global MSBuild property. * The `_GetPrimaryCpuAbi` MSBuild target runs *first* and doesn't have the correct value for `$(AdbTarget)`! ~~ Issue 2 ~~ In 105d912, I added `Microsoft.Android.Run` project to make `dotnet run` show live `adb logcat` output. Unfortunately, I forgot to add a switch for "adb target", so it did not properly select a device. Added the `--adb-target` switch to fix this.
Member
Author
grendello
approved these changes
Jan 30, 2026
jonathanpeppers
added a commit
that referenced
this pull request
Jan 30, 2026
I found two issues testing `dotnet run`: * If you have two devices connected, first is an arm64 device, second is x86_64 emulator. ~~ Issue 1 ~~ * The `_ResolveMonoAndroidSdks` MSBuild target sets `$(AdbTarget)` based on `$(Device)` global MSBuild property. * The `_GetPrimaryCpuAbi` MSBuild target runs *first* and doesn't have the correct value for `$(AdbTarget)`! ~~ Issue 2 ~~ In 105d912, I added `Microsoft.Android.Run` project to make `dotnet run` show live `adb logcat` output. Unfortunately, I forgot to add a switch for "adb target", so it did not properly select a device. Added the `--adb-target` switch to fix this.
jonathanpeppers
added a commit
that referenced
this pull request
Feb 4, 2026
I found two issues testing `dotnet run`: * If you have two devices connected, first is an arm64 device, second is x86_64 emulator. ~~ Issue 1 ~~ * The `_ResolveMonoAndroidSdks` MSBuild target sets `$(AdbTarget)` based on `$(Device)` global MSBuild property. * The `_GetPrimaryCpuAbi` MSBuild target runs *first* and doesn't have the correct value for `$(AdbTarget)`! ~~ Issue 2 ~~ In 105d912, I added `Microsoft.Android.Run` project to make `dotnet run` show live `adb logcat` output. Unfortunately, I forgot to add a switch for "adb target", so it did not properly select a device. Added the `--adb-target` switch to fix this.
simonrozsival
pushed a commit
that referenced
this pull request
Feb 5, 2026
I found two issues testing `dotnet run`: * If you have two devices connected, first is an arm64 device, second is x86_64 emulator. ~~ Issue 1 ~~ * The `_ResolveMonoAndroidSdks` MSBuild target sets `$(AdbTarget)` based on `$(Device)` global MSBuild property. * The `_GetPrimaryCpuAbi` MSBuild target runs *first* and doesn't have the correct value for `$(AdbTarget)`! ~~ Issue 2 ~~ In 105d912, I added `Microsoft.Android.Run` project to make `dotnet run` show live `adb logcat` output. Unfortunately, I forgot to add a switch for "adb target", so it did not properly select a device. Added the `--adb-target` switch to fix this.
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.

I found two issues testing
dotnet run:Issue 1
The
_ResolveMonoAndroidSdksMSBuild target sets$(AdbTarget)based on$(Device)global MSBuild property.The
_GetPrimaryCpuAbiMSBuild target runs first and doesn't have the correct value for$(AdbTarget)!I fixed this by setting
$(AdbTarget)late during evaluation, inXamarin.Android.Common.targets.Issue 2
In 105d912, I added
Microsoft.Android.Runproject to makedotnet runshow liveadb logcatoutput.Unfortunately, I forgot to add a switch for "adb target", so it did not properly select a device.
Added the
--adb-targetswitch to fix this.