React-Native xcrun:错误:无法在 Xcode 13 中找到“仪器”

Cas*_*tor 2 xcode ios react-native xcode13

instruments命令行工具已在 Xcode 13 中删除,Apple 要求xctrace改为使用。但我不确定在终端上运行 React-Native 项目时如何修复它。

npx react-native run-ios --device "iPhone"

实际上,我看到以下错误。

xcrun: error: Failed to locate 'instruments'.
xcrun: error: unable to find utility "instruments", not a developer tool or in PATH
error Command failed: xcrun instruments -s
Run Code Online (Sandbox Code Playgroud)

有没有人有办法解决吗?

Kri*_*smu 5

由于它已在 xcode 13 中删除,您有两个选择。您可以将 RN 版本升级到0.65.x已修复此问题的版本,或降级到 xcode 12。