React Native Change Default iOS Simulator Device

前端 未结 13 1582
轮回少年
轮回少年 2020-12-12 09:56

When I run this command:

react-native run-ios

My app runs by default in the iPhone6 simulator device:

Found Xcode project R         


        
13条回答
  •  旧巷少年郎
    2020-12-12 10:23

    There is a project setting if you hunt down:

    {project}/node_modules/react-native/local-cli/runIOS/runIOS.js

    Within there are some options under module.exports including:

    options: [{ command: '--simulator [string]', description: 'Explicitly set simulator to use', default: 'iPhone 7', }

    Mine was line 231, simply set that to a valid installed simulator and run react-native run-ios it will run to that simulator by default.

提交回复
热议问题