Skip to content

fix: detect renamed and multiple Android Studio installations on macOS - #304

Open
AsteriskZuo wants to merge 1 commit into
tabrindle:mainfrom
AsteriskZuo:main
Open

fix: detect renamed and multiple Android Studio installations on macOS#304
AsteriskZuo wants to merge 1 commit into
tabrindle:mainfrom
AsteriskZuo:main

Conversation

@AsteriskZuo

@AsteriskZuo AsteriskZuo commented Aug 31, 2026

Copy link
Copy Markdown
  ## Problem

  On macOS, Android Studio is detected by checking 4 hardcoded paths that all
  require the app bundle to be named exactly `Android Studio.app`
  (`/Applications`, `~/Applications`, and the two JetBrains Toolbox locations).

  Renaming the app — a common practice when keeping multiple versions side by
  side, e.g. `Android Studio 2022.app` and `Android Studio.2025.2.2.app` —
  makes detection fail with "Not Found", and `npx react-native doctor` reports
  Android Studio as missing even though it is installed and fully working.
  (Same class of problem reported on other platforms: #211, #250, #258.)

  Notably, envinfo already has a robust Spotlight-based lookup
  (`mdfind kMDItemCFBundleIdentifier=='...'`) used by IntelliJ, PhpStorm and
  WebStorm — Android Studio is the only JetBrains IDE still using hardcoded
  paths. Additionally, `findDarwinApplication` breaks when mdfind returns
  multiple matches: it escapes the whole multi-line output into a single
  garbage path.

  ## Fix

  - Look up Android Studio via Spotlight by bundle identifier
    `com.google.android.studio`, which finds renamed apps, custom install
    locations and Toolbox installs.
  - When Spotlight has no index yet, fall back to the existing hardcoded paths.
  - When multiple versions are installed, report the newest one (numeric
    segment comparison).

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.

1 participant