Run react-native application on iOS device directly from command line?

前端 未结 7 1485
春和景丽
春和景丽 2020-12-12 10:41

Is it possible to run react-native application on an iOS device directly from the command line like we do on simulator with react-native run ios --simulator \"iPhone 5

7条回答
  •  悲&欢浪女
    2020-12-12 11:24

    First install the required library globally on your computer:

    npm install -g ios-deploy
    

    Go to your settings on your iPhone to find the name of the device.

    Then provide that below like:

    react-native run-ios --device "______\'s iPhone"
    

    Sometimes this will fail and output a message like this:

    Found Xcode project ________.xcodeproj
    Could not find device with the name: "_______'s iPhone".
    Choose one of the following:
    ______’s iPhone Udid: _________
    

    That udid is used like this:

    react-native run-ios --udid 0412e2c230a14e23451699
    

    Optionally you may use:

    react-native run-ios --udid 0412e2c230a14e23451699 -- configuration Release
    

提交回复
热议问题