Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion packages/platform-android/src/commands/runAndroid/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ export interface Flags {
port: number;
terminal: string;
jetifier: boolean;
launchPackagerDirectory: string;
}

type AndroidProject = NonNullable<Config['project']['android']>;
Expand Down Expand Up @@ -94,6 +95,7 @@ async function runAndroid(_argv: Array<string>, config: Config, args: Flags) {
startServerInNewWindow(
args.port,
args.terminal,
args.launchPackagerDirectory,
config.reactNativePath,
);
} catch (error) {
Expand Down Expand Up @@ -237,6 +239,7 @@ function installAndLaunchOnDevice(
function startServerInNewWindow(
port: number,
terminal: string,
launchPackagerDirectory: string,
reactNativePath: string,
) {
/**
Expand All @@ -254,8 +257,9 @@ function startServerInNewWindow(
/**
* Set up the `.packager.(env|bat)` file to ensure the packager starts on the right port.
*/

const launchPackagerScript = path.join(
reactNativePath,
launchPackagerDirectory !== '' ? launchPackagerDirectory : reactNativePath,
`scripts/${scriptFile}`,
);

Expand Down Expand Up @@ -323,6 +327,11 @@ export default {
'[DEPRECATED - root is discovered automatically] Override the root directory for the android build (which contains the android directory)',
default: '',
},
{
name: '--launchPackagerDirectory <string>',
description:
'The directory that contains the command and the environment file to launch the packager',
},
{
name: '--variant <string>',
description: "Specify your app's build variant",
Expand Down