@capacitor/cli 4.7.1-nightly-20230315T150554.0 → 5.0.0-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Binary file
Binary file
@@ -9,7 +9,7 @@ const common_1 = require("../common");
9
9
  const native_run_1 = require("../util/native-run");
10
10
  const subprocess_1 = require("../util/subprocess");
11
11
  const debug = (0, debug_1.default)('capacitor:android:run');
12
- async function runAndroid(config, { target: selectedTarget, flavor: selectedFlavor }) {
12
+ async function runAndroid(config, { target: selectedTarget, flavor: selectedFlavor, forwardPorts: selectedPorts, }) {
13
13
  var _a;
14
14
  const target = await (0, common_1.promptForPlatformTarget)(await (0, native_run_1.getPlatformTargets)('android'), selectedTarget);
15
15
  const runFlavor = selectedFlavor || ((_a = config.android) === null || _a === void 0 ? void 0 : _a.flavor) || '';
@@ -33,6 +33,9 @@ async function runAndroid(config, { target: selectedTarget, flavor: selectedFlav
33
33
  const apkName = `app${runFlavor !== '' ? '-' + runFlavor : ''}-debug.apk`;
34
34
  const apkPath = (0, path_1.resolve)(pathToApk, apkName);
35
35
  const nativeRunArgs = ['android', '--app', apkPath, '--target', target.id];
36
+ if (selectedPorts) {
37
+ nativeRunArgs.push('--forward', `${selectedPorts}`);
38
+ }
36
39
  debug('Invoking native-run with args: %O', nativeRunArgs);
37
40
  await (0, common_1.runTask)(`Deploying ${colors_1.default.strong(apkName)} to ${colors_1.default.input(target.id)}`, async () => (0, native_run_1.runNativeRun)(nativeRunArgs));
38
41
  }
package/dist/index.js CHANGED
@@ -116,7 +116,8 @@ function runProgram(config) {
116
116
  .allowUnknownOption(true)
117
117
  .option('--target <id>', 'use a specific target')
118
118
  .option('--no-sync', `do not run ${colors_1.default.input('sync')}`)
119
- .action((0, cli_1.wrapAction)((0, telemetry_1.telemetryAction)(config, async (platform, { scheme, flavor, list, target, sync }) => {
119
+ .option('--forwardPorts <port:port>', 'Automatically run "adb reverse" for better live-reloading support')
120
+ .action((0, cli_1.wrapAction)((0, telemetry_1.telemetryAction)(config, async (platform, { scheme, flavor, list, target, sync, forwardPorts }) => {
120
121
  const { runCommand } = await Promise.resolve().then(() => tslib_1.__importStar(require('./tasks/run')));
121
122
  await runCommand(config, platform, {
122
123
  scheme,
@@ -124,6 +125,7 @@ function runProgram(config) {
124
125
  list,
125
126
  target,
126
127
  sync,
128
+ forwardPorts,
127
129
  });
128
130
  })));
129
131
  commander_1.program
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capacitor/cli",
3
- "version": "4.7.1-nightly-20230315T150554.0",
3
+ "version": "5.0.0-alpha.1",
4
4
  "description": "Capacitor: Cross-platform apps with JavaScript and the web",
5
5
  "homepage": "https://capacitorjs.com",
6
6
  "author": "Ionic Team <hi@ionic.io> (https://ionic.io)",
@@ -83,5 +83,5 @@
83
83
  "publishConfig": {
84
84
  "access": "public"
85
85
  },
86
- "gitHead": "f71b6bdcfbfb5c2b681b64c7a2c91cc514f7bba8"
86
+ "gitHead": "76202ca81b8e855df0ef8e5f6a36bd65ed1469a4"
87
87
  }