From f6445fea43d658299f1cca727e60c290b002d0c7 Mon Sep 17 00:00:00 2001 From: Anton Kastritskiy Date: Tue, 14 Nov 2023 04:29:59 -0800 Subject: [PATCH] Check if Android Studio is installed Summary: Since Android Studio is technically not required, I made this check optional. Though, these steps will gurantee that android env will work for an engineer who opened flipper for the first time Reviewed By: lblasa Differential Revision: D51267272 fbshipit-source-id: f30e58f322ea080b00a27ae86b871df2b39e1bb9 --- .../src/fb-stubs/{ios.tsx => messages.tsx} | 5 ++++ desktop/doctor/src/index.tsx | 26 ++++++++++++++++++- 2 files changed, 30 insertions(+), 1 deletion(-) rename desktop/doctor/src/fb-stubs/{ios.tsx => messages.tsx} (82%) diff --git a/desktop/doctor/src/fb-stubs/ios.tsx b/desktop/doctor/src/fb-stubs/messages.tsx similarity index 82% rename from desktop/doctor/src/fb-stubs/ios.tsx rename to desktop/doctor/src/fb-stubs/messages.tsx index cfa1bdc85..5ef437295 100644 --- a/desktop/doctor/src/fb-stubs/ios.tsx +++ b/desktop/doctor/src/fb-stubs/messages.tsx @@ -15,3 +15,8 @@ export const installXcode = export const installSDK = 'You can install it using Xcode (https://developer.apple.com/xcode/).'; + +export const installAndroidStudio = [ + 'Android Studio is not installed.', + 'Install Android Studio from https://developer.android.com/studio', +].join('\n'); diff --git a/desktop/doctor/src/index.tsx b/desktop/doctor/src/index.tsx index ed7133499..6f433e5b0 100644 --- a/desktop/doctor/src/index.tsx +++ b/desktop/doctor/src/index.tsx @@ -21,7 +21,8 @@ import { getIdbInstallationInstructions, installXcode, installSDK, -} from './fb-stubs/ios'; + installAndroidStudio, +} from './fb-stubs/messages'; import {validateSelectedXcodeVersion} from './fb-stubs/validateSelectedXcodeVersion'; export function getHealthchecks(): FlipperDoctor.Healthchecks { @@ -66,6 +67,29 @@ export function getHealthchecks(): FlipperDoctor.Healthchecks { isRequired: false, isSkipped: false, healthchecks: [ + ...(process.platform === 'darwin' + ? [ + { + key: 'android.android-studio', + label: 'Android Studio Installed', + isRequired: false, + run: async (_: FlipperDoctor.EnvironmentInfo) => { + const hasProblem = !fs.existsSync( + '/Applications/Android Studio.app', + ); + + const message = hasProblem + ? installAndroidStudio + : `Android Studio is installed.`; + + return { + hasProblem, + message, + }; + }, + }, + ] + : []), { key: 'android.sdk', label: 'SDK Installed',