xcode 如何在 iPad 应用程序中执行 exe?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/5056924/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-14 20:16:34  来源:igfitidea点击:

How to execute an exe in an iPad application?

xcodeipad

提问by Ali

I want to add a file to my iPad application and call it, it take parameters like -h.

我想向我的 iPad 应用程序添加一个文件并调用它,它需要像-h.

Any suggestion how to do that?

任何建议如何做到这一点?

回答by Matti Virkkunen

I don't think that's even possible. To begin with, the iPad has an ARM processor while Macs generally have Intel or PowerPC processors, so the processor architectures are incompatible.

我认为这甚至不可能。首先,iPad采用ARM处理器,而Mac通常采用Intel或PowerPC处理器,因此处理器架构不兼容。

Not to mention that the operating systems probably aren't fully compatible either.

更不用说操作系统可能也不完全兼容。

It would likely take an entire virtual machine to run that exe, and that's just not feasible. Find the source code for it and compile it into something that can run on the iPad, or just rewrite the functionality of the exe.

可能需要整个虚拟机才能运行该 exe,这是不可行的。找到它的源代码并将其编译成可以在 iPad 上运行的东西,或者只是重写 exe 的功能。

回答by bbum

You can't fork/exec, use NSTaskor otherwise launch processes from within an application in an iOS app.

您不能fork/exec、使用NSTask或以其他方式从 iOS 应用程序的应用程序内启动进程。

So, no, there is no way to do what you are asking (assuming that any of us understand what you are asking -- it is a very poorly worded question).

所以,不,没有办法做你所问的(假设我们中的任何一个人都明白你在问什么——这是一个措辞非常糟糕的问题)。

To make it clear:

要说清楚:

You cannot launch an external process in an iOS app to be distributed via the App Store.

您无法在要通过 App Store 分发的 iOS 应用程序中启动外部进程。

回答by nil

I doubt this is a good idea, but you may be able to forkand execyour way into having a separate process. However, if you plan to make an iOS app, this probably won't fly with Apple. So, it would probably be easier to simply create a static library and link the result into your main application.

我怀疑这是一个好主意,但是你可能能够forkexec自己的方式为具有一个独立的进程。但是,如果您打算制作 iOS 应用程序,这可能不会在 Apple 上实现。因此,简单地创建一个静态库并将结果链接到您的主应用程序可能会更容易。

Beyond that, it's just a matter of trying and seeing if it works.

除此之外,这只是尝试看看它是否有效的问题。