-
-
Notifications
You must be signed in to change notification settings - Fork 182
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix/choosing_apple_device #1753
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
at least one device is active:
npx rnv run -p ios -t device name
-> doesn't find device. Expected - install to specified device.npx rnv run -p ios -t random
-> asks from simulators. Expected - ask from simulators and active devices.npx rnv run -p ios -d -t device IP
-> asks from active device. Expected - install to specified device.npx rnv run -p ios -t device IP
-> asks from simulators. Expected - install to specified device.npx rnv run -p ios -t random IP
-> asks from simulators. Expected - ask from simulators and active devices.
Note: same on tvos.
const target = c.runtime.target?.replace(/(\s+)/g, '\\$1'); | ||
|
||
p = `--simulator ${target}`; | ||
p = `--simulator ${target}`; |
Check warning
Code scanning / CodeQL
Unsafe shell command constructed from library input Medium
library input
shell command
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix AI 2 months ago
To fix the problem, we should avoid using string concatenation to construct the shell command. Instead, we can use child_process.execFile
to safely pass the arguments to the command without risking shell injection. This approach ensures that the input is treated as an argument rather than part of the command string.
-
Copy modified line R80 -
Copy modified line R82 -
Copy modified line R218 -
Copy modified line R220
@@ -79,5 +79,5 @@ | ||
if (selectedDevice.udid) { | ||
p = `--udid ${selectedDevice.udid}`; | ||
p = ['--udid', selectedDevice.udid]; | ||
} else { | ||
p = `--device ${selectedDevice.name}`; | ||
p = ['--device', selectedDevice.name]; | ||
} | ||
@@ -217,5 +217,5 @@ | ||
if (!desiredSim?.isDevice) { | ||
const target = c.runtime.target?.replace(/(\s+)/g, '\\$1'); | ||
const target = c.runtime.target; | ||
|
||
p = `--simulator ${target}`; | ||
p = ['--simulator', target]; | ||
} else { |
Description
Related issues
npx rnv run -p ios -d -t random
installs app when 1 device is connected #1741npx rnv run -p ios -d -t
doesn't ask to choose from device list when 1 device is available #1740Npm releases
n/a