macOS is the operating system for Mac.

Posts under macOS tag

200 Posts

Post

Replies

Boosts

Views

Activity

In SwiftUI on macOS, using instancing in RealityKit, how can I set individual colours per instance?
I have written this function: @available(macOS 26.0, *) func instancing() async -> Entity { let entity = Entity() do { // 1. Create a CustomMaterial let library = offscreenRenderer.pointRenderer!.device.makeDefaultLibrary()! let surfaceShader = CustomMaterial.SurfaceShader( named: "surfaceShaderWithCustomUniforms", // This must match the function name in Metal in: library ) let instanceCount = 10 // No idea how to actually use this... // let bufferSize = instanceCount * MemoryLayout<UInt32>.stride // // // Create the descriptor // var descriptor = LowLevelBuffer.Descriptor(capacity: bufferSize, sizeMultiple: MemoryLayout<UInt32>.stride) // // // Initialize the buffer // let lowLevelBuffer = try LowLevelBuffer(descriptor: descriptor) // lowLevelBuffer.withUnsafeMutableBytes { rawBytes in // // Bind the raw memory to the UInt32 type // let pointer = rawBytes.bindMemory(to: UInt32.self) // pointer[1] = 0xff_0000 // pointer[0] = 0x00_ff00 // pointer[2] = 0x00_00ff // pointer[3] = 0xff_ff00 // pointer[4] = 0xff_00ff // pointer[5] = 0x00_ffff // pointer[6] = 0xff_ffff // pointer[7] = 0x7f_0000 // pointer[8] = 0x00_7f00 // pointer[9] = 0x00_007f // } var material = try CustomMaterial(surfaceShader: surfaceShader, lightingModel: .lit) material.withMutableUniforms(ofType: SurfaceCustomUniforms.self, stage: .surfaceShader) { params, resources in params.argb = 0xff_0000 } // 2. Create the ModelComponent (provides the MESH and MATERIAL) let mesh = MeshResource.generateSphere(radius: 0.5) let modelComponent = ModelComponent(mesh: mesh, materials: [material]) // 3. Create the MeshInstancesComponent (provides the INSTANCE TRANSFORMS) let instanceData = try LowLevelInstanceData(instanceCount: instanceCount) instanceData.withMutableTransforms { transforms in for i in 0..<instanceCount { let instanceAngle = 2 * .pi * Float(i) / Float(instanceCount) let radialTranslation: SIMD3<Float> = [-sin(instanceAngle), cos(instanceAngle), 0] * 4 // Position each sphere around a circle. let transform = Transform( scale: .one, rotation: simd_quatf(angle: instanceAngle, axis: [0, 0, 1]), translation: radialTranslation ) transforms[i] = transform.matrix } } let instancesComponent = try MeshInstancesComponent(mesh: mesh, instances: instanceData) // 4. Attach BOTH to the same entity entity.components.set(modelComponent) entity.components.set(instancesComponent) } catch { print("Failed to create mesh instances: \(error)") } return entity } and this is the corresponding Metal shader typedef struct { uint32_t argb; } SurfaceCustomUniforms; [[stitchable]] void surfaceShaderWithCustomUniforms(realitykit::surface_parameters params, constant SurfaceCustomUniforms &customParams) { half3 color = { static_cast<half>((customParams.argb >> 16) & 0xff), static_cast<half>((customParams.argb >> 8) & 0xff), static_cast<half>(customParams.argb & 0xff) }; params.surface().set_base_color(color); } which works well and generates 10 red spheres. While listening to the WWDC25 presentation on what's new in RealityKit I am positive to hear the presenter saying that it is possible to customise each instance using a LowLevelBuffer, but so far all my attempts have failed. Is it possible, and if so how ? Thanks for reading and for your help. Kind regards, Christian
1
1
181
1d
Ditto cannot extract ZIP file into filesystem-compressed files
It's quite common for app bundles to be distributed in .zip files, and to be stored on-disk as filesystem-compressed files. However, having them both appears to be an edge case that's broken for at least two major releases! (FB19048357, FB19329524) I'd expect a simple ditto -x -k appbundle.zip ~/Applications (-x: extract, -k: work on a zip file) to work. Instead it spits out countless errors and leaves 0 Byte files in the aftermath 😭 Please fix.
4
0
192
1d
Capturing screen buffer at macOS Login Window with ScreenCaptureKit and PrivilegedHelper
I am developing a remote support tool for macOS. While we have successfully implemented a Privileged Helper Tool and LaunchDaemon architecture that works within an active Aqua session, we have observed a total failure to capture the screen buffer or receive input at the macOS Login Window. Our observation of competitor software (AnyDesk, TeamViewer) shows they maintain graphical continuity through logout/restart. We are seeking the official architectural path to replicate this system-level access. Current Technical Implementation Architecture: A root-level LaunchDaemon manages the persistent network connection. A PrivilegedHelperTool (installed in /Library/PrivilegedHelperTools/) is used for elevated tasks. Environment: Tested on macOS 14.x (Sonoma) and macOS 15.x (Sequoia) on Apple Silicon. Capture Methods: We have implemented ScreenCaptureKit (SCK) as the primary engine and CGDisplayCreateImage as a fallback. Binary Status: All components are signed with a Developer ID and have been successfully Notarized. Observed Behavior & Blockers The "Aqua" Success: Within a logged-in user session, our CGI correctly identifies Display IDs and initializes the capture stream. Remote control is fully functional. The "Pre-Login" Failure: When the Mac is at the Login Window (no user logged in), the following occurs: The Daemon remains active, but the screen capture buffer returns NULL or an empty frame. ScreenCaptureKit fails to initialize, citing a lack of graphical context. No TCC (Transparency, Consent, and Control) prompt can appear because no user session exists. The "Bootstrap" Observation: We have identified that the loginwindow process exists in a restricted Mach bootstrap namespace that our Daemon (running in the System domain) cannot natively bridge. Comparative Analysis (Competitor Benchmarking) We have analyzed established remote desktop solutions like AnyDesk and Jump Desktop to understand their success at the login screen. Our findings suggest: Dual-Context Execution: They appear to use a Global LaunchAgent with LimitLoadToSessionType = ["LoginWindow"]. This allows a child process to run as root inside the login window’s graphical domain. Specialized Entitlements: These apps have migrated to the com.apple.developer.persistent-content-capture entitlement. This restricted capability allows them to bypass the weekly/monthly TCC re-authorization prompts and function in unattended scenarios where a user cannot click "Allow." Questions Entitlement Requirement: Is the persistent-content-capture entitlement the only supported way for a third-party app to capture the LoginWindow buffer without manual user intervention? LaunchAgent Strategy: To gain a graphical context at the login screen, is it recommended to load a specialized agent into the loginwindow domain via launchctl bootstrap loginwindow ...? ScreenCaptureKit vs. Legacy: Does ScreenCaptureKit officially support the LoginWindow session, or does it require an active Aqua session to initialize? MDM Bypass: For Enterprise environments, can a Privacy Preferences Policy Control (PPPC) payload grant "Screen Recording" to a non-entitled Daemon specifically for the login window context?
1
0
42
2d
Notarization rejected with statusCode 7000 – Team not configured (new developer account)
I’m a newly enrolled Apple Developer Program member and am trying to notarize my first macOS app using notarytool. My enrollment is fully completed: Payment completed Free Apps and Paid Apps Agreements are Active Banking and tax (W-8BEN) are Active DSA compliance (EU) is Active However, every notarization submission is immediately rejected with: statusCode: 7000 “Team is not yet configured for notarization.” The rejection happens before any analysis (ticketContents is null), which suggests an account-level provisioning issue rather than a signing or app problem. I’ve already opened a Developer Programs Support case under: Development & Technical → Other Development or Technical Questions, and provided recent Job IDs for escalation. For developers who have encountered this recently: Is this typically resolved by Apple enabling Developer ID notarization on the backend? Is there anything else required from the developer side once agreements are active? Any confirmation or shared experience would be appreciated.
1
0
31
4d
What do you mean no release notes?
I just looked at the "release notes" for macOS 26.3 beta, and it said there were no notes. Imagine if you were getting your car checked, and the bill had an extra $1000 tacked on, with a line item that said "---". As a developer, this is bizarre. As a shareholder, this is dismaying.
0
0
120
4d
How to know when `NEPacketTunnelProvider` has been cleaned up?
I have noticed race conditions on macOS when tearing down and re-configuring an NEPacketTunnelProvider. My goal is to handle switching out one VPN profile for another identical/near identical one (I'll add some context for this below). The flow that I have tested was to wait for the NEVPNStatusDidChange notification to report a NEVPNStatus.disconnected state, and then start the process of re-configuring the VPN with a new profile. In practice however, I have noticed that I must wait a couple of seconds between NEVPNStatus.disconnected state being reported and setting up a new tunnel. Otherwise, the system routing table gets messed up but the VPN reports being in NEVPNStatus.connected state, resulting in a tunnel that appears healthy but can't be accessed. With this, I wanted to ask if you have any suggestions on any OS items I can observer, in order to deterministically know that the system has fully cleaned up my packet tunnel, and that I am safe to configure another? This would be much more optimal than a hard-coded delay. Additional context: Jamf is a common solution for deploying MDM configuration profiles. However, in my tests, it doesn't support Apple's recommended approach of using the PayloadIdentifier to mark profiles for replacement, as PayloadIdentifiers are automatically updated to match the PayloadUUID of that same profile on upload. Although given what I've observed, I'm not sure the Apple recommended approach would work here in any case. Additionally, it would be nice to transition from non-MDM to MDM cleanly, however, this also requires an indeterminate wait time between the non-MDM configuration being disconnected and subsequently removed, and the MDM one being configured. With these scenarios, we need to be able to add a second configuration, with possibly identical VPN settings, then remove the old one, allowing the system to transition to the new configuration. For the MDM case, the pattern I've noticed on the system is that when the current profile is suddenly deleted, the connection will go into disconnected state, then NEVPNConfigurationChange will fire. The new profile can be configured from NEVPNConfigurationChange, however some time is needed to avoid races. For non-MDM, I had experimented with an approach of polling for MDM configurations appearing. When they do, I'd remove my previous notification observers, and set up a new NEVPNStatusDidChange notification observer, to remove the non-MDM VPN configuration after. it enters a disconnected state. Following the removal, I would call a function to reconfigure the VPN with new configuration. When this logic is in place, the call to stopVPNTunnel() is made. Again, a hardcoded delay is required between stopping and removing the old configuration and setting up a new one. Thanks!
3
0
74
4d
"Application damaged and can't be opened' error prompt on 15.6.1 Sequoia
We have an application which keeps throwing the error "application is damaged and cannot be opened. You should move it to Trash" I have already referred to the documentation: https://developer.apple.com/forums/thread/706379 and https://developer.apple.com/forums/thread/706442 I have checked the following possible root causes: Codesign of the application using the codesign command Notarization of the application using the spctl command Executable permissions Checked for the presence of "com.apple.quarantine" flag for the application using xattr -l <path to executables" Checked the bundle structure None of the above listed items seemed to be a problem and are as expected. Can you please help us understand what could cause this issue and how to resolve this without recommending an uninstall/reinstall of the application?
22
0
2.3k
4d
Direct9 / Support faster floating point instructions - xrosetta87
As the title states, I’ve been trying to emulate some older Direct9 games, and rosetta can’t handle it because of that https://github.com/WineAndAqua/rosettax87 I’ve had to use this, but it really seems like something that I shouldn’t have to do I’ve tried Wineskin, wine, D9VK, MoltenVK, GPTk, and the only thing that’s close to working is using devel wine + d9vk with the xrosetta87 running like its a VPN, and then you play Without xrosetta87 it’s 0-0.5 FPS? with it, it’s like a buttery smooth 60+
1
0
52
5d
Mac Studio: Continuity Camera unavailable after reboot unless USB camera is connected
Summary On Mac Studio systems (no built-in camera), macOS does not initialize camera services after a normal reboot if no physical camera is present. As a result, Continuity Camera does not appear anywhere in the system. Observed behavior System Information → Camera reports “No video capture devices were found.” Continuity Camera (iPhone) is completely absent from camera lists. Plugging in any USB UVC webcam immediately initializes camera services and causes both the USB camera and the iPhone (Continuity Camera) to appear. The USB camera can then be unplugged and Continuity Camera continues working until the next reboot. Reproduction steps Use a Mac Studio (no built-in camera) on recent macOS. Ensure no USB webcam or external camera is connected. Reboot the Mac normally. After login, open System Information → Camera. Expected Camera services should initialize even when no physical camera is present, allowing Continuity Camera to be available as the primary camera. Actual No camera devices are present unless a physical USB camera is connected at least once after boot. This reproduces 100% of the time on Mac Studio and appears to be a camera service bootstrap issue where Continuity Camera cannot be the first camera device. Issue has been filed via Feedback Assistant.
1
0
50
5d
Credential Provider Extension should allow BE=0, BS=0 for device-bound passkeys
In these threads, it was clarified that Credential Provider Extensions must set both Backup Eligible (BE) and Backup State (BS) flags to 1 in authenticator data: https://developer.apple.com/forums/thread/745605 https://developer.apple.com/forums/thread/787629 However, I'm developing a passkey manager that intentionally stores credentials only on the local device. My implementation uses: kSecAttrAccessibleWhenUnlockedThisDeviceOnly for keychain items kSecAttrTokenIDSecureEnclave for private keys No iCloud sync or backup These credentials are, by definition, single-device credentials. According to the WebAuthn specification, they should be represented with BE=0, BS=0. Currently, I'm forced to set BE=1, BS=1 to make the extension work, which misrepresents the actual backup status to relying parties. This is problematic because: Servers using BE/BS flags for security policies will incorrectly classify these as synced passkeys Users who specifically want device-bound credentials for higher security cannot get accurate flag representation Request: Please allow Credential Provider Extensions to return credentials with BE=0, BS=0 for legitimate device-bound passkey implementations. Environment: macOS 26.2 (25C56), Xcode 26.2 (17C52)
0
0
526
5d
Orphaned 9GB Simulator Runtime in /System/Library/AssetsV2 - Cannot Delete (SIP protected)
I have an orphaned asset folder taking up 9.13GB located at: /System/Library/AssetsV2/com_apple_MobileAsset_iOSSimulatorRuntime/c0d3fd05106683ba0b3680d4d1afec65f098d700.asset It contains SimulatorRuntimeAsset version 18.5 (Build 22F77). Active Version: My current Xcode setup is using version 26.2 (Build 23C54). I checked the plist files in the directory and found what seems to be the cause of the issue: The "Never Collected" Flag: The Info.plist inside the orphaned asset folder explicitly sets the garbage collection behavior to "NeverCollected": <key>__AssetDefaultGarbageCollectionBehavior</key> <string>NeverCollected</string> The Catalog Mismatch: The master catalog file (com_apple_MobileAsset_iOSSimulatorRuntime.xml) in the parent directory only lists the new version (26.2). Because the old version (18.5) is missing from this XML, Xcode and mobileassetd seem to have lost track of it entirely. What I Have Tried (All Failed) Xcode Components: The version 18.5 does not appear in Settings -> Components, so I cannot delete it via the GUI. Simctl: xcrun simctl list runtimes does not list this version. Running xcrun simctl runtime delete 22F77 fails with: "No runtime disk images or bundles found matching '22F77'." Manual Deletion: sudo rm -rf [path] fails with "Operation not permitted", presumably because /System/Library/AssetsV2 is SIP-protected. Third-party Tools: Apps like DevCleaner do not detect this runtime (likely because they only scan ~/Library or /Library, not /System/Library). Has anyone found a way to force the system (perhaps via mobileassetd or a specific xcrun flag) to re-evaluate this folder and respect a deletion request? I am trying to avoid booting into Recovery Mode just to delete a cache file. Any insights on how AssetsV2 handles these "orphaned" files would be appreciated.
5
3
321
6d
How does font caching / resources for each app work?
I'm a font developer. In the development process, I will revise a font and overwrite the OTF file that is currently enabled (registered) with macOS. If I then launch an app, it will immediately use the revised version of the font; while apps that are already loaded will continue to use the old version. This suggests that each app is loading new and separate font data, rather than getting it from some existing cache in memory. Yet macOS does have a "font cache" of some sort. Some apps, like TextEdit, seem to only load the fonts that they need to use. However, other apps, like Pages, load every enabled (registered) font on the OS!! (According to the Open Files list in Activity Monitor.) Given that /System/Library/Fonts/ is 625 Mb, and we can't disable any of it, isn't that a lot of data to be repeating? How many fonts is too many fonts? I can't find much documentation about the process.
1
0
624
6d
Cannot see appended AttributedString in NSTextView
When I appendAttributedString to [textView textStorage] it does not appear on the scrollable TextView. However when I NSLog the [textView textStorage] the Attributed string is outputted, and is therefore stored in the textView, see below. Occurs every time I ask to see the AttributedString I send to the textView. [textView textStorage] attributedString I need to see the attributedString displayed on the ScrollableTextView, but I don't know why I cannot see it.
2
0
382
1w
Embedding self-built WebKit framework in Mac app
I'm trying to embed a self-built copy of the WebKit frameworks to a macOS app. Most importantly I hope to get some features to work which Safari offers, but WKWebView in macOS doesn't (getDisplayMedia, Service Workers, WebInspector). Many years ago I was successful in using a self-built WebKit copy in this Mac app, but it seems the WebKit framework got more complex since them, I guess because of WKWebView's architecture. That time I had to open the projects for the main frameworks in Xcode, select the framework bundle in the target and change the "Installation Directory" setting to the path @executable_path/../Frameworks. After building WebKit using the build script, I could use otool -L to confirm the changed installation path, which then was displayed for example as @executable_path/../Frameworks/WebCore.framework/Versions/A/WebCore I tried the same with a current WebKit build: I copied the products for WebKit.framework, WebCore.framework, JavaScriptCore.framework, WebKitLegacy.framework, WebGPU.framework and WebInspectorUI.framework to my app and added it to the "Frameworks, Libraries and Embedded Content" section in the Project's Target/General tab and selected "Embed & Sign" for each framework. In "Build Phases" I made sure that WebCore.framework and WebGPU.framework are only in the "Copy Files" phase (Destination Frameworks) and not in "Link Binary with Libraries", as WebCore is linked through the WebKit umbrella framework and WebGPU gave another error (not sure about how to deal with that framework, as in the system it's in a PrivateFrameworks subfolder). In "Build Settings" I made sure that @executable_path/../Frameworks is entered for "Runpath Search Paths" (it was already probably because of Cocoapods, together with @loader_path/../Frameworks. When I build my app, the system's WebKit version is used. Only when I add the environment variable DYLD_FRAMEWORK_PATH with value @executable_path/../Frameworks in the run scheme, the embedded self-build WebKit frameworks are used. Because of currently necessary backward compatibility my app can use the legacy WebView or WKWebView. The legacy WebView works perfectly with the embedded WebKitLegacy.framework. But if I try to open any URL in WKWebView, no content is rendered and in the console output I can see: Safe Exam Browser[21391:145678] [Process] 0x10c67d760 - [PID=0] WebProcessProxy::didFinishLaunching: Invalid connection identifier (web process failed to launch) Safe Exam Browser[21391:145678] [Process] 0x10c67d760 - [PID=0] WebProcessProxy::processDidTerminateOrFailedToLaunch: reason=4 Safe Exam Browser[21391:145678] [ProcessSuspension] 0x10c005040 - [PID=0, throttler=0x10c67d8d8] ProcessThrottler::Activity::invalidate: Ending background activity / 'WebProcess initialization' Safe Exam Browser[21391:145678] [Process] 0x10c67d760 - [PID=0] WebProcessProxy::shutDown: Safe Exam Browser[21391:145678] [Process] 0x7fbe89064020 - [pageProxyID=40, webPageID=41, PID=0] WebPageProxy::processDidTerminate: (pid 0), reason 4 2022-02-14 12:53:01.764074+0100 Safe Exam Browser[21391:145678] [Process] 0x10c67d760 - [PID=0] WebProcessProxy::processTerminated: Safe Exam Browser[21391:145678] [Loading] 0x7fbe89064020 - [pageProxyID=40, webPageID=41, PID=0] WebPageProxy::dispatchProcessDidTerminate: reason=Crash Safe Exam Browser[21391:146842] [SEBOSXWKWebViewController webViewWebContentProcessDidTerminate:<Safe_Exam_Browser.SEBOSXWKWebView: 0x7fbe88f8b1c0>] I have the impression that the web process might fail to launch because I didn't embed all necessary parts of the self-built WebKit (the product folder contains a large number of XPC, dylib and .a files). Or some additional paths have to be adjusted before building WebKit, so that the embedded frameworks/libraries are used and not the system provided ones. I also looked at the bundle of the Safari Technology Preview and can see some similarities but also differences. I would be grateful if anybody could provide me with information how to embed a self-built copy of WebKit into a macOS app. Unfortunately I didn't find any Mac open source browser using an embedded copy of WebKit to get some inspiration from.
6
1
2.1k
1w
Xcode Simulator causes Mac audio crackling and distortion
[Submitted as FB20950954] Xcode Simulator causes crackling and distortion in audio playback across all apps (Apple Podcasts, Music, third-party). REPRO STEPS Open any audio app and start playback Note the audio quality Launch Xcode Simulator After a few seconds, note audio quality again Quit Xcode Simulator Audio returns to normal CURRENT Audio has crackling and distortion while Simulator is running. EXPECTED Clean audio playback regardless of whether Simulator is running. SYSTEM INFO macOS 26.1 (25B78) Xcode 26.1 (17B55) Simulator 26.0 (1058)
3
2
252
1w
Guidance request: Apple-recommended approach for major/minor macOS updates on MDM-managed Macs (startosinstall vs MDM/DDM)
Background / Objective We are currently developing a solution to centrally manage Apple OS updates (major and minor) across managed macOS devices. Before implementing at scale, we need Apple’s guidance on supported and future-proof update mechanisms under MDM. Questions / Ask (Apple Guidance Requested) Apple recommended method What is Apple’s recommended approach to perform: Minor updates (e.g., macOS X.Y → X.Z) Major upgrades (e.g., Ventura → Sonoma) in an enterprise fleet? Support boundary Is macOS update management only supported via MDM (including any newer declarative workflows), or are local mechanisms (installer + command-line tooling) also considered supported for enterprise automation? Use of startosinstall Can we leverage the existing utility: /Applications/Install macOS .app/Contents/Resources/startosinstall for automated upgrades in enterprise environments? If yes, are there recommended flags/workflows Apple endorses for unattended or minimally interactive upgrades? Long-term support / stability Does startosinstall have any form of long-term support / stability guarantees across future macOS releases? Are there any known deprecations planned (or guidance that customers should transition to MDM/DDM workflows)? MDM interaction / interference When using startosinstall, can MDM policies (software update deferrals/restrictions, update enforcement, etc.) interfere with or block the upgrade? If interference is expected, what is the correct supported way to coordinate: MDM software update settings local startosinstall execution to avoid failures and ensure compliance? What We Need From Apple (Desired Outcome) A clear statement of recommended and supported update workflow(s) for enterprise managed macOS: for minor updates for major upgrades Guidance on whether startosinstall is acceptable for long-term automation, or whether we should only use MDM/DDM-driven workflows. Any best practices or reference documentation Apple recommends for implementing this safely and reliably.
0
0
1.2k
1w
startosinstall “Helper tool crashed…” when upgrading macOS with MDM OS update restrictions — request Apple-recommended update method for MDM-managed Macs
We are upgrading macOS (minor versions and potentially major versions) using a scripted approach: Install the InstallAssistant package via installer Trigger OS install via startosinstall On MDM-managed assets, OS update policies appear to prohibit or interfere with the update flow. The update often fails with startosinstall reporting “Helper tool crashed…” during the “Preparing” phase. Steps to Reproduce On an MDM-enrolled Mac with OS update restriction/deferral policies applied, run: sudo /usr/sbin/installer -pkg /Path/To/InstallAssistant.pkg -target / && echo 'MACOS_PASSWORD' | /Applications/Install\ macOS\ Sonoma.app/Contents/Resources/startosinstall --agreetolicense --forcequitapps --stdinpass --user MACOS_USER Actual Result Package installation reports success, but startosinstall fails during preparation with: Standard Output installer: Package name is macOS15.7_SoftwareUpdate installer: Upgrading at base path / installer: The upgrade was successful. By using the agreetolicense option, you are agreeing that you have run this tool with the license only option and have read and agreed to the terms. If you do not agree, press CTRL-C and cancel this process immediately. Preparing to run macOS Installer... Preparing: 0.0% Preparing: 0.1% ... Preparing: 24.9% Standard Error Helper tool crashed... notes.log Install.log is also attached. Questions for Apple / Ask: We suspect this crash is caused by MDM OS update restrictions/policies. We need Apple’s recommended method to perform macOS updates (minor + major) when MDM is present, especially in environments where update deferrals/restrictions may be configured.
0
0
1.2k
1w