Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

[IOS] Can't connect to metro on a real device

未关闭
#1,637 1 条评论 2 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
25/100
Issue 类型
缺陷
描述清晰度
需要澄清
活跃度
停滞
技术栈
javascript, react-native

调研方向

先从报告中的 AppDelegate sourceUrlForBridge 设置和 npm start --host 选项入手,然后将报告中的设备配置与连接日志进行比较。复现依赖于一个私有仓库,并且报告列出了相互冲突的 React Native 版本;完成的标准是建立与 Metro 的可复现实机连接并确定原因。

由索引模型根据 Issue 内容生成。

描述

Description

My Simulator works fine it connects to the development server or metro. But on my ios real device it does not connect. I have tried running with npm start --host 0.0.0.0 / MAC_IP, using hotspot, enabling the USB iPhone cable and editing the sourceUrlForBridge in AppDelegate to connect to the specific host and port but nothing has worked.

Steps to reproduce

Connect ios real device with usb and same network.

React Native Version

0.73.4

Affected Platforms

Runtime - iOS

Output of npx react-native info
System:
  OS: macOS 26.2
  CPU: (12) arm64 Apple M3 Pro
  Memory: 342.70 MB / 18.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 24.11.1
    path: /Users/bogomil.rusev/.nvm/versions/node/v24.11.1/bin/node
  Yarn: Not Found
  npm:
    version: 11.6.2
    path: /Users/bogomil.rusev/.nvm/versions/node/v24.11.1/bin/npm
  Watchman:
    version: 2025.08.11.00
    path: /opt/homebrew/bin/watchman
Managers:
  CocoaPods:
    version: 1.16.2
    path: /opt/homebrew/bin/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 25.1
      - iOS 26.1
      - macOS 26.1
      - tvOS 26.1
      - visionOS 26.1
      - watchOS 26.1
  Android SDK: Not Found
IDEs:
  Android Studio: 2025.2 AI-252.27397.103.2522.14617522
  Xcode:
    version: 26.1.1/17B100
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 17.0.16
    path: /usr/bin/javac
  Ruby:
    version: 2.6.10
    path: /usr/bin/ruby
npmPackages:
  "@react-native-community/cli":
    installed: 15.0.1
    wanted: 15.0.1
  react:
    installed: 18.3.1
    wanted: 18.3.1
  react-native:
    installed: 0.76.6
    wanted: 0.76.6
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: true
iOS:
  hermesEnabled: true
  newArchEnabled: true
Stacktrace and logs
No apps connected. Sending "reload" to all React Native apps failed. Make sure your app is running in the simulator or on a phone connected via USB.
info Reloading connected app(s)...
Reproducer

Private repo

Photos and videos

None

主要语言
JavaScript
星标
5.6k
派生
702
平均合并
3 天 2 小时
30 天内合并 PR
44

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

react/metro 的其他 Issue

查看 react/metro 的全部 Issue

相似的 Issue

更多 JavaScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。