Skip to content
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

iOS: react-native bundle fails to find target simulator #1845

Closed
tido64 opened this issue Feb 22, 2023 · 8 comments
Closed

iOS: react-native bundle fails to find target simulator #1845

tido64 opened this issue Feb 22, 2023 · 8 comments

Comments

@tido64
Copy link
Contributor

tido64 commented Feb 22, 2023

Environment

System:
    OS: macOS 12.6.3
    CPU: (10) arm64 Apple M1 Max
    Memory: 4.24 GB / 64.00 GB
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 18.14.1 - /private/var/folders/j0/5zfnwvyd4sb15smylklx03m00000gn/T/xfs-985c11d4/node
    Yarn: 3.4.1 - /private/var/folders/j0/5zfnwvyd4sb15smylklx03m00000gn/T/xfs-985c11d4/yarn
    npm: 9.3.1 - ~/.local/bin/npm
    Watchman: 2023.01.30.00 - /opt/homebrew/bin/watchman
  Managers:
    CocoaPods: 1.11.3 - ~/.gem/bin/pod
  SDKs:
    iOS SDK:
      Platforms: DriverKit 22.2, iOS 16.2, macOS 13.1, tvOS 16.1, watchOS 9.1
    Android SDK:
      API Levels: 31, 33
      Build Tools: 30.0.3, 31.0.0, 33.0.0
      System Images: android-33 | Google APIs ARM 64 v8a
      Android NDK: Not Found
  IDEs:
    Android Studio: 2021.2 AI-212.5712.43.2112.8815526
    Xcode: 14.2/14C18 - /usr/bin/xcodebuild
  Languages:
    Java: 11.0.18 - /usr/bin/javac
  npmPackages:
    @react-native-community/cli: 10.1.3 => 10.1.3
    react: 18.2.0 => 18.2.0
    react-native: 0.71.3 => 0.71.3
    react-native-macos: Not Found
  npmGlobalPackages:
    *react-native*: Not Found

Description

react-native run-ios fails to find target simulator, even with --simulator 'iPhone 14'. It's using a specifier that isn't listed under available destinations:

2023-02-22 11:27:45.294 xcodebuild[12075:16449994] Writing error result bundle to /var/folders/j0/5zfnwvyd4sb15smylklx03m00000gn/T/ResultBundle_2023-22-02_11-27-0045.xcresult
xcodebuild: error: Unable to find a destination matching the provided destination specifier:
		{ id:00000000-0000-0000-0000-69C2E79AE15B }

	The requested device could not be found because no available devices matched the request.

	Available destinations for the "Example" scheme:
		{ platform:macOS, arch:arm64, variant:Designed for [iPad,iPhone], id:00000000-0000000000000000 }
		{ platform:iOS, id:dvtdevice-DVTiPhonePlaceholder-iphoneos:placeholder, name:Any iOS Device }
		{ platform:iOS Simulator, id:dvtdevice-DVTiOSDeviceSimulatorPlaceholder-iphonesimulator:placeholder, name:Any iOS Simulator Device }
		{ platform:iOS Simulator, id:00000000-0000-0000-0000-39E84C80FC4F, OS:16.2, name:iPad (10th generation) }
		{ platform:iOS Simulator, id:00000000-0000-0000-0000-A9BD2F2E6901, OS:16.2, name:iPad Air (5th generation) }
		{ platform:iOS Simulator, id:00000000-0000-0000-0000-D4C952251A5D, OS:16.2, name:iPad Pro (11-inch) (4th generation) }
		{ platform:iOS Simulator, id:00000000-0000-0000-0000-C02EF1196518, OS:16.2, name:iPad Pro (12.9-inch) (6th generation) }
		{ platform:iOS Simulator, id:00000000-0000-0000-0000-A58EBFA64F1C, OS:16.2, name:iPad mini (6th generation) }
		{ platform:iOS Simulator, id:00000000-0000-0000-0000-A2264D6D15EB, OS:16.2, name:iPhone 14 }
		{ platform:iOS Simulator, id:00000000-0000-0000-0000-A711FB324DD4, OS:16.2, name:iPhone 14 Plus }
		{ platform:iOS Simulator, id:00000000-0000-0000-0000-15EBD10C046C, OS:16.2, name:iPhone 14 Pro }
		{ platform:iOS Simulator, id:00000000-0000-0000-0000-D4338FF8FC9B, OS:16.2, name:iPhone 14 Pro Max }
		{ platform:iOS Simulator, id:00000000-0000-0000-0000-9F11116E74DA, OS:16.2, name:iPhone SE (3rd generation) }

Reproducible Demo

git clone https://github.com/microsoft/react-native-test-app.git
cd react-native-test-app
npm run set-react-version 0.71
yarn
cd example
pod install --project-directory=ios
yarn ios
@tido64
Copy link
Contributor Author

tido64 commented Feb 22, 2023

I don't know if it's related but I have several Xcode versions installed:

  • /Applications/Xcode-14.1.0.app
  • /Applications/Xcode-14.2.0.app

cc @adamTrz @thymikee

@thymikee
Copy link
Member

Does this happen with 10.2 as well? Anyhow related to npm or node version?

@tido64
Copy link
Contributor Author

tido64 commented Feb 22, 2023

Still happens with 10.2. I tried with Node 16 and npm 8.19.3. No dice.

@tido64
Copy link
Contributor Author

tido64 commented Feb 22, 2023

Okay, so this seems to be the reason:

% xcrun xctrace list devices
== Devices ==
Tommy’s MacBook Pro (2) (00000000-0000-0000-0000-69C2E79AE15B)

== Simulators ==
Apple Watch SE (40mm) (2nd generation) (9.0) (00000000-0000-0000-0000-4C5EA9A6D5B0)
Apple Watch SE (40mm) (2nd generation) (9.0) (00000000-0000-0000-0000-784F98AB1E12)
Apple Watch SE (40mm) (2nd generation) (9.1) (00000000-0000-0000-0000-F57280A4AEFD)
Apple Watch SE (44mm) (2nd generation) (9.1) (00000000-0000-0000-0000-D449575911B8)
...

parseIOSDevicesList thinks that my MacBook is a device. An iPhone would have a UDID of the form 00000000-0000000000000000, i.e. two numbers instead of four. Should we add that check?

@thymikee
Copy link
Member

Sounds like this is possibly fixed by #1823. @adamTrz could you backport this to 10.x branch?

@liamjones
Copy link
Contributor

An iPhone would have a UDID of the form 00000000-0000000000000000, i.e. two numbers instead of four. Should we add that check?

FYI, though it should be redundant if #1823 fixes things, this isn't always true. Older iOS devices have a different format of UDID: 0000000000000000000000000000000000000000 (no hyphenation at all)

@mertafor
Copy link

mertafor commented Mar 6, 2023

Okay, so this seems to be the reason:


% xcrun xctrace list devices

== Devices ==

Tommy’s MacBook Pro (2) (00000000-0000-0000-0000-69C2E79AE15B)



== Simulators ==

Apple Watch SE (40mm) (2nd generation) (9.0) (00000000-0000-0000-0000-4C5EA9A6D5B0)

Apple Watch SE (40mm) (2nd generation) (9.0) (00000000-0000-0000-0000-784F98AB1E12)

Apple Watch SE (40mm) (2nd generation) (9.1) (00000000-0000-0000-0000-F57280A4AEFD)

Apple Watch SE (44mm) (2nd generation) (9.1) (00000000-0000-0000-0000-D449575911B8)

...

parseIOSDevicesList thinks that my MacBook is a device. An iPhone would have a UDID of the form 00000000-0000000000000000, i.e. two numbers instead of four. Should we add that check?

I specifically noticed this issue since 0.71, even with freshly installed projects. There is an additional info line shown after running react-native run-ios as 'found devices' and it includes my macbook along with ios simulators. However I have a project works on RN 0.70.6 with exactly same node, ruby, bundler versions and it doesn't have such an info line that shows found devices. Of course it works without a problem.

@szymonrybczak
Copy link
Collaborator

Closing, this one. It's fixed by #1863 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants