美文网首页
react-native端口占用错误的常用命令

react-native端口占用错误的常用命令

作者: next_discover | 来源:发表于2020-01-19 11:22 被阅读0次
运行
react-native init myProject  创建React-Native项目

react-native run-android
react-native run-ios
映射端口
adb reverse tcp:8089 tcp:8089
react-native start –port 8089

查看端口占用程序
sudo lsof -n -i4TCP:8081

sudo launchctl list | grep 5693

杀掉进程
sudo kill -9 13403

移除
sudo launchctl remove com.mcafee.agent.macmn

package.json配置指定端口启动
 "start": "node node_modules/react-native/local-cli/cli.js start --port 8089",

npm start为脚本启动
react-native start  启动需指定端口,不指定默认8081
例如
react-native start --port 8089

'React/RCTBridgeDelegate.h' file not found 解决方案

    cd /ios
    pod install
    cd ..
    react-native run-ios

错误及解决方法:could not get batchedbridge react native

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/

相关文章

网友评论

      本文标题:react-native端口占用错误的常用命令

      本文链接:https://www.haomeiwen.com/subject/jrgnoctx.html