Skip to content

Commit

Permalink
fix: when used with option --port and --deviceId not working on run-a…
Browse files Browse the repository at this point in the history
…ndroid (#1785)
  • Loading branch information
kentakang authored Dec 30, 2022
1 parent 76e8f8b commit dec4a78
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -140,12 +140,19 @@ function runOnSpecificDevice(
if (devices.indexOf(deviceId) !== -1) {
// using '-x lint' in order to ignore linting errors while building the apk
let gradleArgs = ['build', '-x', 'lint'];

if (args.extraParams) {
gradleArgs = [...gradleArgs, ...args.extraParams];
}

if (args.port) {
gradleArgs.push(`-PreactNativeDevServerPort=${args.port}`);
}

if (!args.binaryPath) {
build(gradleArgs, androidProject.sourceDir);
}

installAndLaunchOnDevice(args, deviceId, adbPath, androidProject);
} else {
logger.error(
Expand Down

0 comments on commit dec4a78

Please sign in to comment.