react-native run-ios can not find simulator

在使用 react-native run-ios 命令時 報這個錯且你的模擬器是沒問題的node

能夠進行以下操做:react

打開文件 /node_modules/react-native/local-cli/runIOS/findMatchingSimulator.jsios

在第 42-45 行左右react-native

- if (!version.startsWith('iOS') && !version.startsWith('tvOS')) {
+ if (!version.includes('iOS') && !version.includes('tvOS')) {

在第 52-53 左右:code

- simulator.availability !== '(available)' && simulator.isAvailable !== 'YES'
+ simulator.isAvailable !== true

這樣便可正確運行it

相關文章
相關標籤/搜索