Xcode in intel machine

Hi…
Can we install and run xcode application in Linux.?
I have installed darling and completed the build (not in mac machine). But i am getting the below error when I try to open xcode. Not sure if I am doing it correctly.

Darling [/Volumes/SystemRoot/home/vicky]$ /Applications/Xcode.app/Contents/MacOS/Xcode
dyld: dyld cache load error: shared cache file open() failed
dyld: Library not loaded: /usr/lib/swift/libswiftCore.dylib
  Referenced from: /Applications/Xcode.app/Contents/MacOS/Xcode
  Reason: no suitable image found.  Did find:
	/usr/lib/swift/libswiftCore.dylib: file too short
	/usr/lib/swift/libswiftCore.dylib: stat() failed with errno=22
abort_with_payload: reason: dyld cache load error: shared cache file open() failed
Library not loaded: /usr/lib/swift/libswiftCore.dylib
  Referenced from: /Applications/Xcode.app/Contents/MacOS/Xcode
  Reason: no suitable image found.  Did find:
	/usr/lib/swift/libswiftCore.dylib: file too short
	/usr/lib/swift/libswiftCore.dylib: stat() failed with errno=22; code: 1
Abort trap: 6 (core dumped)
Darling [/Volumes/SystemRoot/home/vicky]$ 

My understanding is that darling can only run the CLI parts of xcode.

hi @dalto , is there any way to install xcode application in linux ?

This link has a guide on how to use Darling to run Xcode.

xcode is a piece of proprietary software native to MacOS and Apple hardware. So, no. I don’t think so.

When I visited Xcode’s website and clicked on “Download” and it asked me for my Apple ID, I can only shake my head.

Edit:
May I ask if you have a reason to prefer Xcode over something like VSCode?

Additional note:

You can install darling from the AUR instead of following the installation steps listed in the link. You can start from Section 3.2 of the guide.

All this seems like a pain, to be honest. It would save you a lot of time, sweat, and grief if you switch to VSCode or Neovim instead.

Of course, another way is to install MacOS in a virtual machine and then run Xcode inside the VM.

My understanding it the only way to run the full GUI is to use a VM but I have never tried personally.

Thanks @dalto and @anthony93. I will try using vscode for swift programming or VM

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.