简体   繁体   English

React Native AppDelegate.m没有地方可以更改本地主机

[英]React Native AppDelegate.m has no place to change localhost

I just init-ed a React Native project and want to run on my iOS device, but when I go into Xcode I cannot find where I should set the IP of my dev computer. 我只是初始化一个React Native项目并想在我的iOS设备上运行,但是当我进入Xcode时,我找不到应该在哪里设置我的开发计算机的IP。

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

As of react-native 0.44.0: 从本机0.44.0开始:

You need to create a file with name "ip.txt" and paste you macbook's IP address in a single line without any whitespace. 您需要创建一个名称为“ ip.txt”的文件,并将macbook的IP地址粘贴到没有任何空格的一行中。 Save this file and make sure your macbook and test device are on the same wi-fi. 保存此文件,并确保您的Macbook和测试设备在同一Wi-Fi上。 Whenever you want to fallback to the localhost, remove this file (or remove from your target). 每当您想回退到本地主机时,都请删除此文件(或从目标中删除)。

暂无
暂无

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

相关问题 React Native 31,New Appdelegate.m没有要更改的localhost:网络请求失败 - React Native 31, New Appdelegate.m no localhost to change : Network Request Failed React Native 无法将 SDK 导入 AppDelegate.m - 获取“使用未声明的标识符” - React Native Unable to import SDK into AppDelegate.m - Getting "Use of undeclared identifier" React Native 0.40.0:RCTBundleURLProvider.h“找不到文件 - AppDelegate.m - React Native 0.40.0 : RCTBundleURLProvider.h” file not found - AppDelegate.m 从React Native App内的AppDelegate.m访问/接收值 - Access/Receive a value from AppDelegate.m inside React Native App 在 AppDelegate.m 中找不到 React Native 'GoogleMaps/GoogleMaps.h' 文件: - React Native 'GoogleMaps/GoogleMaps.h' file not found in AppDelegate.m: 在 AppDelegate.m 中使用未声明的标识符“对讲机”-react-native-intercom - Use of undeclared identifier 'Intercom' in AppDelegate.m - react-native-intercom 使用 react-native-splash-screen 时如何重构 AppDelegate.m 以仅加载应用程序一次? - How to refactor AppDelegate.m to only load app once when using react-native-splash-screen? 集成 Facebook 和谷歌登录 iOS react-native - AppDelegate.m 回调 function - Integrating Facebook & Google login on iOS react-native - AppDelegate.m callback function 将AppDelegate.m更改为.mm时出错 - Getting errors when change AppDelegate.m to .mm 将AppDelegate.h和AppDelegate.m替换为AppDelegate.swift - Replace AppDelegate.h and AppDelegate.m to AppDelegate.swift
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM