26

I understand why you can't develop OS X apps on a Linux computer, but is there a good technical reason why you can't develop iPhone and iPad apps on Linux? Why isn't it possible to compile iOS source code into an iOS executable and run it in an iOS simulator on Linux or install it on a development iOS device?

Is it just because the XCode IDE is a Cocoa application?

You can develop Android apps on any kind of platform, it seems. I don't see why the same can't be true of iOS.

Random42
  • 10,370
  • 10
  • 48
  • 65
dan
  • 2,283
  • 3
  • 22
  • 23

7 Answers7

19

Mac OS X can only contractually be run on Apple Hardware. iOS requires the Cocoa framework and to have access to a Mac to sign the keychain. While you can use Objective-C on Linux using the OpenStep libraries, you can't push the applications you develop to iOS due to the lack of the correct Cocoa API libraries and while you can push to a jailbroken device without keychaining with a full developer account, in order to sell said app or even to have the public download it, you have play by Apple's rules.

  • 21
    "Mac OS X can only legally be run on Apple Hardware" -- I would be very surprised if that were true in any sane legal system. I *know* for a fact that it *isn't* true in Germany, because Microsoft tried to pull the same stunt, people ignored it, Microsoft sued, and lost. – Jörg W Mittag Aug 05 '11 at 21:06
  • 4
    I'll change it to "contractually" for more precision. –  Aug 05 '11 at 21:21
  • 4
    Violating the terms of the contract basically just strips you of support privileges. Apple wants to provide good customer service, and the simplest way to do that is to limit the space in which things can go wrong in the first place. If you're running their OS on non-Apple hardware, you're on your own. – Jon Purdy Aug 05 '11 at 22:27
  • @JörgWMittag How did Microsoft tried to do that? I'm not aware Microsoft makes hardware in the first place at all. – Nadir Sampaoli Sep 21 '14 at 13:50
  • 4
    @NadirSampaoli: In Germany, Microsoft sells Windows licenses *very* cheap to PC builders, so that they can bundle Windows with their PCs without increasing the cost too much compared to a PC without OS or with bundled Linux. The intent is that these licenses are pre-installed on the PCs. However, the PC builders realized that they could sell those licenses separately, with a *huge* profit compared to what they paid for them, but still much cheaper than Microsoft. Microsoft sued on the grounds that those licenses could only be used with the PCs from those builders, but lost. – Jörg W Mittag Sep 21 '14 at 19:51
  • I can't understand why this is the accepted answer. Developing iOs apps on other operating systems is totally possible, the only thing you need a mac for is the signing part, but that's not part of development. – Pieter B Sep 22 '14 at 14:46
  • If you run OSX on a linux machine, it's no longer a linux machine. I don't see the value in the first sentence ("Mac OS X can only contractually be run on Apple Hardware.") – Bryan Oakley Sep 22 '14 at 16:10
  • @PieterB I think this answer is fine, but like I said in my own answer, it should at least mention that you can develop iOS apps on a Linux computer. Using a build host isn't exclusive to iOS apps (and is a very useful habit to have at your disposal). Apple is just requiring that using one for iOS binaries. I'd actually say that a more relevant restriction is that on JIT/dynamic code generation, since it prevents the use of some cross-platform development methods that would otherwise be available. – Selali Adobor Sep 23 '14 at 00:19
  • @BryanOakley: In most countries, you cannot legally run OSX on a machine not manufactured by Apple. In order to run OSX, you have to accept the license terms and the license terms specifically prohibit installing OSX on non-Apple machines. Note that installing OSX requires a modified/hacked version of OSX because Apple uses a BIOS that's incompatible with "normal" PCs. And modifying OSX breaks other bits of copyright laws depending on your country. – slebetman Nov 24 '14 at 06:59
  • Q: Is there a technical reason why? A: For legal reasons you can't ... so no – 1mike12 Oct 30 '21 at 20:48
  • just more proof that Apple hates developers and considers them a necessary evil to simulate market traction in their app store. – airtonix Jan 22 '22 at 08:41
19

There's no particular technical reason, but the developer tools Apple provides only run on Macs, and I don't see them being in any hurry to change that.

With regards to third party developer tools, Apple very publicly dislikes them, and given Apple's absolute veto power over what gets in the App Store, it's not a great idea to invest any significant development time in making/using them.

(One of the development tools - the iOS Simulator - is very strongly tied to MacOS X for sound technical reasons. AFAIK it's actually a thin wrapper between iOS and the very similar MacOS X APIs, which it would be infinitely harder to do on another OS. You'd have to start again from scratch and likely end up with something as dog slow and horrible as the Android emulator)

grahamparks
  • 2,099
  • 1
  • 15
  • 14
8

It depends on what you mean by "technical reason"

Strictly speaking I don't believe there's a technical reason that iOS Apps couldn't be developed on Linux. It would require some entity, be it Apple or a group of enterprising/talented hackers, to author a toolchain for it (compilers, maybe an IDE, something to get it on the phone).

So if by "technical reason" you mean "something special about the Macintosh that's impossible and couldn't possibly exist on another platform" then no, I don't believe there is. There's not some special chip on the Macintosh that is required for this, for example.

If by "technical reason" you mean "something preventing me from being able to do it today" then yes, the entire signed code bit doesn't exist on Linux and unless Apple ports it over then that's the ball game.

Tom Kidd
  • 827
  • 9
  • 16
  • Others are saying that there's this chain of dependancy that goes like: xcodebuild & codesigning, which require apple libs, which can only be installed on MacOSx, which only installs itself on a machine whose bios Apple manufactured. So with all thisyou could use a virtual machine. but then the spirit of the OP question was testing if for example we could dnf install some stuff. – airtonix Jan 22 '22 at 08:45
4

I think it should said you can develop for iOS on other platforms, you just can't build final applications on them.

It's been explained in the accepted answer why you can't build outside of OS X, but there are many development tools that allow you to write iOS apps on other platforms.

Some of the development tools that I've used that allow this :

  • Qt Framework (C++ and Qml): Applications can be written in Windows or Linux then the iOS application is built with XCode on OS X.

  • Unity3D (C#, UnityScript, and Boo): You can develop on Windows and to build an iOS on either platform you generate an XCode project. This also allows further integration with other Objective-C code.

  • Xamarin (C#): You can develop on Windows (and I believe Linux), and use an OS X machine as a build host.

  • Kivy (Python): Also Generates XCode Projects.

And you can find many more projects like these, especially once you start looking at hybrid and mobile web app frameworks like Appcelerator.

Selali Adobor
  • 639
  • 4
  • 14
  • Sure, but will your app look like it's been developed with the proper consideration for that platform? or will it look like something an IOS developer just click "build for android" without even looking to see if any of UX flows translated well to the android paradigms? – airtonix Jan 22 '22 at 08:47
1

There is a technical reason that Xcode will not allow development of iOS apps on other systems.

iOS is similar in many ways to OS X. Many of the frameworks are identical or very close. The iOS Simulator makes use of that to provide a very fast testing environment. When Xcode compiles an app to run in the simulator, it creates x86 binaries which link against frameworks that mostly thunk down to OS X frameworks. You end up with a debug build that runs natively on your Mac, which has great performance.

If you look at Android, it creates platform independent apks which are then emulated in one Android emulator or another. This runs a virtual machine which runs the whole Android stack for you to debug. There are emulators which are faster than others, but all of them are much slower than the simulator. The benefit, though, is that they are cross-platform.

For Apple to allow iOS apps to be built on other systems, they would either need to port the frameworks to those OSes so they could write a simulator, or they would have to build an emulator. Either of those would be a chunk of work that would take time away from building new features.

Alan Shutko
  • 1,380
  • 1
  • 10
  • 9
  • This is something no other answer illuminated and it's a pretty big blocker for those looking to build quality apps that feel like they belong on the target platform. – airtonix Jan 22 '22 at 08:49
0

There is no technical reason at all that you wouldn't be able to develop ios applications on linux. In fact it already happens on windows in Delphi XE. There you can develop your ios apps totally in windows. The only thing in the end needed is that your apps need to be signed. This can only be done on a mac.

Pieter B
  • 12,867
  • 1
  • 40
  • 65
0

While you cannot sign applications for iOS on Linux, and thus distribute them through the accepted methods, you can develop (with the same APIs) on Linux using Theos. This is the toolchain used by the jailbreak community to develop apps for iOS, and it is cross-platform. If your iOS device is jailbroken, I believe you'll be able to push the compiled application to your device via libimobiledevice, but someone may correct me if I'm wrong.

Some more information: http://iphonedevwiki.net/index.php/Theos

I plan to give this a go in the next day or so, and I'll provide updates.

sammoore
  • 109
  • 2