run-ios --udid <physical device> throws "No simulator available" because the fallback simulator is resolved eagerly
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 84/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Tranquilo
- Stack tecnológico
- react-native, typescript
- Área
- cli
Línea de trabajo
Comienza en createRun.ts alrededor de la línea 212 e inspecciona las tres llamadas a fallbackSimulator en las líneas 271, 417 y 426. Compáralas con getFallbackSimulator y reproduce el problema con run-ios --udid usando un dispositivo físico. Se considera terminado cuando las ejecuciones en dispositivos físicos ya no resuelvan un simulador, mientras que las rutas de simulador sigan resolviendo su fallback con normalidad.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Environment
npx react-native info
System:
OS: macOS 26.5
CPU: (10) arm64 Apple M2 Pro
Memory: 86.63 MB / 16.00 GB
Shell:
version: "5.9"
path: /bin/zsh
Binaries:
Node:
version: 24.10.0
path: ~/.nodenv/versions/24.10.0/bin/node
Yarn:
version: 1.22.22
path: /opt/homebrew/bin/yarn
npm:
version: 11.6.1
path: ~/.nodenv/versions/24.10.0/bin/npm
Watchman:
version: 2026.07.27.00
path: /opt/homebrew/bin/watchman
Managers:
CocoaPods:
version: 1.16.2
path: /opt/homebrew/bin/pod
SDKs:
iOS SDK:
Platforms:
- DriverKit 25.5
- iOS 26.5
- macOS 26.5
- tvOS 26.5
- visionOS 26.5
- watchOS 26.5
Android SDK: Not Found
IDEs:
Android Studio: 2026.1 AI-261.26222.65.2613.16025427
Xcode:
version: 26.6/17F113
path: /usr/bin/xcodebuild
Languages:
Java:
version: 17.0.20
path: /usr/bin/javac
Ruby:
version: 3.2.2
path: ~/.rbenv/shims/ruby
npmPackages:
"@react-native-community/cli":
installed: 20.1.2
wanted: 20.1.2
react:
installed: 19.2.3
wanted: 19.2.3
react-native:
installed: 0.85.3
wanted: 0.85.3
react-native-macos: Not Found
npmGlobalPackages:
"*react-native*": Not Found
Android:
hermesEnabled: true
newArchEnabled: true
iOS:
hermesEnabled: true
newArchEnabled: true
Description
run-ios --udid <udid-of-a-physical-iPhone> fails before it looks at the device:
error No simulator available with udid "00008140-XXXXXXXXXXXXXXXX"
createRun.ts:212 resolves the fallback simulator before any branch decides whether a simulator is involved:
const fallbackSimulator =
platformName === 'ios' || platformName === 'tvos'
? getFallbackSimulator(args) // throws here
: devices[0]
It is read only at lines 271, 417 and 426, all simulator paths. Device runs never use it but still pay for it, and getFallbackSimulator throws instead of returning null.
It throws because findMatchingSimulator gets the original args: with args.udid set it returns only on an exact simulator udid match, which a physical device never satisfies. The hardcoded fallback list (iPhone 14/13/12/11) then finds nothing on Xcode 26, which ships the iPhone 17 family.
The same call breaks every run-ios invocation when no simulator runtime is installed, a valid device-only setup: the iPhoneOS SDK ships inside Xcode.app, the runtime is a separate ~8 GB download device builds never touch.
#2795 reworked this branch and kept the eager call.
Suggested fix
Resolve lazily, so only simulator paths can fail on a simulator:
const fallbackSimulator = () =>
platformName === 'ios' || platformName === 'tvos'
? getFallbackSimulator(args)
: devices[0]
and call fallbackSimulator() at the three call sites. Ran this as a local patch; device and simulator runs both behaved correctly.
Reproducible Demo
Xcode 26, simulators available but none named iPhone 14/13/12/11 and none ever booted (no lastBootedAt in xcrun simctl list --json devices), physical iPhone connected:
npx react-native run-ios --udid <udid-of-the-connected-iPhone>
# error No simulator available with udid "00008140-XXXXXXXXXXXXXXXX"
Only the --udid shape fails:
const {
getFallbackSimulator
} = require('@react-native-community/cli-platform-apple/build/commands/runCommand/getFallbackSimulator.js')
getFallbackSimulator({}) // OK: iPhone 17 Pro
getFallbackSimulator({ device: 'My iPhone' }) // OK: iPhone 17 Pro
getFallbackSimulator({ udid: '00008140-XXXXXXXXXXXXXXXX' }) // throws
The first two pass only incidentally: with no udid in args the matcher falls through to "first available simulator".
End to end, the real command dies before building:
info Found Xcode workspace "MyApp.xcworkspace"
error No simulator available with udid "00008140-XXXXXXXXXXXXXXXX".
- Lenguaje dominante
- TypeScript
- Estrellas
- 2.9k
- Forks
- 949
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de react-native-community/cli
-
bug report
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
react-native-community/cli#2825 ·
-
run-ios: "Unable to boot device in current state: Booted" alert when the simulator is already booted Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
react-native-community/cli#2820 ·
-
feature request
Dificultad 4/5 3-5 días Aptitud para principiantes 68/100
react-native-community/cli#2856 ·
-
FASOCARD Abiertobug report
Dificultad 5/5 Más de una semana Aptitud para principiantes 5/100
react-native-community/cli#2855 ·
-
FASOCARD Abiertobug report
Dificultad 5/5 Más de una semana Aptitud para principiantes 10/100
react-native-community/cli#2854 ·
Todos los issues de react-native-community/cli
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
Eynzof/Hermes-CN-Desktop#610 ·
-
[Bug]: Matrix progress drafts fail with "Matrix runtime not initialized" during tool activity Abiertobug clawsweeper:linked-pr-open clawsweeper:needs-live-repro clawsweeper:no-new-fix-pr impact:message-loss issue-rating: 🐚 platinum hermit P2 regression
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
-
Client support matrix inclusion Abiertoenhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
-
calcite-components needs triage refactor
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
Esri/calcite-design-system#15203 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 90/100
danielmiessler/LifeOS#2218 ·