2017-02-02 93 views

回答

0

我刚刚发现,为什么我的react-native应用程序不会构建捆绑js,因为守望者以及卸载了以前的守望者和安装新的watchman.It正确工作,谢谢。
使用以下代码。

$ git clone https://github.com/facebook/watchman.git 
$ cd watchman/ 
$ git checkout v4.7.0 
$ sudo apt-get install -y autoconf automake build-essential python-dev 
$ ./autogen.sh 
$ ./configure 
$ make 
$ sudo make install 

$ watchman --version 
$ echo 999999 | sudo tee -a /proc/sys/fs/inotify/max_user_watches && echo 999999 | sudo tee -a /proc/sys/fs/inotify/max_queued_events && echo 999999 | sudo tee -a /proc/sys/fs/inotify/max_user_instances && watchman shutdown-server 
6

您的屏幕截图启动服务器以进行反应本机调试。

调试模式下的应用程序将指向此服务器js,然后您可以更改您的代码以便调试。

如果你要打包的包文件,你可以使用以下命令:

安卓

react-native bundle --platform android --dev false --entry-file index.android.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res/

IOS:

react-native bundle --platform ios --dev false --assets-dest ./ios --entry-file index.ios.js --bundle-output ios/main.jsbundle

+0

谢谢兄弟,但这是由于看守。我终于修好了。 –