duheng / Mozi

此项目致力于构建一套最基础,最精简,可维护的react-native项目,支持ios,android 🌹
MIT License
519 stars 93 forks source link

升级Xcode 10.2之后无法使用react-native run-ios Could not find iPhone X simulator #23

Open duheng opened 5 years ago

duheng commented 5 years ago

解决方案在这里:https://blog.csdn.net/guokaigdg/article/details/89020178

duheng commented 5 years ago

如果是43行错误请按照此操作修改:

一:执行 open /node_modules/react-native/local-cli/runIOS/findMatchingSimulator.js 二:替换 if (!version.startsWith('iOS') && !version.startsWith('tvOS')) { 为 if (!version.includes('iOS') && !version.includes('tvOS')) { 三:重新执行yarn run ios

duheng commented 4 years ago

如果是 149行错误请按照此操作修改 node_modules/react-native/local-cli/runIOS/runIOS.js:149:13

一:执行 open /node_modules/react-native/local-cli/runIOS/findMatchingSimulator.js 二:替换 if (!version.startsWith('iOS') && !version.startsWith('tvOS')) { 为 if ( !version.startsWith('com.apple.CoreSimulator.SimRuntime.iOS') && !version.startsWith('com.apple.CoreSimulator.SimRuntime.tvOS') ) {

三:全局搜索 simulator.isAvailable !== 'YES' 替换为 simulator.isAvailable !== true 四:重新执行yarn run ios

duheng commented 4 years ago

此类问题都是由于xcode的版本升级造成的,每个版本报的错不一样,所以遇到这类问题这几个方法都试试,实在解决不了就用xcode启动

wenxiayili commented 4 years ago

此类问题都是由于xcode的版本升级造成的,每个版本报的错不一样,所以遇到这类问题这几个方法都试试,实在解决不了就用xcode启动

我这边解决了,THK!