From bce40e72bb8e6edf4dff62943b34cc5e8f33bee0 Mon Sep 17 00:00:00 2001 From: Kazuaki Matsuo Date: Fri, 30 Aug 2024 00:13:47 -0700 Subject: [PATCH] tweak the example --- docs/reference/execute-methods.md | 7 +++---- lib/commands/simctl.js | 4 ++-- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/docs/reference/execute-methods.md b/docs/reference/execute-methods.md index 8e3fad9d7..83301b71c 100644 --- a/docs/reference/execute-methods.md +++ b/docs/reference/execute-methods.md @@ -2090,21 +2090,20 @@ payload | string | Base64-encoded content of the recorded media file if `remoteP ### mobile: simctl Runs the given command as a subcommand of `xcrun simctl` against the device under test. -This method requires `simctl` [server secuity option](https://appium.io/docs/en/latest/guides/security/). `stream` commands such as log stream keeps listening the output, thus Appium keeps waiting for the command to end up to the given `timeot`. #### Arguments Name | Type | Required | Description | Example --- | --- | --- | --- | --- -command | string | yes | a subcommand for the `simctl`. | `'list'` -args | array | no | array of string as arguments for the command after ``. For example `getenv` subcommand accept `simctl getenv `. The `` will be filled out automatically. This `args` should be the ` ` part only. | `['ENV_EXAMPLE']` +command | string | yes | a subcommand for the `simctl`. Please check the error message about the latest available commands. | `'getenv'` +args | array | no | array of string as arguments for the command after ``. For example `getenv` subcommand accept `simctl getenv `. The `` will be filled out automatically. This `args` should be the ` ` part only. | `['HOME']` timeout | number | no | Command timeout in milliseconds. If the command blocks for longer than this timeout then an exception is going to be thrown. The default timeout is `600000` ms. | `10000` #### Returned Result Name | Type | Description | Example --- | --- | --- | --- -stdout | string | The standard output of the command. | `'{\n \'devices\' : {\n \'com.apple.CoreSimulator.SimRuntime.iOS...'` +stdout | string | The standard output of the command. | `'/Users/user/Library/Developer/CoreSimulator/Devices/60EB8FDB-92E0-4895-B466-0153C6DE7BAE/data\n'` stderr | string | The standard error of the command. | `''` code | string | The status code of the command. | `0` diff --git a/lib/commands/simctl.js b/lib/commands/simctl.js index 85cc9dc1c..383c94327 100644 --- a/lib/commands/simctl.js +++ b/lib/commands/simctl.js @@ -48,8 +48,8 @@ const commands = { */ async mobileSimctl(command, args = []) { if (!SUBCOMMANDS_HAS_DEVICE.includes(command)) { - throw new errors.InvalidArgumentError(`The given command '${command}' is not supported. ' + - 'Available subcommands are ${SUBCOMMANDS_HAS_DEVICE.join(',')}`); + throw new errors.InvalidArgumentError(`The given command '${command}' is not supported. ` + + `Available subcommands are ${SUBCOMMANDS_HAS_DEVICE.join(',')}`); } return await /** @type {import('./../driver').Simulator} */ (this.device).simctl.exec(