iOS启动后会报错,运行 react-native start就可以了
2016-05-17 11:34:12.357 [fatal][tid:main] Cannot find entry file index.ios.js in any of the roots: ["/Users/zhangxitao/work/github/f8app"]
项目依赖 Requirements
- (follow iOS and Android guides)
- Xcode 7.3 +
- (only for iOS)
- Version 1.0+ recommended (`gem install cocoapods --pre`)
- (needed to run Parse Server locally)
修改后的安装过程
- Clone the repo
```
$ git clone
$ cd f8app
```
- Install dependencies (npm v3+):
```
$ npm install
$ (cd ios; pod install) # only for iOS version
```
-
Make sure MongoDB is running:
先下载mongodb或直接通过brew install mongodb
命令安装。Mongodb不熟悉的需要先学习下mongodb的常用命令,和mysql有些类似。
```
$ lsof -iTCP:27017 -sTCP:LISTEN
$ mongod --dbpath YOURDATAPATH/mongodata/ & #启动mongodb
```
NOTE: if installed with [Homebrew](http://brew.sh/) run `brew info mongo` and
check out the Caveats section.
If you prefer to use an external MongoDB server, set `DATABASE_URI`:
```
$ export
```
- Start Parse/GraphQL servers:
```
$ npm start
$ react-native start
```
- Import sample data (the local Parse Server should be running): 并验证一下数据是否导入正确。
```
$ npm run import-data
$ mongo
MongoDB shell version: 2.6.5
connecting to: test
>
> show databases
admin (empty)
dev 0.078GB
local 0.078GB
> use dev
switched to db dev
> show collections
Agenda
FAQ
Maps
Notification
Page
Speakers
Survey
_Installation
_SCHEMA
system.indexes
> db.FAQ.find()
#会查到很多数据
```
Make sure everything works by visiting:
* Parse Dashboard: [http://localhost:8080/dashboard](http://localhost:8080/dashboard)
* Graph*i*QL: [http://localhost:8080/graphql](http://localhost:8080/graphql?query=query+%7B%0A++schedule+%7B%0A++++title%0A++++speakers+%7B%0A++++++name%0A++++++title%0A++++%7D%0A++++location+%7B%0A++++++name%0A++++%7D%0A++%7D%0A%7D)
- Running on Android:
```
$ react-native run-android
$ adb reverse tcp:8081 tcp:8081 # required to ensure the Android app can
$ adb reverse tcp:8080 tcp:8080 # access the Packager and GraphQL server
```
- Running on iOS:
```
$ react-native run-ios
```
实际运行效果
这样安卓和iOS模拟器应该都跑起来了。实际效果如下:
下篇文章开始分析f8app的服务器端结构。