【发布时间】:2020-10-10 07:33:58
【问题描述】:
我现在正在尝试使用 react-native 开发一个应用程序,但是第一个项目效果不佳。
环境
- cocoapods-1.9.3
- 节点 v10.16.2
- 守望者 4.9.0
- Apple Swift 版本 5.2.4 (swiftlang-1103.0.32.9 clang-1103.0.32.53) 目标:x86_64-apple-darwin19.4.0
我尝试过的
我按照official cite做了环境设置。
$ npx react-native init AwesomeProject
$ cd AwesomeProject
$ npx react-native run-ios
而且我看到了 iOS 屏幕,但是没有像“Welcome to react-native”这样的语句,应该出现在屏幕上。 我在模拟器上看到的是this。
当我执行命令时
$ npx react-native start
我可以看到这样的 react-native logo,
###### ######
### #### #### ###
## ### ### ##
## #### ##
## #### ##
## ## ## ##
## ### ### ##
## ######################## ##
###### ### ### ######
### ## ## ## ## ###
### ## ### #### ### ## ###
## #### ######## #### ##
## ### ########## ### ##
## #### ######## #### ##
### ## ### #### ### ## ###
### ## ## ## ## ###
###### ### ### ######
## ######################## ##
## ### ### ##
## ## ## ##
## #### ##
## #### ##
## ### ### ##
### #### #### ###
###### ######
Welcome to React Native!
Learn once, write anywhere
To reload the app press "r"
To open developer menu press "d"
但是下面有一个警告声明。
warn No apps connected. Sending "reload" to all React Native apps failed. Make sure your app is running in the simulator or on a phone connected via USB.
info Reloading app...
如何获得类似this picture 的模拟器屏幕,显示为成功结果?
【问题讨论】:
-
你解决了吗?每个启动命令都需要在自己的终端中运行。
ios-start可能需要大约 10 分钟才能构建,然后您才能看到反应屏幕。
标签: android ios swift reactjs react-native