简体   繁体   English

iOS Swift:在已连接的Iphone上查找Macbook计算机名称/ IP地址

[英]iOS Swift: find Macbook Computer Name/Ip Address on connected Iphone

For local development, I was hoping to programmatically get the computer name or ip address of the macbook my iphone is connected to. 对于本地开发,我希望以编程方式获取与iPhone相连的Macbook的计算机名称或ip地址。 I've been looking at hostess ; 我一直在看女主人 ; however, it seems to only provide my iphone's ip address. 但是,它似乎只提供了我iPhone的IP地址。 Is this possible? 这可能吗?

Thanks so much for the help! 非常感谢你的帮助! Dave 戴夫

What I've experienced is that if you're building an Xcode project on an iOS device, and then run the project with the debugger attached, it routes all of the iOS device's networking through your computer. 我所经历的是,如果您要在iOS设备上构建Xcode项目,然后在连接调试器的情况下运行该项目,它将通过您的计算机路由所有iOS设备的网络。 So it will only show your computer's IP address, not the device's. 因此,它将仅显示计算机的IP地址,而不显示设备的IP地址。 It looks in the debugger as if that's your iPhone's networking info, but it's really your computer's. 它在调试器中看起来好像是您iPhone的网络信息,但实际上是您计算机的信息。

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

相关问题 如何在 ios iphone swift 中获取热点连接设备的 IP 地址和 MAC 地址? - how can i get hotspot connected devices ip address and MAC address in ios iphone swift? iOS Xcode Swift - 如何获取热点连接设备的 IP 地址? - iOS Xcode Swift - How to get hotspot connected devices IP address? 获取 iPhone 连接的路由器的 IP 地址 - Fetching IP address of router to which iPhone is connected 以编程方式查找通过电缆将iOS设备连接到的MacBook的IP - Programatically finding IP of MacBook to which iOS device is connected via cable 使用 Swift 获取连接到我 iPhone 个人热点的设备的 IP 地址 - Get IP Address of Device connected to my iPhone's Personal Hotspot using Swift 如何通过Mac终端获取连接的iPhone IP地址 - How to get connected iPhone IP address through mac terminal 使用Bonjour提取与iPhone连接的路由器的IP地址 - Fetching IP address of router to which iPhone is connected using Bonjour 如何在iPhone中Ping或检查特定IP地址的服务器是否可用/已连接 - How to Ping or check if server of particular IP Address is available/connected in iPhone 当iPhone连接到计算机时,iOS访问临时私人文件 - iOS acces temporary private files when iPhone is connected to a computer 获取网络(不是设备)的IP地址iOS Swift - Get Network (Not device) IP address iOS swift
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM