@swmansion/argent 0.34.1-next.19 → 0.34.1-next.20

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.
package/dist/cli-cmds.mjs CHANGED
@@ -10705,6 +10705,32 @@ var FAILURE_CODES = {
10705
10705
  NATIVE_PROFILER_PERFETTO_PROCESS_ERROR: "NATIVE_PROFILER_PERFETTO_PROCESS_ERROR",
10706
10706
  NATIVE_PROFILER_PERFETTO_READY_TIMEOUT: "NATIVE_PROFILER_PERFETTO_READY_TIMEOUT",
10707
10707
  NATIVE_PROFILER_PERFETTO_READY_EXITED: "NATIVE_PROFILER_PERFETTO_READY_EXITED",
10708
+ /**
10709
+ * native-profiler-launch-analysis. Input problems use TOOL_INPUT_INVALID and
10710
+ * devicectl steps IOS_DEVICECTL_COMMAND_FAILED.
10711
+ * @see [workflow.ts](../../tool-server/src/utils/ios-launch-time/workflow.ts)
10712
+ */
10713
+ // Not macOS, or an Xcode that cannot record the launch on this target.
10714
+ LAUNCH_ANALYSIS_UNSUPPORTED_HOST: "LAUNCH_ANALYSIS_UNSUPPORTED_HOST",
10715
+ // No usable iPhone or simulator was selected, or Argent's runner holds it.
10716
+ LAUNCH_ANALYSIS_DEVICE_UNAVAILABLE: "LAUNCH_ANALYSIS_DEVICE_UNAVAILABLE",
10717
+ // The bundle_id app is not installed on the selected device.
10718
+ LAUNCH_ANALYSIS_APP_NOT_INSTALLED: "LAUNCH_ANALYSIS_APP_NOT_INSTALLED",
10719
+ // The runner's xcodebuild failed on code signing or provisioning.
10720
+ LAUNCH_ANALYSIS_SIGNING_FAILED: "LAUNCH_ANALYSIS_SIGNING_FAILED",
10721
+ // The iPhone's free developer profile has no slot for Argent's runner.
10722
+ LAUNCH_ANALYSIS_FREE_PROFILE_LIMIT: "LAUNCH_ANALYSIS_FREE_PROFILE_LIMIT",
10723
+ // simctl could not wait for boot, find, launch or terminate the app.
10724
+ LAUNCH_ANALYSIS_SIMCTL_FAILED: "LAUNCH_ANALYSIS_SIMCTL_FAILED",
10725
+ LAUNCH_ANALYSIS_RECORD_FAILED: "LAUNCH_ANALYSIS_RECORD_FAILED",
10726
+ // xctrace could not export the TOC, the CPU samples or the first-frame marker.
10727
+ LAUNCH_ANALYSIS_EXPORT_FAILED: "LAUNCH_ANALYSIS_EXPORT_FAILED",
10728
+ // The App Launch trace has no first frame of the app, so it has no launch window.
10729
+ LAUNCH_ANALYSIS_NO_FIRST_FRAME: "LAUNCH_ANALYSIS_NO_FIRST_FRAME",
10730
+ // The XCTest launch run of Argent's runner failed.
10731
+ LAUNCH_ANALYSIS_RUNNER_TEST_FAILED: "LAUNCH_ANALYSIS_RUNNER_TEST_FAILED",
10732
+ // The launch test ran, but Argent read no launch measurements from its result.
10733
+ LAUNCH_ANALYSIS_NO_SAMPLES: "LAUNCH_ANALYSIS_NO_SAMPLES",
10708
10734
  // iOS and Android share one capture path (simulator-server frames into
10709
10735
  // ffmpeg), so these name the failing stage, not the device family.
10710
10736
  SCREEN_RECORDING_FACTORY_OPTIONS_MISSING: "SCREEN_RECORDING_FACTORY_OPTIONS_MISSING",
@@ -10859,7 +10885,9 @@ var FAILURE_COMMANDS = [
10859
10885
  "npx",
10860
10886
  "unknown",
10861
10887
  "devicectl",
10862
- "xcodebuild"
10888
+ "xcodebuild",
10889
+ // `xcrun xcresulttool`, which reads an XCTest result bundle.
10890
+ "xcresulttool"
10863
10891
  ];
10864
10892
  var FAILURE_SIGNAL_NAMES = [
10865
10893
  "SIGABRT",
@@ -36082,7 +36110,7 @@ var _CI_VENDOR_COUNT_FOR_TEST = vendors_default.length;
36082
36110
  var SESSION_ID2 = randomUUID5();
36083
36111
  function readCliVersion() {
36084
36112
  if (true) {
36085
- return "0.34.1-next.18";
36113
+ return "0.34.1-next.20";
36086
36114
  }
36087
36115
  return "0.0.0";
36088
36116
  }
package/dist/client.js CHANGED
@@ -9278,6 +9278,32 @@ var FAILURE_CODES = {
9278
9278
  NATIVE_PROFILER_PERFETTO_PROCESS_ERROR: "NATIVE_PROFILER_PERFETTO_PROCESS_ERROR",
9279
9279
  NATIVE_PROFILER_PERFETTO_READY_TIMEOUT: "NATIVE_PROFILER_PERFETTO_READY_TIMEOUT",
9280
9280
  NATIVE_PROFILER_PERFETTO_READY_EXITED: "NATIVE_PROFILER_PERFETTO_READY_EXITED",
9281
+ /**
9282
+ * native-profiler-launch-analysis. Input problems use TOOL_INPUT_INVALID and
9283
+ * devicectl steps IOS_DEVICECTL_COMMAND_FAILED.
9284
+ * @see [workflow.ts](../../tool-server/src/utils/ios-launch-time/workflow.ts)
9285
+ */
9286
+ // Not macOS, or an Xcode that cannot record the launch on this target.
9287
+ LAUNCH_ANALYSIS_UNSUPPORTED_HOST: "LAUNCH_ANALYSIS_UNSUPPORTED_HOST",
9288
+ // No usable iPhone or simulator was selected, or Argent's runner holds it.
9289
+ LAUNCH_ANALYSIS_DEVICE_UNAVAILABLE: "LAUNCH_ANALYSIS_DEVICE_UNAVAILABLE",
9290
+ // The bundle_id app is not installed on the selected device.
9291
+ LAUNCH_ANALYSIS_APP_NOT_INSTALLED: "LAUNCH_ANALYSIS_APP_NOT_INSTALLED",
9292
+ // The runner's xcodebuild failed on code signing or provisioning.
9293
+ LAUNCH_ANALYSIS_SIGNING_FAILED: "LAUNCH_ANALYSIS_SIGNING_FAILED",
9294
+ // The iPhone's free developer profile has no slot for Argent's runner.
9295
+ LAUNCH_ANALYSIS_FREE_PROFILE_LIMIT: "LAUNCH_ANALYSIS_FREE_PROFILE_LIMIT",
9296
+ // simctl could not wait for boot, find, launch or terminate the app.
9297
+ LAUNCH_ANALYSIS_SIMCTL_FAILED: "LAUNCH_ANALYSIS_SIMCTL_FAILED",
9298
+ LAUNCH_ANALYSIS_RECORD_FAILED: "LAUNCH_ANALYSIS_RECORD_FAILED",
9299
+ // xctrace could not export the TOC, the CPU samples or the first-frame marker.
9300
+ LAUNCH_ANALYSIS_EXPORT_FAILED: "LAUNCH_ANALYSIS_EXPORT_FAILED",
9301
+ // The App Launch trace has no first frame of the app, so it has no launch window.
9302
+ LAUNCH_ANALYSIS_NO_FIRST_FRAME: "LAUNCH_ANALYSIS_NO_FIRST_FRAME",
9303
+ // The XCTest launch run of Argent's runner failed.
9304
+ LAUNCH_ANALYSIS_RUNNER_TEST_FAILED: "LAUNCH_ANALYSIS_RUNNER_TEST_FAILED",
9305
+ // The launch test ran, but Argent read no launch measurements from its result.
9306
+ LAUNCH_ANALYSIS_NO_SAMPLES: "LAUNCH_ANALYSIS_NO_SAMPLES",
9281
9307
  // iOS and Android share one capture path (simulator-server frames into
9282
9308
  // ffmpeg), so these name the failing stage, not the device family.
9283
9309
  SCREEN_RECORDING_FACTORY_OPTIONS_MISSING: "SCREEN_RECORDING_FACTORY_OPTIONS_MISSING",
@@ -15928,6 +15928,32 @@ var FAILURE_CODES = {
15928
15928
  NATIVE_PROFILER_PERFETTO_PROCESS_ERROR: "NATIVE_PROFILER_PERFETTO_PROCESS_ERROR",
15929
15929
  NATIVE_PROFILER_PERFETTO_READY_TIMEOUT: "NATIVE_PROFILER_PERFETTO_READY_TIMEOUT",
15930
15930
  NATIVE_PROFILER_PERFETTO_READY_EXITED: "NATIVE_PROFILER_PERFETTO_READY_EXITED",
15931
+ /**
15932
+ * native-profiler-launch-analysis. Input problems use TOOL_INPUT_INVALID and
15933
+ * devicectl steps IOS_DEVICECTL_COMMAND_FAILED.
15934
+ * @see [workflow.ts](../../tool-server/src/utils/ios-launch-time/workflow.ts)
15935
+ */
15936
+ // Not macOS, or an Xcode that cannot record the launch on this target.
15937
+ LAUNCH_ANALYSIS_UNSUPPORTED_HOST: "LAUNCH_ANALYSIS_UNSUPPORTED_HOST",
15938
+ // No usable iPhone or simulator was selected, or Argent's runner holds it.
15939
+ LAUNCH_ANALYSIS_DEVICE_UNAVAILABLE: "LAUNCH_ANALYSIS_DEVICE_UNAVAILABLE",
15940
+ // The bundle_id app is not installed on the selected device.
15941
+ LAUNCH_ANALYSIS_APP_NOT_INSTALLED: "LAUNCH_ANALYSIS_APP_NOT_INSTALLED",
15942
+ // The runner's xcodebuild failed on code signing or provisioning.
15943
+ LAUNCH_ANALYSIS_SIGNING_FAILED: "LAUNCH_ANALYSIS_SIGNING_FAILED",
15944
+ // The iPhone's free developer profile has no slot for Argent's runner.
15945
+ LAUNCH_ANALYSIS_FREE_PROFILE_LIMIT: "LAUNCH_ANALYSIS_FREE_PROFILE_LIMIT",
15946
+ // simctl could not wait for boot, find, launch or terminate the app.
15947
+ LAUNCH_ANALYSIS_SIMCTL_FAILED: "LAUNCH_ANALYSIS_SIMCTL_FAILED",
15948
+ LAUNCH_ANALYSIS_RECORD_FAILED: "LAUNCH_ANALYSIS_RECORD_FAILED",
15949
+ // xctrace could not export the TOC, the CPU samples or the first-frame marker.
15950
+ LAUNCH_ANALYSIS_EXPORT_FAILED: "LAUNCH_ANALYSIS_EXPORT_FAILED",
15951
+ // The App Launch trace has no first frame of the app, so it has no launch window.
15952
+ LAUNCH_ANALYSIS_NO_FIRST_FRAME: "LAUNCH_ANALYSIS_NO_FIRST_FRAME",
15953
+ // The XCTest launch run of Argent's runner failed.
15954
+ LAUNCH_ANALYSIS_RUNNER_TEST_FAILED: "LAUNCH_ANALYSIS_RUNNER_TEST_FAILED",
15955
+ // The launch test ran, but Argent read no launch measurements from its result.
15956
+ LAUNCH_ANALYSIS_NO_SAMPLES: "LAUNCH_ANALYSIS_NO_SAMPLES",
15931
15957
  // iOS and Android share one capture path (simulator-server frames into
15932
15958
  // ffmpeg), so these name the failing stage, not the device family.
15933
15959
  SCREEN_RECORDING_FACTORY_OPTIONS_MISSING: "SCREEN_RECORDING_FACTORY_OPTIONS_MISSING",
@@ -16082,7 +16108,9 @@ var FAILURE_COMMANDS = [
16082
16108
  "npx",
16083
16109
  "unknown",
16084
16110
  "devicectl",
16085
- "xcodebuild"
16111
+ "xcodebuild",
16112
+ // `xcrun xcresulttool`, which reads an XCTest result bundle.
16113
+ "xcresulttool"
16086
16114
  ];
16087
16115
  var FAILURE_SIGNAL_NAMES = [
16088
16116
  "SIGABRT",
@@ -16881,7 +16909,7 @@ var _CI_VENDOR_COUNT_FOR_TEST = vendors_default.length;
16881
16909
  var SESSION_ID = randomUUID4();
16882
16910
  function readCliVersion() {
16883
16911
  if (true) {
16884
- return "0.34.1-next.18";
16912
+ return "0.34.1-next.20";
16885
16913
  }
16886
16914
  return "0.0.0";
16887
16915
  }
@@ -0,0 +1,21 @@
1
+ import XCTest
2
+
3
+ final class ArgentLaunchPerformanceTests: XCTestCase {
4
+ func testLaunchDuration() {
5
+ guard let bundleID = ProcessInfo.processInfo.environment["ARGENT_LAUNCH_BUNDLE_ID"],
6
+ !bundleID.isEmpty
7
+ else {
8
+ XCTFail("Set TEST_RUNNER_ARGENT_LAUNCH_BUNDLE_ID to the installed app's bundle ID.")
9
+ return
10
+ }
11
+
12
+ let options = XCTMeasureOptions()
13
+ // Must match LAUNCH_ITERATIONS in native-profiler/launch-analysis/measure.ts.
14
+ options.iterationCount = 5
15
+ let app = XCUIApplication(bundleIdentifier: bundleID)
16
+
17
+ measure(metrics: [XCTApplicationLaunchMetric()], options: options) {
18
+ app.launch()
19
+ }
20
+ }
21
+ }
@@ -3,11 +3,15 @@ import XCTest
3
3
 
4
4
  extension DeviceButton {
5
5
  /// The XCUIDevice member for this wire name.
6
- var hardwareButton: XCUIDevice.Button {
6
+ var hardwareButton: XCUIDevice.Button? {
7
7
  switch self {
8
8
  case .home: return .home
9
+ #if targetEnvironment(simulator)
10
+ case .volumeUp, .volumeDown: return nil
11
+ #else
9
12
  case .volumeUp: return .volumeUp
10
13
  case .volumeDown: return .volumeDown
14
+ #endif
11
15
  case .actionButton: return .action
12
16
  }
13
17
  }
@@ -191,7 +195,9 @@ extension ArgentRunnerSession {
191
195
 
192
196
  // press on an absent button is a silent no-op that would read as a
193
197
  // successful press, so it is refused up front.
194
- guard device.hasHardwareButton(button.hardwareButton) else {
198
+ guard let hardwareButton = button.hardwareButton,
199
+ device.hasHardwareButton(hardwareButton)
200
+ else {
195
201
  return .failure(
196
202
  .unsupportedOperation,
197
203
  "this \(UIDevice.current.model) has no \(button.rawValue) button",
@@ -200,7 +206,7 @@ extension ArgentRunnerSession {
200
206
  )
201
207
  }
202
208
 
203
- device.press(button.hardwareButton)
209
+ device.press(hardwareButton)
204
210
 
205
211
  return .success(MessagePayload(message: "pressed \(button.rawValue)"))
206
212
  }
@@ -25988,6 +25988,32 @@ var FAILURE_CODES = {
25988
25988
  NATIVE_PROFILER_PERFETTO_PROCESS_ERROR: "NATIVE_PROFILER_PERFETTO_PROCESS_ERROR",
25989
25989
  NATIVE_PROFILER_PERFETTO_READY_TIMEOUT: "NATIVE_PROFILER_PERFETTO_READY_TIMEOUT",
25990
25990
  NATIVE_PROFILER_PERFETTO_READY_EXITED: "NATIVE_PROFILER_PERFETTO_READY_EXITED",
25991
+ /**
25992
+ * native-profiler-launch-analysis. Input problems use TOOL_INPUT_INVALID and
25993
+ * devicectl steps IOS_DEVICECTL_COMMAND_FAILED.
25994
+ * @see [workflow.ts](../../tool-server/src/utils/ios-launch-time/workflow.ts)
25995
+ */
25996
+ // Not macOS, or an Xcode that cannot record the launch on this target.
25997
+ LAUNCH_ANALYSIS_UNSUPPORTED_HOST: "LAUNCH_ANALYSIS_UNSUPPORTED_HOST",
25998
+ // No usable iPhone or simulator was selected, or Argent's runner holds it.
25999
+ LAUNCH_ANALYSIS_DEVICE_UNAVAILABLE: "LAUNCH_ANALYSIS_DEVICE_UNAVAILABLE",
26000
+ // The bundle_id app is not installed on the selected device.
26001
+ LAUNCH_ANALYSIS_APP_NOT_INSTALLED: "LAUNCH_ANALYSIS_APP_NOT_INSTALLED",
26002
+ // The runner's xcodebuild failed on code signing or provisioning.
26003
+ LAUNCH_ANALYSIS_SIGNING_FAILED: "LAUNCH_ANALYSIS_SIGNING_FAILED",
26004
+ // The iPhone's free developer profile has no slot for Argent's runner.
26005
+ LAUNCH_ANALYSIS_FREE_PROFILE_LIMIT: "LAUNCH_ANALYSIS_FREE_PROFILE_LIMIT",
26006
+ // simctl could not wait for boot, find, launch or terminate the app.
26007
+ LAUNCH_ANALYSIS_SIMCTL_FAILED: "LAUNCH_ANALYSIS_SIMCTL_FAILED",
26008
+ LAUNCH_ANALYSIS_RECORD_FAILED: "LAUNCH_ANALYSIS_RECORD_FAILED",
26009
+ // xctrace could not export the TOC, the CPU samples or the first-frame marker.
26010
+ LAUNCH_ANALYSIS_EXPORT_FAILED: "LAUNCH_ANALYSIS_EXPORT_FAILED",
26011
+ // The App Launch trace has no first frame of the app, so it has no launch window.
26012
+ LAUNCH_ANALYSIS_NO_FIRST_FRAME: "LAUNCH_ANALYSIS_NO_FIRST_FRAME",
26013
+ // The XCTest launch run of Argent's runner failed.
26014
+ LAUNCH_ANALYSIS_RUNNER_TEST_FAILED: "LAUNCH_ANALYSIS_RUNNER_TEST_FAILED",
26015
+ // The launch test ran, but Argent read no launch measurements from its result.
26016
+ LAUNCH_ANALYSIS_NO_SAMPLES: "LAUNCH_ANALYSIS_NO_SAMPLES",
25991
26017
  // iOS and Android share one capture path (simulator-server frames into
25992
26018
  // ffmpeg), so these name the failing stage, not the device family.
25993
26019
  SCREEN_RECORDING_FACTORY_OPTIONS_MISSING: "SCREEN_RECORDING_FACTORY_OPTIONS_MISSING",
@@ -26142,7 +26168,9 @@ var FAILURE_COMMANDS = [
26142
26168
  "npx",
26143
26169
  "unknown",
26144
26170
  "devicectl",
26145
- "xcodebuild"
26171
+ "xcodebuild",
26172
+ // `xcrun xcresulttool`, which reads an XCTest result bundle.
26173
+ "xcresulttool"
26146
26174
  ];
26147
26175
  var FAILURE_SIGNAL_NAMES = [
26148
26176
  "SIGABRT",
@@ -543,6 +543,18 @@ export interface ArgentToolArgs {
543
543
  /** Target device id from `list-devices` (iOS UDID, Mac app id or Android serial). */
544
544
  device_id: string;
545
545
  };
546
+ "native-profiler-launch-analysis": {
547
+ /** measure: time five launches with XCTest. profile: record one Instruments App Launch trace. */
548
+ mode: "measure" | "profile";
549
+ /** Bundle ID of the Release build already installed on the device. The tool does not build or install the app. */
550
+ bundle_id: string;
551
+ /** Connected iPhone UDID; required for a physical-device run. With allow_simulator, a booted simulator UDID also works. */
552
+ device_id?: string;
553
+ /** Explicitly allow a booted simulator when no iPhone is selected. */
554
+ allow_simulator?: boolean;
555
+ /** profile mode only: App Launch trace recording length in seconds (default 8). Rejected in measure mode. */
556
+ duration_seconds?: number;
557
+ };
546
558
  "native-profiler-start": {
547
559
  /** Target device id from `list-devices` (iOS UDID, Mac app id or Android serial). */
548
560
  device_id: string;
@@ -682,7 +694,7 @@ export interface ArgentToolArgs {
682
694
  app_process?: string;
683
695
  };
684
696
  "profiler-stack-query": {
685
- /** Target device id from `list-devices` (iOS simulator UDID, Mac app id or Android serial). */
697
+ /** Target device id from `list-devices` (iOS UDID, Mac app id or Android serial). */
686
698
  device_id: string;
687
699
  /** Query mode; see Modes in the tool description. */
688
700
  mode: "hang_stacks" | "function_callers" | "thread_breakdown" | "leak_stacks";