Skip to content

Commit

Permalink
fix: set bundle id at the end to make arguments work properly in Devi…
Browse files Browse the repository at this point in the history
…cectl#launchApp (#2366)

* fix: set bundle id at the end to make arguments work properly
  • Loading branch information
KazuCocoa authored Mar 27, 2024
1 parent af7a81e commit 1d3fd28
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/devicectl.js
Original file line number Diff line number Diff line change
Expand Up @@ -271,13 +271,16 @@ export class Devicectl {
terminateExisting = false
} = opts;

const subcommandOptions = [bundleId];
const subcommandOptions = [];
if (terminateExisting) {
subcommandOptions.push('--terminate-existing');
};
if (!_.isEmpty(env)) {
subcommandOptions.push('--environment-variables', JSON.stringify(_.mapValues(env, (v) => _.toString(v))));
};
// The bundle id should be the last to apply arguments properly.
// devicectl command might not raise exception while the order is wrong.
subcommandOptions.push(bundleId);

await this.execute(['device', 'process', 'launch'], { subcommandOptions, asJson: false});
}
Expand Down

0 comments on commit 1d3fd28

Please sign in to comment.