在 Linux 中开始 iPhone 应用程序开发?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/276907/
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
Starting iPhone app development in Linux?
提问by javac
I've heard that you need to get a Mac if you want to develop iPhone apps. Is this true?
我听说如果你想开发 iPhone 应用程序,你需要一台 Mac。这是真的?
Is it possible to develop iPhone apps using Linux? If yes, what do I need and where do I download the necessary tools?
是否可以使用 Linux 开发 iPhone 应用程序?如果是,我需要什么以及在哪里下载必要的工具?
回答by stephenbayer
It seems to be true so far. The only SDK available from Apple only targets the MacOS environment. I've been upset about that, but I'm looking into buying a mac now, just to do iPhone development. I really dislike what they are doing, and I hope a good SDK come out for other environments, such as Linux and Windows.
到目前为止,这似乎是真的。Apple 提供的唯一 SDK 仅针对 MacOS 环境。我一直对此感到不安,但我现在正在考虑购买 mac,只是为了进行 iPhone 开发。我真的不喜欢他们在做什么,我希望有一个好的 SDK 出现在其他环境中,比如 Linux 和 Windows。
Obstaclesregarding the SDK:
SDK 的障碍:
The iPhone SDK and free software: not a match
Apple's recently released a software development kit (SDK) for the iPhone, but if you were hoping to port or develop original open source software with it, the news isn't good. Code signing and nondisclosure conditions make free software a no-go.
The SDK itself is a free download, with which you can write programs and run them on a software simulator. But in order to actually release software you've written, you must enroll in the iPhone Developer Program -- a step separate from downloading the SDK, and one that requires Apple's approval.
iPhone SDK 和免费软件:不匹配
Apple 最近为 iPhone 发布了一个软件开发工具包 (SDK),但如果您希望用它来移植或开发原始的开源软件,那么这个消息就不好说了。代码签名和保密条件使免费软件成为不可能。
SDK 本身是免费下载的,您可以使用它编写程序并在软件模拟器上运行它们。但是为了真正发布您编写的软件,您必须注册 iPhone 开发人员计划——这一步与下载 SDK 不同,并且需要 Apple 的批准。
I think it's rather elitist for them to think only macos users are good enough to write programs for their phone, and the fact you need to buy a $100 license if you want to publish your stuff, really makes it more difficult for the hobbyist programmer. Though, if that's what you need to do, I'm planning on jumping through their hoops; I'd really like to get some stuff developed on my iPhone.
我认为他们认为只有 macos 用户足以为他们的手机编写程序是相当精英的,而且如果你想发布你的东西你需要购买 100 美元的许可证,这确实让业余程序员更加困难。不过,如果这就是你需要做的,我打算跳过他们的圈套;我真的很想在我的 iPhone 上开发一些东西。
回答by Keith Elder
The only way I know of doing development in Linux for the iPhone would be to install Vmware and work on getting OS X running in a virtual machine. With that said there are some "legal" concerns in doing that. It is reported that OS X Server can be virtualized but as far as the development story on that I don't know.
我所知道的在 Linux 中为 iPhone 进行开发的唯一方法是安装 Vmware 并致力于让 OS X 在虚拟机中运行。话虽如此,这样做有一些“法律”问题。据悉,OS X Server 可以虚拟化,但至于开发故事我不知道。
If you are truly serious, that's the what I'd investigate.
如果你真的是认真的,这就是我要调查的。
Good luck.
祝你好运。
回答by GodEater
The answer to this really depends on whether or not you want to develop apps that are then distributed through the iPhone store. If you don't, and don't mind developing for the "jailbroken" iPhone crowd - then it's possible to develop from Linux.
这个问题的答案实际上取决于您是否想要开发然后通过 iPhone 商店分发的应用程序。如果您不这样做,并且不介意为“越狱”的 iPhone 人群开发 - 那么可以从 Linux 开发。
Check this chap's page for a comprehensive (if a little complex) guide on what to do :
检查这一章的页面以获取有关如何操作的全面(如果有点复杂)指南:
回答by dljava
Regarding the alternative tool chain, Saurik's site is useful but for latest firmware development he indicates building on the iPhone itself and stays clear of indicating that you may need to copy necessary iPhone firmware files to your Linux environment. It's not impossible, but just requires additional work, especially for signing the code (there are open alternative solutions out there as well).
关于替代工具链,Saurik 的站点很有用,但对于最新的固件开发,他指出在 iPhone 本身上构建,并明确表示您可能需要将必要的 iPhone 固件文件复制到您的 Linux 环境。这并非不可能,只是需要额外的工作,尤其是对代码进行签名(也有开放的替代解决方案)。
Also, take a look at other guides (for the same tool chain) that approach it more methodically.
此外,请查看更系统地处理它的其他指南(针对相同的工具链)。
I'd suggest to still do the final build and code signing and packaging in XCode (which may mean borrowing someone's Mac) in case you run into problems when submitting the application to Apple. Using the alternative tool chain opens up (at least on the Mac) the possibility of using other IDEs other than XCode for developing the application and again resorting to XCode for the deployment and testing with the simulator.
我建议仍然在 XCode 中进行最终构建和代码签名和打包(这可能意味着借用某人的 Mac),以防您在向 Apple 提交应用程序时遇到问题。使用替代工具链开辟了(至少在 Mac 上)使用除 XCode 以外的其他 IDE 来开发应用程序并再次诉诸 XCode 进行部署和使用模拟器进行测试的可能性。
Of course if you do get the code signing / certificate generation working from the command line outside of XCode then you can install a certificate on your actual iPhone and test there (installing the app via iTunes w/your certificate).
当然,如果您确实从 XCode 之外的命令行获得了代码签名/证书生成,那么您可以在实际的 iPhone 上安装证书并在那里进行测试(通过 iTunes 安装应用程序并使用您的证书)。
回答by Stephen Cox
You will never get your app approved by Apple if it is not developed using Xcode. Never. And if you do hack the SDK to develop on Linux and Apple finds out, don't be surprised when you are served. I am a member of the ADC and the iPhone developer program. Trust, Apple is VERY serious about this.
如果您的应用程序不是使用 Xcode 开发的,那么您将永远不会获得 Apple 的批准。绝不。如果你真的破解了 SDK 在 Linux 上开发并且 Apple 发现了,当你得到服务时不要感到惊讶。我是 ADC 和 iPhone 开发者计划的成员。相信,Apple 对此非常认真。
Don't take the risk, Buy a Macbook or Mac mini (yes a mini can run Xcode - though slowly - boost the RAM if you go with the mini). Also, while I've seen OS X hacked to run on VMware I've never seen anyone running Xcode on VM. So good luck. And I'd check the EULA before you go through the trouble.
不要冒险,购买 Macbook 或 Mac mini(是的,mini 可以运行 Xcode——虽然速度很慢——如果你使用 mini,可以提高 RAM)。此外,虽然我看到 OS X 被黑客入侵以在 VMware 上运行,但我从未见过有人在 VM 上运行 Xcode。所以祝你好运。在你遇到麻烦之前,我会检查 EULA。
PS: After reading the above, yes I agree If you do hack the SDK and develop on Linux at least do the final packaging on a Mac. And submit it via a Mac. Apple doesn't run through the code line by line so i doubt they'd catch that. But man, that's a lot of if's and work. Be fun to do though. :)
PS:阅读以上内容后,是的,我同意如果你真的破解了 SDK 并在 Linux 上开发,至少在 Mac 上做最后的打包。并通过 Mac 提交。Apple 不会一行一行地运行代码,所以我怀疑他们会抓住这一点。但是,伙计,这是很多假设和工作。做起来很有趣。:)
回答by Chaos
To provide a differing response, I'm running OS X and Xcode on a virtualised (VMware) machine on Linux. CPU is a Core2Quad (Q8800), and it is perfectly fast. I found a prebuilt VM online (I'll leave it to you to find) Xcode/iPhone development works perfectly, as does debugging via USB to the phone itself.
为了提供不同的响应,我在 Linux 上的虚拟化(VMware)机器上运行 OS X 和 Xcode。CPU 是 Core2Quad (Q8800),速度非常快。我在网上找到了一个预先构建的 VM(我会留给你去寻找)Xcode/iPhone 开发工作完美,通过 USB 调试到手机本身也是如此。
It actually surprised me a lot - but I've had no issues at all.
它实际上让我很惊讶 - 但我根本没有遇到任何问题。
回答by Ben Gotow
If you value your time, buy a Mac! I don't know enough about Linux development options to offer a viable solution, but it seems the proposed methods involve some pretty roundabout work. If you plan on seriously writing and selling iPhone apps, I think you could easily recoup the cost of a Mac Mini or Macbook. :-)
如果您珍惜时间,请购买 Mac!我对 Linux 开发选项的了解不足以提供可行的解决方案,但似乎提议的方法涉及一些相当迂回的工作。如果您打算认真编写和销售 iPhone 应用程序,我认为您可以轻松收回 Mac Mini 或 Macbook 的成本。:-)
回答by Johan Boulé
There used to bea project dedicated to solve this defect: iphone-dev
有曾经是一个致力于解决这一缺陷项目:iphone-dev的
The goal of the iphone-dev project is to create a free, portable, high quality toolchain to enable development for the Apple iPhone and other embedded devices based on the ARM/Darwin platform.
iphone-dev 项目的目标是创建一个免费、便携、高质量的工具链,以支持基于 ARM/Darwin 平台的 Apple iPhone 和其他嵌入式设备的开发。
回答by Johan Boulé
You're right non-jailbroken phones are limited to Apple's App store and Apple "has the right" to enforce whatever rule, it's totally nonfree territory. However while developing, one won't have to deal with Apple at all. You can use e.g. rsync to upload the code to the device and test it.
你说得对,未越狱的手机仅限于苹果的应用商店,苹果“有权”执行任何规则,这是完全非自由的领域。然而,在开发过程中,人们根本不必与苹果打交道。您可以使用例如 rsync 将代码上传到设备并进行测试。