如何通过WiFi从iPhone发送命令到Mac? [英] How do I send a command to a Mac via WiFi from an iPhone?

查看:218
本文介绍了如何通过WiFi从iPhone发送命令到Mac?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我如何通过其连接的Wi-Fi网络向Mac(已启用网络共享)发送命令?在我的情况下,我想要它打开一个应用程序。

How would I send a command to a Mac (which has network sharing turned on) over the Wi-Fi network that both it and the iphone is connected to? In my case I want it to open an application.

推荐答案

通过网络共享,我假设您只是共享文件。要启动应用程序,您需要启用远程登录(这将允许Richard的SSH建议),或者有一个在Mac上运行的应用程序正在侦听特定端口。您的iPhone应用程序将通过此端口进行通信。一些iPhone应用程序有一个Mac应用程序(参考到达我的文件,这里文件,文件)为了与Mac通信的目的。

By network sharing, I assume you are only sharing files. To launch an app, you'd either need to have Remote Login turned on (which would allow Richard's SSH suggestion) or have an application running on the Mac which is listening on a specific port. Your iPhone app would then communicate over this port. Some iPhone apps have a Mac app counterpart (cf. Reach My Files, Here File, File) for the purpose of communicating with the Mac.

您希望用户在安装您的应用程序时做多少工作?你会带他们通过如何在系统偏好中打开远程登录选项在共享(在这种情况下,iPhone应用程序将需要一个用户的用户凭证允许远程登录,或者他们只是安装一个应用程序?

How much work are you expecting the user to do when they install your app? Will you walk them through how to turn on Remote Login option in System Preferences under Sharing (in which case, the iPhone app will need to have the user credentials of a user allowed to login remotely), or have them just install an app? The latter is much more user-friendly, but more work on your part.

要真正启动应用程序,您可以使用 open

To actually launch the app, you can use the open command. Type man open for more details, but basically, to launch, for example, iTunes: open -a iTunes.app.

这篇关于如何通过WiFi从iPhone发送命令到Mac?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆