Skip to content

Commit d9affdb

Browse files
committed
Fix using lower Xcode version than minimum required by macOS: _LSOpenURLsWithCompletionHandler() failed for the application /Applications/Xcode.app with error -10664.
1 parent 44cf264 commit d9affdb

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/macosMain/kotlin/co/touchlab/xcode/cli/XcodeHelper.kt

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,14 @@ object XcodeHelper {
4444
}
4545

4646
fun openInBackground(installation: XcodeInstallation) {
47-
Shell.exec("/usr/bin/open", "-gjFa", installation.path.value).checkSuccessful {
48-
"Couldn't open ${installation.name} at ${installation.path}!"
47+
// Fix using lower Xcode version than minimum required by macOS:
48+
// _LSOpenURLsWithCompletionHandler() failed for the application /Applications/Xcode.app with error -10664.
49+
// Usage: ./build/bin/macosArm64/debugExecutable/xcode-kotlin.kexe sync /Applications/Xcode.app
50+
val realXcodePath = "${installation.path.value}/Contents/MacOS/Xcode"
51+
logger.i { "Opening realXcodePath in background." }
52+
Console.echo("Opening realXcodePath in background.")
53+
Shell.exec("/usr/bin/open", "-gjF", realXcodePath).checkSuccessful {
54+
"Couldn't open ${installation.name} at $realXcodePath!"
4955
}
5056
}
5157

0 commit comments

Comments
 (0)