繁体   English   中英

如果我在端口9999上运行react-native打包程序,如何告诉IOS模拟器这是要监听的端口?

[英]If I run react-native packager on port 9999 how do I tell the IOS simulator that that is the port to listen to?

可能还需要知道如何为Android修复此问题。

我在帮助中看不到任何答案:

$ react-native run-ios --help 

react-native run-ios [options]
builds your app and starts it on iOS simulator

Options:

-h, --help               output usage information
--simulator [string]     Explicitly set simulator to use
--scheme [string]        Explicitly set Xcode scheme to use
--project-path [string]  Path relative to project root where the Xcode project (.xcodeproj) lives. The default is 'ios'.
--device [string]        Explicitly set device to use by name
--udid [string]          Explicitly set device to use by udid
--config [string]        Path to the CLI configuration file

我想在其他端口上运行我的react-packager,因为有一个监听8081的代理,我可能不应该杀死它。

我正在使用启动应用程序

node node_modules/react-native/local-cli/cli.js start --port 9999

结果是:

** BUILD FAILED **

The following build commands failed:
    PhaseScriptExecution Run\ Script /Users/collumj/research/indraEight/ios/build/Build/Intermediates/React.build/Debug-iphonesimulator/React.build/Script-006B79A01A781F38006873D1.sh

并且该应用程序将无法启动(立即崩溃)。 杀死正在8081上侦听的进程并启动应用程序将导致BUILD SUCCEEDED

为了更改,您必须执行以下操作:

  • 打开开发者菜单
  • 选择开发设置
  • 最后选择调试服务器主机和端口进行开发

就这样,祝你好运

暂无
暂无

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

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