@swmansion/argent 0.27.1-next.8 → 0.27.1-next.9

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.
@@ -406,6 +406,8 @@ export interface ArgentToolArgs {
406
406
  bundleId: string;
407
407
  /** Android-only: fully-qualified Activity name (e.g. `.MainActivity` or `com.example/com.example.MainActivity`). If omitted on Android, the app's default launcher activity is used. Ignored on iOS / Chromium. */
408
408
  activity?: string;
409
+ /** Apple simulators only: arguments passed to the app process at launch, e.g. `["-FeatureFlag", "YES"]` to override UserDefaults. A running app is relaunched to apply them. Ignored on other targets, including a physical iPhone. */
410
+ launchArgs?: Array<string>;
409
411
  };
410
412
  "list-devices": Record<string, never>;
411
413
  "native-describe-screen": {
@@ -747,6 +749,8 @@ export interface ArgentToolArgs {
747
749
  bundleId: string;
748
750
  /** Android-only: relaunch a non-launcher Activity (e.g. `.SettingsActivity` or `com.example/com.example.SettingsActivity`). If omitted, the app's default launcher activity is used. Ignored on iOS. */
749
751
  activity?: string;
752
+ /** Apple simulators only: arguments passed to the app process at launch, e.g. `["-FeatureFlag", "YES"]` to override UserDefaults. Ignored on other targets, including a physical iPhone. */
753
+ launchArgs?: Array<string>;
750
754
  };
751
755
  rotate: {
752
756
  /** Target device id from `list-devices` (iOS UDID or Android serial). */
@@ -122190,10 +122190,24 @@ function makeIosImpl(registry2) {
122190
122190
  const blocked = await precheckNativeDevtools(nativeDevtools, params.udid);
122191
122191
  if (blocked) return blocked;
122192
122192
  }
122193
+ if (params.launchArgs?.length) {
122194
+ try {
122195
+ await execFileAsync19(
122196
+ "xcrun",
122197
+ await simctlArgsForUdid(params.udid, ["terminate", params.udid, params.bundleId])
122198
+ );
122199
+ } catch {
122200
+ }
122201
+ }
122193
122202
  try {
122194
122203
  await execFileAsync19(
122195
122204
  "xcrun",
122196
- await simctlArgsForUdid(params.udid, ["launch", params.udid, params.bundleId])
122205
+ await simctlArgsForUdid(params.udid, [
122206
+ "launch",
122207
+ params.udid,
122208
+ params.bundleId,
122209
+ ...params.launchArgs ?? []
122210
+ ])
122197
122211
  );
122198
122212
  } catch (err) {
122199
122213
  throw new FailureError(
@@ -122292,8 +122306,14 @@ function buildIosLaunchHandler(backend) {
122292
122306
  return async (services, params) => {
122293
122307
  const blocked = await precheckNativeDevtools(services.nativeDevtools, params.udid);
122294
122308
  if (blocked) return blocked;
122309
+ if (params.launchArgs?.length) {
122310
+ try {
122311
+ await backend.terminate(params.udid, params.bundleId);
122312
+ } catch {
122313
+ }
122314
+ }
122295
122315
  try {
122296
- await backend.launch(params.udid, params.bundleId);
122316
+ await backend.launch(params.udid, params.bundleId, params.launchArgs);
122297
122317
  } catch (err) {
122298
122318
  throw new FailureError(
122299
122319
  `Failed to launch iOS app ${params.bundleId} on ${params.udid}.`,
@@ -122428,6 +122448,9 @@ var zodSchema10 = external_exports.object({
122428
122448
  ),
122429
122449
  activity: external_exports.string().regex(ACTIVITY_PATTERN, "activity may only contain letters, digits, '.', '_', '-' and '/'").optional().describe(
122430
122450
  "Android-only: fully-qualified Activity name (e.g. `.MainActivity` or `com.example/com.example.MainActivity`). If omitted on Android, the app's default launcher activity is used. Ignored on iOS / Chromium."
122451
+ ),
122452
+ launchArgs: external_exports.array(external_exports.string()).optional().describe(
122453
+ 'Apple simulators only: arguments passed to the app process at launch, e.g. `["-FeatureFlag", "YES"]` to override UserDefaults. A running app is relaunched to apply them. Ignored on other targets, including a physical iPhone.'
122431
122454
  )
122432
122455
  });
122433
122456
  var capability2 = {
@@ -122507,7 +122530,10 @@ function makeIosImpl2(registry2) {
122507
122530
  } catch {
122508
122531
  }
122509
122532
  try {
122510
- await execFileAsync20("xcrun", await simctlArgsForUdid(udid, ["launch", udid, bundleId]));
122533
+ await execFileAsync20(
122534
+ "xcrun",
122535
+ await simctlArgsForUdid(udid, ["launch", udid, bundleId, ...params.launchArgs ?? []])
122536
+ );
122511
122537
  } catch (err) {
122512
122538
  throw new FailureError(
122513
122539
  `Failed to restart iOS app ${bundleId} on ${udid}.`,
@@ -122557,7 +122583,7 @@ function buildIosRestartHandler(backend) {
122557
122583
  } catch {
122558
122584
  }
122559
122585
  try {
122560
- await backend.launch(udid, bundleId);
122586
+ await backend.launch(udid, bundleId, params.launchArgs);
122561
122587
  } catch (err) {
122562
122588
  throw new FailureError(
122563
122589
  `Failed to restart iOS app ${bundleId} on ${udid}.`,
@@ -122639,6 +122665,9 @@ var zodSchema11 = external_exports.object({
122639
122665
  bundleId: external_exports.string().min(1).regex(BUNDLE_ID_PATTERN, BUNDLE_ID_MESSAGE).describe("App identifier. iOS: bundle id. Android: package name."),
122640
122666
  activity: external_exports.string().regex(ACTIVITY_PATTERN2, "activity may only contain letters, digits, '.', '_', '-' and '/'").optional().describe(
122641
122667
  "Android-only: relaunch a non-launcher Activity (e.g. `.SettingsActivity` or `com.example/com.example.SettingsActivity`). If omitted, the app's default launcher activity is used. Ignored on iOS."
122668
+ ),
122669
+ launchArgs: external_exports.array(external_exports.string()).optional().describe(
122670
+ 'Apple simulators only: arguments passed to the app process at launch, e.g. `["-FeatureFlag", "YES"]` to override UserDefaults. Ignored on other targets, including a physical iPhone.'
122642
122671
  )
122643
122672
  });
122644
122673
  var capability3 = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@swmansion/argent",
3
- "version": "0.27.1-next.8",
3
+ "version": "0.27.1-next.9",
4
4
  "mcpName": "io.github.software-mansion/argent",
5
5
  "description": "MCP server for iOS Simulator and Android Emulator control",
6
6
  "license": "Apache-2.0",