Skip to content

Find Android Studio installations with Spotlight query on macOS - #80475

Merged
fluttergithubbot merged 3 commits into
flutter:masterfrom
jmagman:android-studio-spotlight
Apr 29, 2021
Merged

fluttergithubbot merged 3 commits into
flutter:masterfrom
jmagman:android-studio-spotlight

Conversation

@jmagman

@jmagman jmagman commented Apr 15, 2021 •

Copy link
Copy Markdown
Member

In addition to hard-coded Applications Android Studio install locations, on macOS also query Spotlight (the app search engine when you cmd-space) for all known locations by searching with the command line tool mdfind for the app's bundle identifier (com.google.android.studio or com.google.android.studio-EAP).

Fixes #48568

See also #80477 and #80479

@jmagman jmagman added tool Affects the "flutter" command-line tool. See also t: labels. platform-macos Building on or for macOS specifically t: flutter doctor Problem related to the "flutter doctor" tool labels Apr 15, 2021
@jmagman jmagman self-assigned this Apr 15, 2021
@google-cla google-cla Bot added the cla: yes label Apr 15, 2021

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Missed this during the null safety migration #79504

@jmagman jmagman changed the title Find Android Studio installations with Spotlight query Find Android Studio installations with Spotlight query on macOS Apr 15, 2021
@jmagman
jmagman force-pushed the android-studio-spotlight branch from 2d4f9e1 to 48cad25 Compare April 15, 2021 00:56
@jmagman
jmagman force-pushed the android-studio-spotlight branch from 48cad25 to 9b657a7 Compare April 15, 2021 17:27

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

On real macOS this was failing because it's expecting an mdfind call.

@jmagman
jmagman force-pushed the android-studio-spotlight branch from 9b657a7 to 5cd387d Compare April 15, 2021 23:41

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

does a process exception here get caught? or are we confident mdfind will be present and work?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Added a try.

@christopherfujino christopherfujino left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

platform-macos Building on or for macOS specifically t: flutter doctor Problem related to the "flutter doctor" tool tool Affects the "flutter" command-line tool. See also t: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[!] Android Studio (not installed) , when run flutter doctor while Android Studio installed on machine

3 participants