在 ios 上远程响应本机调试 js 白屏 [英] react native debug js remotely white screen on ios

查看:56
本文介绍了在 ios 上远程响应本机调试 js 白屏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

说明

我在模拟器上调试一切正常,并且在 ios 设备上运行很好,当在设备上调试时显示白屏,没有错误日志

附加信息

React Native 版本:0.35.0平台:[iOS 10.1]操作系统:[MacOS]

解决方案

这可能意味着它无法连接到打包程序服务.确保端口 8081 已打开.如果仍然失败,请查看您的 ios 项目中的 AppDelegate.m.这一行是获取js包url的地方:

jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index.ios" fallbackResource:nil];

您可以将其更改为自定义网址,如下所示:

jsCodeLocation = [NSURL URLWithString:@"http://192.168.1.22:8081/index.ios.bundle?platform=ios&dev=true&minify=false"];

Description

i debug on simulator everything is ok, and run on the ios device is fine,when debug on the device show the white screen,no error log

Additional Information

React Native version: 0.35.0 Platform: [iOS 10.1] Operating System: [ MacOS]

解决方案

This probably means it can't connect to the packager service. Make sure port 8081 is open. If it's still failing, check out AppDelegate.m in your ios project. This line is where it gets the js package url:

jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index.ios" fallbackResource:nil];

You can change it to a custom url like this:

jsCodeLocation = [NSURL URLWithString:@"http://192.168.1.22:8081/index.ios.bundle?platform=ios&dev=true&minify=false"];

这篇关于在 ios 上远程响应本机调试 js 白屏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆