How to run Swift binaries compiled on macOS on Linux? - swift

So I have a Command Line application here in Xcode on my Mac and I can get the build binary and run it.
Is it possible to run that binary on Linux or somehow build the project to run on Linux?
I'm using Virtual Box with Debian Linux 10.2, Xcode 11.2.1, macOS 10.15.1

Related

Xcode v13.4.1 libsystem_kernel.dylib`__abort_with_payload:

I've a simple BLE test application which can NOT run inside Xcode. It says: "libsystem_kernel.dylib`__abort_with_payload:".
I can run it manually with the open Products/Release/HRM.app/Contents/MacOS/HRM but not with open Products/Release/HRM.app command...
I'm on the latest Monterey and Xcode. On an older machine with Mojave I can run it without this error message. What to check?

How run my flutter project on iOS (on my Linux machine)?

Android studio 4.0
Linux Mint 19.3
I create my simple Flutter project and success run it on my Android device.
Nice.
But now I need to run my Flutter project on iPhone. So... to do this I need... what I need?
Maybe install iOS on Virtual Box (on my Linux machine) and then install XCode and then run my Flutter project on XCode? Or maybe has another approach?
You can do that with CI/CD services like Codemagic
How to develop and distribute iOS apps without Mac with Flutter & Codemagic

Ionic Capacitor iOS on linux

Considering this answer, it is not possible to run Xcode on Arch Linux.
Capacitor iOS documentation says that I need it to run iOS emulation.
Is there a way to emulate iOS device on Manjaro using Ionic Capacitor?
you can run xcode on linux NATIVELY using darling
Darling is a translation layer that lets you run macOS software on Linux
once installed you can install xcode
via command-line developer tool following this link
No, it's not possible, iOS requires Xcode and macOS

Swift on Mac terminal

Formerly I used FreeBSD and NetBSD. Mostly I code C on Command Line Interface (CLI) with vim editor.
Now I am using macOS. As I get used to CLI, so when I code swift on macOS, I opt console.
I've learned that I can also code swift on Mac Terminal without installing Xcode. I can compile or interpret and run simple Swift code on Terminal.
So my questions, does swift on Mac Terminal have full features as Xcode or not? Are all Swift libraries included in Mac Terminal?
You will have to install Xcode even if you don't plan to use it, because it installs the Swift toolchain.
On Linux you can install standalone Swift (and of course you can only access Linux libraries, not macOS or iOS ones) but in macOS you have to install via Xcode (but you don't have to use Xcode itself to write code).
See https://swift.org/getting-started/ and https://swift.org/download/#releases
Install xcode command line tools. Then in terminal, follow steps:
Step 1: Open Terminal
Step 2: Type "swift"
Now you can write swift code here. But better to use playground.

How to build native app bundles for Windows, Linux & Mac in a single build?

I am running my build on Windows 8 O.S. , 64 bit machine. I have JavaFx2.0 and Java 1.7.0_09 installed on my system. I am able to build a 64 bit window executable that launches my JavaFx application as a self-contained Javafx application.
Now I want to deliver native app bundles on Windows, Linux and Mac without build my project on all three platforms i.e I would like to achieve these set of bundles in a single build that I suppose to run on by Windows 8 O.S. 64 bit machine.
I am also okay if I can do it by distributing a single Application JAR file as .zip for MAC and Linux. But what I want is that JAR should work on there respective platform.
When I used to run a single application Jar on MAC using command
java -jar application.jar
It always shows a dialog "The application require a newer version of Java Run-time" with download link. Even I have downloaded and successfully installed it on my MAC machine but it still shows me the same window.
I don't want the users to experience such difficulties while running my JavaFX application on MAC and Linux.
What I need to ship more with the Application JAR so the users can run my JavaFx application on MAC and Linux without any hassle?
I guess you are making the JavaFX Solution in a 64bit machine and on the other hand you must be having all the SDK and runtime for 64bit version. The problem is that the application made using 64bit version of SKD would required 64 bit OS to render itself. So the bottom line is, is yout mac and linux PC have 64bit version of OS and JavaFX Runtime as well as Java7.X all 64 bit? If not then you must update your runtime to 64bit version or make your application in a 32bit version of SDK. One quick suggestion. If your mac or linux is 64bit(I dont have much idea about mac) then just install a browser i.e. 64bit version and runtimes and try out. I was having the same problem and that got fixed. Let me know if my answer caused any confusion.