I just got an M1 MacBook Pro. I'm trying to build one of my macOS projects for Apple Silicon, but it only gives me "My Mac (Rosetta)" as a run destination (or "Any Mac (Intel)"), even though I've set the build archs to universal.
Googling is no help.
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
My app has a utility window that can live anywhere on screen, including over the menu bar, or in the top region of a screen with a notch when the main screen is not the built-in display.
If I drag the window into these areas, it sits there just fine. I have drag handlers in a subclass of NSWindow that call -setFrame: (yeah, this is Obj-C code).
If the screen gets reconfigured, my code tries to remember where the window was, and calls -setFrame: to put it back there. But in this case, macOS moves my window down out of the menu bar/notch area at the top of the screen.
Is there any way to prevent this behavior?
I've developed a specialized web server in Swift using Vapor. I want to set it up to run reliably on macOS using a LaunchDaemon. It should start at boot and be restarted if it crashes. I'm having trouble finding a good guide to the latest flavor of launchctl, and how to use system domains.
This is my plist:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Debug</key>
<true/>
<key>Label</key>
<string>com.latencyzero.FurnaceController</string>
<key>Program</key>
<string>/Users/rmann/Desktop/Run</string>
<key>ProgramArguments</key>
<array>
<string>serve</string>
<string>--hostname</string>
<string>0.0.0.0</string>
<string>--port</string>
<string>80</string>
</array>
<key>KeepAlive</key>
<true/>
<key>Listeners</key>
<dict>
<key>SockServiceName</key>
<string>http</string>
<key>SockType</key>
<string>tcp</string>
<key>SockFamily</key>
<string>IPv4</string>
</dict>
</dict>
</plist>
And I'm trying to invoke it like this:
$ sudo enable system/com.latencyzero.FurnaceController
But nothing happens. If I try kickstart, I get an error:
$ sudo launchctl kickstart -p system/com.latencyzero.FurnaceController
Could not find service "com.latencyzero.FurnaceController" in domain for system
$ sudo launchctl kickstart -p uid/501/com.latencyzero.FurnaceController
Unrecognized target specifier.
Usage: launchctl kickstart [-k] [-p] <service-target>
-k Terminates the service if it is already running.
-p Prints the PID of the service that was started.
-s Starts the service suspended so that a debugger may attach.
<service-target> takes a form of <domain-target>/<service-id>.
Please refer to `man launchctl` for explanation of the <domain-target> specifiers.
Bootstrap also doesn't work as I'd expect:
$ sudo launchctl bootstrap system/com.latencyzero.FurnaceController
Usage: launchctl bootstrap <domain-target> [service-path, service-path2, ...]
<service-target> takes a form of <domain-target>/<service-id>.
Please refer to `man launchctl` for explanation of the <domain-target> specifiers.
The plist is in /Library/LaunchDaemons/com.latencyzero.FurnaceController.plist
I'd rather not have to launch this in a user domain, as I'm handing this app off to my client, and the fewer customization needed, the better.
I've got a Game @StateObject in my app that's passed to my main ContentView. I'm trying to figure out how best create a SCNSceneRendererDelegate instance that has a reference to the Game state, and then pass that to the SceneView inside my ContentView.
I'm trying to do it like this, but obviously this doesn't work because self isn't available at init time:
struct
ContentView : View
{
let game : Game
var scene = SCNScene(named: "art.scnassets/ship.scn")
var cameraNode : SCNNode? { self.scene?.rootNode.childNode(withName: "camera", recursively: false) }
var rendererDelegate = RendererDelegate(game: self.game) // Cannot find 'self' in scope
var
body: some View
{
SceneView(scene: self.scene,
pointOfView: self.cameraNode,
delegate: self.rendererDelegate)
}
}
The intent is that in my renderer delegate, I'll update my game's simulation state. Because my game state is an ObservableObject, everything else (I have a bunch of SwiftUI) should update.
I'm not sure why, but it seems my Xcode project is trying to build for x86 (on my M1 Mac), even though both Debug and Release configurations have ONLY_ACTIVE_ARCH = YES. It's clearly trying to build for x86, as evidenced by the -target x86_64-apple-macos13.0 in the invocation. But I can't figure out why.
The full link stage output:
Ld /Users/me/Library/Developer/Xcode/DerivedData/MyProject-fbzxsemlztqkmsgdutlriortdmmd/Build/Products/Debug/MyProject.app/Contents/MacOS/MyProject normal (in target 'MyProject' from project 'MyProject')
cd /Users/me/Projects/MyProject
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -target x86_64-apple-macos13.0 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.0.sdk -L/Users/me/Library/Developer/Xcode/DerivedData/MyProject-fbzxsemlztqkmsgdutlriortdmmd/Build/Intermediates.noindex/EagerLinkingTBDs -L/Users/me/Library/Developer/Xcode/DerivedData/MyProject-fbzxsemlztqkmsgdutlriortdmmd/Build/Products/Debug -L/opt/homebrew/opt/llvm/lib -F/Users/me/Library/Developer/Xcode/DerivedData/MyProject-fbzxsemlztqkmsgdutlriortdmmd/Build/Intermediates.noindex/EagerLinkingTBDs -F/Users/me/Library/Developer/Xcode/DerivedData/MyProject-fbzxsemlztqkmsgdutlriortdmmd/Build/Products/Debug -filelist /Users/me/Library/Developer/Xcode/DerivedData/MyProject-fbzxsemlztqkmsgdutlriortdmmd/Build/Intermediates.noindex/MyProject.build/Debug/MyProject.build/Objects-normal/x86_64/MyProject.LinkFileList -dead_strip -Xlinker -object_path_lto -Xlinker /Users/me/Library/Developer/Xcode/DerivedData/MyProject-fbzxsemlztqkmsgdutlriortdmmd/Build/Intermediates.noindex/MyProject.build/Debug/MyProject.build/Objects-normal/x86_64/MyProject_lto.o -Xlinker -export_dynamic -Xlinker -no_deduplicate -fobjc-arc -fobjc-link-runtime -framework Cocoa -lcurses -lLLVMAnalysis -lLLVMBitReader -lLLVMCodeGen -lLLVMCore -lLLVMExecutionEngine -lLLVMMC -lLLVMObject -lLLVMRuntimeDyld -lLLVMScalarOpts -lLLVMSelectionDAG -lLLVMSupport -lLLVMTarget -lLLVMTransformUtils -lLLVMX86CodeGen -lLLVMX86Desc -lLLVMX86Info -lz -Xlinker -no_adhoc_codesign -Xlinker -dependency_info -Xlinker /Users/me/Library/Developer/Xcode/DerivedData/MyProject-fbzxsemlztqkmsgdutlriortdmmd/Build/Intermediates.noindex/MyProject.build/Debug/MyProject.build/Objects-normal/x86_64/MyProject_dependency_info.dat -o /Users/me/Library/Developer/Xcode/DerivedData/MyProject-fbzxsemlztqkmsgdutlriortdmmd/Build/Products/Debug/MyProject.app/Contents/MacOS/MyProject
ld: warning: ignoring file /opt/homebrew/opt/llvm/lib/libLLVMAnalysis.a, building for macOS-x86_64 but attempting to link with file built for macOS-arm64
ld: warning: ignoring file /opt/homebrew/opt/llvm/lib/libLLVMBitReader.a, building for macOS-x86_64 but attempting to link with file built for macOS-arm64
ld: warning: ignoring file /opt/homebrew/opt/llvm/lib/libLLVMCore.a, building for macOS-x86_64 but attempting to link with file built for macOS-arm64
ld: warning: ignoring file /opt/homebrew/opt/llvm/lib/libLLVMExecutionEngine.a, building for macOS-x86_64 but attempting to link with file built for macOS-arm64
ld: warning: ignoring file /opt/homebrew/opt/llvm/lib/libLLVMCodeGen.a, building for macOS-x86_64 but attempting to link with file built for macOS-arm64
ld: warning: ignoring file /opt/homebrew/opt/llvm/lib/libLLVMMC.a, building for macOS-x86_64 but attempting to link with file built for macOS-arm64
ld: warning: ignoring file /opt/homebrew/opt/llvm/lib/libLLVMRuntimeDyld.a, building for macOS-x86_64 but attempting to link with file built for macOS-arm64
ld: warning: ignoring file /opt/homebrew/opt/llvm/lib/libLLVMObject.a, building for macOS-x86_64 but attempting to link with file built for macOS-arm64
ld: warning: ignoring file /opt/homebrew/opt/llvm/lib/libLLVMX86Info.a, building for macOS-x86_64 but attempting to link with file built for macOS-arm64
ld: warning: ignoring file /opt/homebrew/opt/llvm/lib/libLLVMTarget.a, building for macOS-x86_64 but attempting to link with file built for macOS-arm64
ld: warning: ignoring file /opt/homebrew/opt/llvm/lib/libLLVMSupport.a, building for macOS-x86_64 but attempting to link with file built for macOS-arm64
ld: warning: ignoring file /opt/homebrew/opt/llvm/lib/libLLVMScalarOpts.a, building for macOS-x86_64 but attempting to link with file built for macOS-arm64
ld: warning: ignoring file /opt/homebrew/opt/llvm/lib/libLLVMSelectionDAG.a, building for macOS-x86_64 but attempting to link with file built for macOS-arm64
ld: warning: ignoring file /opt/homebrew/opt/llvm/lib/libLLVMTransformUtils.a, building for macOS-x86_64 but attempting to link with file built for macOS-arm64
ld: warning: ignoring file /opt/homebrew/opt/llvm/lib/libLLVMX86CodeGen.a, building for macOS-x86_64 but attempting to link with file built for macOS-arm64
ld: warning: ignoring file /opt/homebrew/opt/llvm/lib/libLLVMX86Desc.a, building for macOS-x86_64 but attempting to link with file built for macOS-arm64
ld: in '/opt/homebrew/opt/llvm/lib/libunwind.dylib', building for macOS-x86_64 but attempting to link with file built for macOS-arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
If I change the ARCHS to just arm64, then it builds fine.
What is BUNDLE_EXECUTABLE_FOLDER_PATH?
I came across this in a freshly-created iOS project (Xcode 14.2). In the unit tests target it created, it set TEST_HOST to
$(BUILT_PRODUCTS_DIR)/MyApp.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/MyApp
As far as I can tell, nothing sets BUNDLE_EXECUTABLE_FOLDER_PATH, and I can’t find it in any of the existing Xcode build settings. It's not set for Run Scripts, either, although these are close (and yes, this is an iOS project, not sure why one is MacOS):
export BUNDLE_EXECUTABLE_FOLDER_NAME_deep\=MacOS
export BUNDLE_EXTENSIONS_FOLDER_PATH\=Extensions
A project I created several years ago does not have the TEST_HOST predefined that way.
I'm migrating my app from Obj-C to Swift. It uses Core Data, and most of the entities are implemented in Obj-C. I just took a stab at converting one of my views to SwiftUI, and it runs correctly, but Preview crashes with
executeFetchRequest:error: A fetch request must have an entity..
I've tried declaring the fetch request both with and without the entity: argument:
@FetchRequest(entity: NewsItem.entity(), sortDescriptors: []) var newsItems : FetchedResults<NewsItem>
In the abominable new commit line diff view, I have no idea what the colors mean. Some text is highlighted in a cream color, other text in purple. Googling just turns up people hating the view, as I do. I haven't found anything in the Xcode docs that explains the coloring. Looking at my files, I think cream is a deleted line and purple is added lines. Is that right? Light mode.
My app is a login item that gets registered as a background agent using SMAppService. On launch it checks to see that the user has an active subscription, and when I run it from Xcode, this works fine.
But it seems that if I restart my machine and it is run from launchd right at login, StoreKit doesn't return any purchases. This results in my app throwing up a window to tell the user to subscribe.
It’s hard to be sure this is the behavior, because I can't really use a debugger, and for whatever reason, OSLog is not persisting messages (despite being configured to do so).
Does anyone know if it takes a while after restart or login for Store Kit to reliably return purchases?
It seems cross-device passkey authentication isn't supported by the Simulator, is that right? I can't tell if it's the simulator not supporting it, or my app/server failing.
My app, running in the Simulator, presents a QR code during sign-in flow. I scan that with my phone, and it just spins "connecting…".
Can anyone confirm that the Simulator just doesn't support this?
What are my options for testing this flow? I guess I need another device not sign in to my AppleID.
_IOW and friends, defined in <sys/ioccom.h>, help build ioctl() calls. Is there an equivalent function in Swift?
Topic:
App & System Services
SubTopic:
Core OS
I've run into a linker error, but when i go to look at the build transcript, all I see is an excessively formatted set of lines, with no way to see the linker command. There used to be a little icon you could click to see exactly what Xcode was trying to do.
Topic:
Developer Tools & Services
SubTopic:
Xcode
How is one supposed to use ShareLink(items:subject:message:)? It makes no sense to me. It accepts type Data for items. But Data's Element has to be String or URL or similar. How does this even work???
Topic:
UI Frameworks
SubTopic:
SwiftUI
Near as I can tell, Compression doesn't support LZW, is that right? I'm not sure if the available compression algorithms implicitly know how to decompress LZW.
FB14643019
I don't know why we’re up to Xcode 16 and this stuff is still so damn difficult.
First of all, I don't know why I can't just send a .app I built for my M1 MacBook Pro to my friend who also has an M1 MacBook Pro. But even after going through the quarantine steps, he gets an alert saying the app can't be opened.
So I'm trying to do direct distribution of an archive. But that gives me two errors:
There is a problem with the request entity
You already have a current Developer ID Application Managed (With Kext) certificate or a pending certificate request.
No profiles for 'com.latencyzero.VideoBox' were found
Xcode couldn't find any Developer ID provisioning profiles matching 'com.latencyzero.VideoBox'.
The signing is managed by Xcode. CloudKit access works.
Topic:
Code Signing
SubTopic:
General