我今天升级到 Xcode 10.2,因为升级后我无法react-native run-ios
通过 cli 运行:
react-native run-ios --simulator="iPhone X"
Found Xcode workspace a.xcworkspace
Could not find iPhone X simulator
Error: Could not find iPhone X simulator
at resolve (/Users/user/Documents/work/a/a-light-ui/node_modules/react-native/local-cli/runIOS/runIOS.js:149:13)
at new Promise (<anonymous>)
at runOnSimulator (/Users/user/Documents/work/a/a-light-ui/node_modules/react-native/local-cli/runIOS/runIOS.js:134:10)
at Object.runIOS [as func] (/Users/user/Documents/work/a/a-light-ui/node_modules/react-native/local-cli/runIOS/runIOS.js:106:12)
at Promise.resolve.then (/Users/user/Documents/work/a/a-light-ui/node_modules/react-native/local-cli/cliEntry.js:117:22)
如果我运行xcrun simctl list devices
所有模拟器显示(Shutdown) (unavailable, runtime profile not found)
:
iPhone X (7AADFA50-7B57-4A40-8434-9A86F345D7ED) (Shutdown) (unavailable, runtime profile not found)
自从将 xcode 升级到 10.2 后,还有其他人遇到过 RN 的这个问题吗?它仍然可以通过 Xcode 运行.. 但这意味着打开 Xcode。