简体   繁体   中英

react-native cant run ios device

I try to run react-native app on a ios real device. It works well on simulator or on a device using xcode but I would like to run with command-line I tried this:

>npm install -g ios-deploy 

>react-native run-ios --device "My iPhone"

And this is what I get:

info Found Xcode workspace "Project.xcworkspace"
info Building (using "xcodebuild -workspace Project.xcworkspace -configuration Debug -scheme Project -destination id=00008020-0001395426EA002E")
......................................................................
2020-04-06 11:15:02.836 xcodebuild[16724:402803]  DTDeviceKit: deviceType from 00008020-0001395426EA002E was NULL
2020-04-06 11:15:02.967 xcodebuild[16724:402797]  DTDeviceKit: deviceType from 00008020-0001395426EA002E was NULL
info Installing and launching your app on My iPhone

The app appears in my iPhone but doesnt run.

Metro oppens in a new terminal but I get only this:

               ######                ######               
             ###     ####        ####     ###             
            ##          ###    ###          ##            
            ##             ####             ##            
            ##             ####             ##            
            ##           ##    ##           ##            
            ##         ###      ###         ##            
             ##  ########################  ##             
          ######    ###            ###    ######          
      ###     ##    ##              ##    ##     ###      
   ###         ## ###      ####      ### ##         ###   
  ##           ####      ########      ####           ##  
 ##             ###     ##########     ###             ## 
  ##           ####      ########      ####           ##  
   ###         ## ###      ####      ### ##         ###   
      ###     ##    ##              ##    ##     ###      
          ######    ###            ###    ######          
             ##  ########################  ##             
            ##         ###      ###         ##            
            ##           ##    ##           ##            
            ##             ####             ##            
            ##             ####             ##            
            ##          ###    ###          ##            
             ###     ####        ####     ###             
               ######                ######               

                 Welcome to React Native!
                Learn once, write anywhere



To reload the app press "r"
To open developer menu press "d"

And I doesnt get the progress bar that shows on build with XCode.

EDIT

For the logs:

user@MBP Project % react-native log-ios
error No active iOS device found

Versions installed:

user@MBP Project % react-native -v
react-native-cli: 2.0.1
react-native: 0.62.0
enter code here in terminal
react-native run-ios --simulator=”iPhone 11 Pro Max”

If you only want to run the app at the device, try this steps:

1 - In Xcode, add your Apple ID to Accounts preferences.

2 - Go to Product > Destination > select your device.

3 - Go to Schema > Edit schema... > at your left side, click at "Run".

4 - At Info, select "Release" at "Build Configuration".

5 - Close the window and click at "Start the Active Schema".

Xcode installs the app on the device before launching the app, trust the developer at iPhone and enjoy.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM