From 1a0613fce2535b7869187ee6b8f92b1b249c0e49 Mon Sep 17 00:00:00 2001 From: szymonrybczak Date: Fri, 23 Aug 2024 08:33:59 +0200 Subject: [PATCH] fix: add missing `--device` option --- .../src/commands/buildCommand/buildOptions.ts | 8 ++++++++ .../src/commands/runCommand/runOptions.ts | 6 ------ packages/cli-platform-ios/README.md | 4 ++++ 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/packages/cli-platform-apple/src/commands/buildCommand/buildOptions.ts b/packages/cli-platform-apple/src/commands/buildCommand/buildOptions.ts index 778acae53..5124731b6 100644 --- a/packages/cli-platform-apple/src/commands/buildCommand/buildOptions.ts +++ b/packages/cli-platform-apple/src/commands/buildCommand/buildOptions.ts @@ -16,6 +16,8 @@ export type BuildFlags = { export const getBuildOptions = ({platformName}: BuilderCommand) => { const {readableName} = getPlatformInfo(platformName); + const isMac = platformName === 'macos'; + return [ { name: '--mode ', @@ -60,5 +62,11 @@ export const getBuildOptions = ({platformName}: BuilderCommand) => { name: '--force-pods', description: 'Force CocoaPods installation', }, + !isMac && { + name: '--device [string]', // here we're intentionally using [] over <> to make passed value optional to allow users to run only on physical devices + description: + 'Explicitly set the device to use by name or by unique device identifier . If the value is not provided,' + + 'the app will run on the first available physical device.', + }, ]; }; diff --git a/packages/cli-platform-apple/src/commands/runCommand/runOptions.ts b/packages/cli-platform-apple/src/commands/runCommand/runOptions.ts index 7ccf98cd3..9c82d3873 100644 --- a/packages/cli-platform-apple/src/commands/runCommand/runOptions.ts +++ b/packages/cli-platform-apple/src/commands/runCommand/runOptions.ts @@ -42,12 +42,6 @@ export const getRunOptions = ({platformName}: BuilderCommand) => { 'between parentheses at the end to match an exact version: ' + '"iPhone 15 (17.0)"', }, - !isMac && { - name: '--device [string]', // here we're intentionally using [] over <> to make passed value optional to allow users to run only on physical devices - description: - 'Explicitly set the device to use by name or by unique device identifier . If the value is not provided,' + - 'the app will run on the first available physical device.', - }, ...getBuildOptions({platformName}), ]; }; diff --git a/packages/cli-platform-ios/README.md b/packages/cli-platform-ios/README.md index b3fa81c19..ba69293cc 100644 --- a/packages/cli-platform-ios/README.md +++ b/packages/cli-platform-ios/README.md @@ -148,6 +148,10 @@ Explicitly set Xcode scheme to use. Explicitly set Xcode target to use. +#### `--device [string]` + +Explicitly set device to use by name. The value is not required if you have a single device connected. + #### `--verbose` Do not use `xcbeautify` or `xcpretty` even if installed.