简体   繁体   English

react-native 无法运行 ios 设备

[英]react-native cant run ios device

I try to run react-native app on a ios real device.我尝试在 ios 真实设备上运行 react-native 应用程序。 It works well on simulator or on a device using xcode but I would like to run with command-line I tried this:它在模拟器或使用 xcode 的设备上运行良好,但我想用命令行运行我试过这个:

>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.该应用程序出现在我的 iPhone 中,但没有运行。

Metro oppens in a new terminal but I get only this: Metro 在一个新航站楼开张,但我只得到这个:

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

                 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.而且我没有看到使用 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. 1 - 在 Xcode 中,将您的 Apple ID 添加到“帐户”偏好设置。

2 - Go to Product > Destination > select your device. 2 - Go 到产品 > 目的地 > select 您的设备。

3 - Go to Schema > Edit schema... > at your left side, click at "Run". 3 - Go 到架构 > 编辑架构... > 在您的左侧,单击“运行”。

4 - At Info, select "Release" at "Build Configuration". 4 - 在信息中,select 在“构建配置”中“发布”。

5 - Close the window and click at "Start the Active Schema". 5 - 关闭 window 并单击“启动活动模式”。

Xcode installs the app on the device before launching the app, trust the developer at iPhone and enjoy. Xcode 在启动应用程序之前在设备上安装应用程序,相信 iPhone 上的开发人员并享受。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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