如果我有 iPhone 的 IP 地址,我可以与它通信吗?
如果 iPhone 的 IP 已知,是否有默认情况下在 iPhone 上运行的任何服务可以让另一个 IP 地址与其通信?
are there any services running by default on an iphone that would let another ip address communicate with it if the iphone's ip is known?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
是的,从技术上讲,你可以。但存在一些问题:
所以我认为你不能依靠它来启动与手机的通信。
Yes, technically, you can. There are a couple of issues though:
So I don't think you can rely on that for initiating a communication with the phone.
对于未越狱的手机来说,开箱即用的选项并不多。但是,您可以编写自己的在电话上运行的客户端应用程序。它接受或启动远程连接。
在这种情况下,协议完全取决于您。
如果您对手机进行越狱,则可以安装 OpenSSH 软件包并通过 SSH 和 SFTP 访问您的手机。
There aren't many options out of the box on a non jail-broken phone. However, you can write your own client application that runs on the phone. It accepts or initiates the remote connection.
And in that case, the protocol is entirely up to you.
If you jailbreak your phone, you can install the OpenSSH package and have SSH and SFTP access to your phone.
我不知道你想用你的应用程序做什么,但你可以考虑创建一个与主线程分离的线程(使用 gcd),并使用它来使用 JSON 对象从服务器发送/接收信息。当然,您可以使用套接字并编写客户端或类似的东西。
我建议创建一个新线程,因为你可以让它永远运行(在企业应用程序上,我不知道Apple是否会批准在AppStore的应用程序上运行线程)。
我必须开发一个具有一致的客户端/服务器关系的应用程序,这就是我让它工作的方式。
I don't know exactly what you want to do with your app, but you can consider create a thread detached from the main one (using gcd) and use it to send/receive informations from a server using JSON objects for example. Sure you can use sockets and write a client or something like that.
I suggested a new thread because you can put it running forever (on a enterprise app, I don't know if Apple will approve a thread running on an App for AppStore).
I had to develop an app with a consistent client/server relationship and it was the way I got it working.