I'm trying to run a Macos application built from K...
# multiplatform
e
I'm trying to run a Macos application built from KMP. I'm trying the task
runReleaseExecutableMacosX64
because that matches the pattern that the other targets use, but it isn't found. Is there a different way to do this for Mac targets?
j
Is your macOS source set called
macosX64Main
? I would expect that to be the run task if so. I have a native app that creates the host system's platform as the native source set named
nativeMain
and the run task is
runReleaseExecutableNative
.
e
Interesting I just have a
nativeMain
source set so I'll try that
No task with that name 🤔
j
Under the
run
group, I have two tasks:
runDebugExecutableNative
and
runReleaseExecutableNative
.
e
Hmm I don't see those
j
Have you configured the native target's binary executable? E.g.:
Copy code
macosX64("native") {
    binaries.executable {
        entryPoint = "main"
    }
}
e
I didn't specify the entry point but I did
binaries.executable
which works on Linux and mingw
c
Does anything relevant show up when you run
:tasks --all
?
j
You can access the run tasks with the
runTask
property. E.g.:
Copy code
macosX64("native") {
    binaries.executable {
        println("run task name = ${runTask?.name}")
    }
}
For me, this prints out those two task names. It looks like
runTask
is null if the target is not the host system, so it's not runnable. I assume you're using an x64 Mac and not Arm64?
e
@chr not for Macos @Jeff Lockhart I tried running the task on both. I'll try
runTask?.name
and see what I get
Sorry nothing to see here, just your average run of the mill idiot 🙈
Copy code
!it.konanTarget.family.isAppleFamily
😄 1