执行iOS应用程序的外壳命令

发布于 2025-02-12 06:59:38 字数 61 浏览 0 评论 0原文

如何在Xcode中执行iOS应用程序的shell命令(它不支持NSTASK.H,因为该应用程序是沙盒时的)?

How do I execute shell commands for iOS app in Xcode(it does not support NSTask.h as the app is sandboxed)?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

我家小可爱 2025-02-19 06:59:38

你不能。没有可用的(公共)外壳,也没有(公共)高级API来运行外部命令。这是对iOS的故意限制。

您也许可以使用低级POSIX/MACH API,例如posix_spawn来启动捆绑可执行文件。但是,即使您设法这样做,如果您这样做,Apple也可能会拒绝您的应用商店提交。

You can't. There is no (public) shell available, and also no (public) high-level API to run external commands. This is a deliberate restriction of iOS.

You might be able to use low-level POSIX/Mach APIs like posix_spawn to start an executable that you bundle, though. But even if you manage to do that, it's likely that Apple will reject your App Store submission if you do that.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文