[英]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.