• 请不要在回答技术问题时复制粘贴 AI 生成的内容
ethusdt
0.01D
V2EX  ›  程序员

RN 中 使用 iPhone 的 Personal Hotspot 给电脑用作发送 jsbundle 到手机会走数据流量吗?

  •  
  •   ethusdt · Aug 3, 2018 · 2233 views
    This topic created in 2866 days ago, the information mentioned may be changed or developed.

    react native 中真机调试时候, iPhone 需要和电脑连接到同一网络, 因为 jsbundle 是通过 wifi 传到手机的(跑一次成功后, 拔下 usb 也能继续用).

    如果网络的路由器阻止静态 ip 解析, 那么电脑上传 jsbundle 会有阻碍, 卡卡的很慢, 基本最后都会失败红屏.

    那么我使用 iPhone 的 Personal Hotspot 来给电脑用,电脑打包后将 jsbundle 发给 iPhone, 此时会走运营商的流量吗?

    10 replies    2018-08-03 17:40:15 +08:00
    ethusdt
        1
    ethusdt  
    OP
       Aug 3, 2018
    http://facebook.github.io/react-native/docs/running-on-device#troubleshooting

    官网说的如果路由器阻止静态 ip 解析就需要使用个人热点来给电脑用.

    可没说花费流量情况.
    ethusdt
        2
    ethusdt  
    OP
       Aug 3, 2018
    有人建议我咨询运营商(中国联通), 跟运营商政策有关

    又有人说这是局域网, 不会走流量 😷
    blanu
        3
    blanu  
       Aug 3, 2018
    静态 ip 解析和卡卡的有什么关系?不是很懂这个
    ethusdt
        4
    ethusdt  
    OP
       Aug 3, 2018
    @blanu 你可以忽略这里, 可以认为公司的路由器很难用 限制了设备间的互相访问, 上传速度很慢..
    ethusdt
        5
    ethusdt  
    OP
       Aug 3, 2018
    文档中有这么几句:

    > Many open wireless networks with captive portals are configured to prevent devices from reaching other devices on the network.

    > check if you are able to resolve the xip.io address, by running nslookup

    ```
    $ nslookup 10.0.1.123.xip.io
    ```

    > If it doesn't resolve your local IP address either the xip.io service is down or more likely your router prevents it.


    @blanu
    blanu
        6
    blanu  
       Aug 3, 2018   ❤️ 1
    @FaiChou 这个的意思是说禁止了动态解析到局域网 IP 吧,我能理解。「使用 iPhone 的 Personal Hotspot 来给电脑用,电脑打包后将 jsbundle 发给 iPhone 」,这个应该不会,最多会消耗那个所谓动态 DNS 请求的流量。
    jsq2627
        7
    jsq2627  
       Aug 3, 2018   ❤️ 1
    不走流量,局域网。
    ethusdt
        8
    ethusdt  
    OP
       Aug 3, 2018
    @jsq2627 谢谢.

    怎样讲才能让我这种整天混在应用层的计算机网络小白明白呢?
    blanu
        9
    blanu  
       Aug 3, 2018
    不从技术角度,从成本考虑就行了:流量、存储要钱,开发工具提供者不可能自己掏腰包给你把这些流量中转了。。
    jsq2627
        10
    jsq2627  
       Aug 3, 2018   ❤️ 1
    debug 模式 RN 加载 jsbundle 是走 http://xxx.xxx.xxxx.xxx(你的 IP).xip.io 加载的。xxx.xxx.xxx.xxx.xip.io 实际上会解析到你的内网 IP,所以走的是内网,不消耗流量。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   932 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 38ms · UTC 20:19 · PVG 04:19 · LAX 13:19 · JFK 16:19
    ♥ Do have faith in what you're doing.