Skip to content

[Xamarin.Android.Tools.AndroidSdk] Add Android Studio's Android SDK paths#266

Merged
jonathanpeppers merged 1 commit intomainfrom
dev/peppers/android-studio-paths
Jan 21, 2026
Merged

[Xamarin.Android.Tools.AndroidSdk] Add Android Studio's Android SDK paths#266
jonathanpeppers merged 1 commit intomainfrom
dev/peppers/android-studio-paths

Conversation

@jonathanpeppers
Copy link
Member

We already had code looking for this path on macOS:

~/Library/Android/sdk

This is where Android Studio installs its Android SDK. Unfortunately, windows is at %localappdata%\Android\Sdk and we had no code looking for it! I also added a path for Linux.

This will also do a Directory.Exists() check before returning the new paths.

We will also have to probe for these locations last to preserve existing behavior.

…aths

We already had code looking for this path on macOS:

    ~/Library/Android/sdk

This is where Android Studio installs its Android SDK. Unfortunately,
windows is at `%localappdata%\Android\Sdk` and we had no code looking
for it! I also added a path for Linux.

This will also do a `Directory.Exists()` check before returning the
new paths.

We will also have to probe for these locations *last* to preserve
existing behavior.
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds support for detecting Android SDK installations in the default Android Studio locations on Windows and Linux. Previously, only the macOS path was partially supported, and the Windows path was missing entirely.

Changes:

  • Add Android Studio's default SDK path for Windows (%LocalAppData%\Android\Sdk)
  • Add Android Studio's default SDK path for Linux (~/Android/Sdk)
  • Add Directory.Exists() checks before returning SDK paths on Unix systems (macOS and Linux)

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/Xamarin.Android.Tools.AndroidSdk/Sdks/AndroidSdkWindows.cs Adds Windows path for Android Studio SDK as the last entry in the hardcoded paths list
src/Xamarin.Android.Tools.AndroidSdk/Sdks/AndroidSdkUnix.cs Adds Directory.Exists() check for macOS path and adds new Linux SDK path with check and clarifying comments

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@jonathanpeppers jonathanpeppers merged commit fb95edd into main Jan 21, 2026
8 checks passed
@jonathanpeppers jonathanpeppers deleted the dev/peppers/android-studio-paths branch January 21, 2026 17:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants