【发布时间】:2020-09-20 21:03:30
【问题描述】:
我从 2018 年开始挑选一个 react-native 项目。通过在安装了 Xcode 9.0 的 2012 年 mac mini 上键入 npm install; npx react-native run-ios,我能够让该应用在模拟器中运行。
但是,模拟器列表中没有 iPhone 11。我读到我需要 Xcode 11+ 才能获得 iPhone 11 模拟器。所以我将我的 mac mini 从 OS 10.13 升级到 OS 10.15,然后我将 Xcode 升级到版本 12.0。
我加载了新的 Xcode 并输入了我的 Apple ID。然后我去终端输入npx react-native run-ios,但我得到了错误:
`instruments` is now deprecated in favor of 'xcrun xctrace' (see `man xctrace` for more information on its replacement)
Could not find iPhone 6 simulator
然后我运行命令rm -rf node_modules; npm install;,但随后出现错误:
npm ERR! error: pathspec 'master' did not match any file(s) known to git
并且尝试运行npx react-native run-ios 会出现错误:
Command `run-ios` unrecognized. Make sure that you have run `npm install` and that you are inside a react-native project.
如何让npx react-native run-ios 工作?
【问题讨论】:
-
您找到解决问题的方法了吗?
标签: ios xcode react-native