{"id":29415343,"url":"https://github.com/xuwening/react-native-debug-server-host","last_synced_at":"2025-07-11T16:01:45.433Z","repository":{"id":57334990,"uuid":"61895257","full_name":"xuwening/react-native-debug-server-host","owner":"xuwening","description":"React Native Debug server host for iOS","archived":false,"fork":false,"pushed_at":"2018-07-19T07:28:12.000Z","size":329,"stargazers_count":44,"open_issues_count":0,"forks_count":9,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-28T11:05:00.361Z","etag":null,"topics":["debug","hostserver","ios","reactnative"],"latest_commit_sha":null,"homepage":"","language":"Objective-C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/xuwening.png","metadata":{"files":{"readme":"ReadMe.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-06-24T15:48:14.000Z","updated_at":"2022-09-25T15:59:00.000Z","dependencies_parsed_at":"2022-09-06T05:22:17.935Z","dependency_job_id":null,"html_url":"https://github.com/xuwening/react-native-debug-server-host","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/xuwening/react-native-debug-server-host","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xuwening%2Freact-native-debug-server-host","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xuwening%2Freact-native-debug-server-host/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xuwening%2Freact-native-debug-server-host/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xuwening%2Freact-native-debug-server-host/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xuwening","download_url":"https://codeload.github.com/xuwening/react-native-debug-server-host/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xuwening%2Freact-native-debug-server-host/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264451966,"owners_count":23610504,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["debug","hostserver","ios","reactnative"],"created_at":"2025-07-11T16:01:32.148Z","updated_at":"2025-07-11T16:01:45.417Z","avatar_url":"https://github.com/xuwening.png","language":"Objective-C","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# Debug Server Host For iOS\n\n## 更新(2017.10.12)\n\n\u003e 增加pod集成方式\n\n\u003e 解决根rootViewController不是navigation时，无法显示debugHost界面的bug\n\n## 更新 (2017.6.20)\n\n\u003e 半年没关注 RN 发现变化还真不少，由于调试函数发生变化，这个库也需要更新下否则不起作用（最新RN版本0.45)。\n\n\u003e 如需兼容多版本，RN 版本判断下，然后设置`RCTSwapInstanceMethods([RCTDevMenu class], @selector(_menuItemsToPresent), @selector(newMenuItems));`中的@selector即可。\n\n## 更新（2016.11.28）\n\n\u003e 增加了`rnpm install react-native-DebugServerHost`的支持。\n\n## 更新（2016.11.15）\n\n\u003e 由于react native更换的URL的使用方式（增加了RCTBundleURLProvider类处理URL），所以旧的方式不再适应，进行新版本的改造，不再适配v0.29以下版本。新方式下只需输入IP地址，比较好输入，因此去掉了二维码扫描方式。\n\n\n## React Native服务器地址更换\n\n运行时更换服务器地址，不用为更换调试服务器地址而频繁打包。android调试状态有更换服务器地址功能，而iOS不具备此功能，本库就是为iOS提供此功能。\n\n![](./image/1.png)\n\n## 集成\n\n#### 自动集成\n\n`npm install react-native-DebugServerHost --save`\n\n`react-native link`\n\n#### pod集成\n\n`npm install react-native-DebugServerHost --save`\n\npodFile文件添加：\n\n`pod 'DebugServerHost', :path =\u003e '../node_modules/react-native-DebugServerHost'`\n\n`pod install`\n\n#### 手动集成：\n\n直接将DebugServerHost文件夹添加到项目中即可，无需任何设置。\n\n\n## 使用\n\n模拟器使用`Command+D`，真实设备使用摇一摇即可唤出调试菜单，选择最后一项`Debug server host`就可以修改服务器地址了。\n\n![](./image/2.png)\n\n\u003e 注意：修改完地址需要重新启动APP才能生效。\n\n\u003e 由于RN在debug模式下，会自动在安装包中添加ip.txt文件，保存开发机IP地址，并将main.jsbundle集成到APP中。首先通过IP地址去访问远程js脚本，如果没有找到，则使用安装目录中的main.jsbundle。但是目前在0.37版本中，第一步如果IP地址不正确，经常造成闪退。如果是这种情况，***可以先把手机网络全关，打开APP加载本地main.jsbundle后再更换正确的服务器地址***，或者更简单的方式***删除app重新安装***。\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxuwening%2Freact-native-debug-server-host","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxuwening%2Freact-native-debug-server-host","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxuwening%2Freact-native-debug-server-host/lists"}