DEV Community

Nguyễn Hữu Hiếu
Nguyễn Hữu Hiếu

Posted on • Edited on

react-native: run application on specific ios simulator

This post will guide you how to run your application on specific ios simulator

# list all ios simulator
xcrun simctl list devices
# == Devices ==
# -- iOS 13.3 --
#    iPhone 8 (F71514A5-9B42-4FFF-93B0-AAAA)
#    iPhone 8 Plus (EE9676FF-8508-4B7C-B955-BBBB) 

# -- iOS 13.6 --
#    iPhone 8 (F71514A5-9B42-4FFF-93B0-XXXX)
#    iPhone 8 Plus (EE9676FF-8508-4B7C-B955-YYYY) 

Enter fullscreen mode Exit fullscreen mode

Run with device name

// package.json
{
  "scripts": {
    "start:iphone8": "react-native run-ios --simulator='iPhone 8'"
    // will choose F71514A5-9B42-4FFF-93B0-AAAA
  }
}
Enter fullscreen mode Exit fullscreen mode

Run with uuid

  • In some case you want to specific version of iOS (13.3, 13.6)
// package.json
{
  "scripts": {
    "start:iphone8Plus": "react-native run-ios --udid EE9676FF-8508-4B7C-B955-YYYY"
  }
}
Enter fullscreen mode Exit fullscreen mode

Run on the real device

npx react-native run-ios --configuration Release --device 'Boss's iPhone'
Enter fullscreen mode Exit fullscreen mode

Top comments (0)