MCPcopy
hub / github.com/ionic-team/capacitor / openAndroid

Function openAndroid

cli/src/android/open.ts:11–31  ·  view source on GitHub ↗
(config: Config)

Source from the content-addressed store, hash-verified

9const debug = Debug('capacitor:android:open');
10
11export async function openAndroid(config: Config): Promise<void> {
12 const androidStudioPath = await config.android.studioPath;
13 const dir = config.android.platformDirAbs;
14
15 try {
16 if (!(await pathExists(androidStudioPath))) {
17 throw new Error(`Android Studio does not exist at: ${androidStudioPath}`);
18 }
19
20 await open(dir, { app: { name: androidStudioPath }, wait: false });
21 logger.info(`Opening Android project at: ${c.strong(config.android.platformDir)}.`);
22 } catch (e) {
23 debug('Error opening Android Studio: %O', e);
24
25 logger.error(
26 'Unable to launch Android Studio. Is it installed?\n' +
27 `Attempted to open Android Studio at: ${c.strong(androidStudioPath)}\n` +
28 `You can configure this with the ${c.input('CAPACITOR_ANDROID_STUDIO_PATH')} environment variable.`,
29 );
30 }
31}

Callers 1

openFunction · 0.90

Calls 3

openFunction · 0.85
infoMethod · 0.80
errorMethod · 0.80

Tested by

no test coverage detected