macOS is the operating system for Mac.

Posts under macOS tag

200 Posts

Post

Replies

Boosts

Views

Activity

UITableView row reordering no longer works under macOS 27 with Mac Catalyst
Under macOS 27 using Mac Catalyst for a UIKit-based app, If you present a view controller with a table view as a form sheet or page sheet, row reordering fails to function. You can drag a row as expected but the blue movement bar never appears and if you drop the row it simply returns to its original location. The exact same view controller presented as a popover works just fine. The exact same view controller not presented as a modal (such as the app's root controller) works just fine. This is a serious bug affecting existing applications and being reported by paying customers. This has been reported as FB25038883 which includes a simple sample app demonstrating the issue.
1
0
383
1h
macOS 27 beta: every OS update fails — MobileSoftwareUpdate 1259 "failed to copy firmware identity" (orphaned iSCPreboot volume-group dir) — FB24342236
Every macOS update fails during preflight personalization on my MacBook Pro (Mac15,6, Apple Silicon), currently on 27.0 build 26A5378j. It's failed on every build from beta 5 (26A5406e) through beta 7. Identical failure via Software Update and via startosinstall. It fails LOCALLY, before contacting Apple (gs.apple.com and gdmf.apple.com are both reachable with valid certs). Error (install.log + unified log): reaches PREFLIGHT_PERSONALIZE (~0.15), then aborts MobileSoftwareUpdateErrorDomain Code=1259 "failed to copy firmware identity" "could not obtain device identity information through SFR installer" SUMacControllerErrorPreflightPersonalizeFailed=7723 Root cause I've traced: an orphaned volume-group boot-policy directory in /System/Volumes/iSCPreboot/. ls shows two volume-group UUID dirs — the live one (matches diskutil info /) and an orphan (3D3287DE-...) with no corresponding APFS volume group (diskutil apfs list shows only one live group). Both date to Feb 2024. The preflight can't reconcile the System Recovery boot policy in the orphaned dir. Note: NOT caused by Erase All Content and Settings (unlike the commonly reported case). The orphan predates the beta, so any pre-existing second volume-group boot-policy directory reproduces it. It was harmless for ~2 years; macOS 27's stricter preflight rejects it. Ruled out (no effect): disk space, VPN, DNS, clock, Apple Account, refreshing the beta seed entitlement, reboot, Time Machine, re-downloading the installer, and Recovery reinstall (same 1259). Filed as FB24342236 — no response across beta 5, 6, 7. Questions: Is this a known issue with a planned fix, and in which build? Any supported recovery path that does NOT require a second Mac? (Recovery reinstall fails the same way.) Or is DFU Revive/Restore the only option? Will the public 27.0 release install on this machine, or hit the same preflight?
6
1
892
8h
Is it possible to programmatically disable USB-C VBUS power on Apple Silicon Macs?
I'm developing a native macOS menu-bar utility that aims to toggle USB power to an iPhone connected directly to a MacBook Pro. Hardware: MacBook Pro with M2 Pro iPhone 13 connected via USB-C to Lightning No external hubs or adapters Goal: I want to temporarily stop the iPhone from charging without physically disconnecting the cable, then restore charging programmatically. Losing the USB data connection while power is disabled is completely acceptable. What I've investigated: uhubctl doesn't expose the built-in USB-C ports as controllable in my setup. IOKit and USBDriverKit provide USB device management, but I haven't found a supported method to disable physical VBUS. I found IOUSBHostCIMessageTypePortPowerOff, but it appears to relate to host-controller interfaces rather than controlling Apple's existing USB-C hardware. My questions: Is there any supported API or system-level mechanism for disabling VBUS on a MacBook's built-in USB-C port? Can the USB-C Power Delivery controller be instructed to stop supplying power without physically disconnecting the device? Alternatively, is there a supported mechanism for requesting that a connected iPhone temporarily stop drawing charging current? I'm open to lower-level macOS development if necessary, but I'd like to understand whether this is technically possible before pursuing it. Any insight from Apple engineers or developers familiar with Apple Silicon USB controllers would be greatly appreciated.
2
0
86
10h
CometCal not working with Siri AI on macOS ?
Hello 👋, We finally gets our hands-on Siri AI here in France on macOS 27.2 As a macOS developer supporting App Intents into my app I would like to add App Schema to my AppIntent / AppEntity to make them available through Siri AI in my next release. So I've started by downloading the CometCal app and add a target for macOS (because I supposed the existing Mac Catalyst target provided was not supported by Siri AI ?). On my machine CometCal does not work with Siri AI. It either fail or repond it cannot do the action. Doing those actions (Find event, Create event, ...) in Apple Shortcut works just fine. Do I miss something specific on macOS ? A specific configuration or something ? Is Siri AI supposed to work on macOS as I tried to ? (I also tried making a Release build or moving the app into /Applications) NB: I don't have a Siri AI compatible iPhone (+ blocked in Europe) to run CometCal on iOS to compare with. Thanks,
0
0
60
15h
Supported diagnosis for posix_spawn EPERM when launching a sandboxed local QA host
On macOS 15.7.9 (24G830), arm64, using Xcode 16.4 (16F6), a locally built QA host fails to launch through LaunchServices using open -W. The recorded signature is ad hoc, with no TeamIdentifier; its only recorded effective entitlement is com.apple.security.app-sandbox=true. The historical launch returned -10810. Correlated logs report posix_spawn: Operation not permitted (errno 1). Host entry was not observed. A packaging revision embedded the same Info.plist in __TEXT,__info_plist. Recorded signature verification succeeded, but the next launch produced the same rejection. The responsible policy remains unidentified; these observations are not an independently validated minimal reproducer. What supported diagnostic procedure can identify the policy responsible for this rejection without disabling security protections or using an alternative launch route?
1
0
89
16h
Location Services stopped working across the system on macOS
MacBook Air (M4) Current build: macOS 27 Developer Beta (26A5368g) I have a system-wide Location Services failure affecting Apple Maps, Safari geolocation APIs, and any application requesting the current location. Symptoms: Apple Maps cannot determine current location. Safari and browser geolocation APIs fail. Websites report that location cannot be found. Location Services are enabled and permissions are granted. The issue has persisted across: macOS 26.5 beta macOS 26.6 beta macOS 26.6 beta 2 macOS 27 Developer Beta Troubleshooting already performed: Multiple Wi-Fi networks tested. iPhone hotspot tested. VPN enabled and disabled. Location Services reset. Permissions reset and reauthorized. New clean local user account created (no Apple ID, no third-party software). Issue reproduces identically in the clean account. Technical observations: locationd logs repeatedly show: knownCount = 0 AlsWifi = unknown while Wi-Fi scanning itself appears successful: queryMacAddresses.size = 57 The system sees dozens of nearby access points, but none appear to be recognized for Wi-Fi positioning. Additional findings: Wi-Fi hardware functions normally. Internet connectivity is normal. Bluetooth and Find My device presence work. GeoServices resources are present on disk. No successful location fix is ever produced. Has anyone seen similar CoreLocation / GeoServices behavior where Wi-Fi scans succeed but knownCount always remains 0 and no location fix is generated?
11
2
2k
1d
How to Programmatically Install an iOS App on USB-Connected iPhones from a macOS Application?
Hello Apple Developer Community, We are developing a hardware diagnostic solution consisting of a macOS desktop application and a companion iOS application. Our iOS application is currently distributed through Apple TestFlight for testing purposes. The application installs and functions correctly when users download it manually through TestFlight. However, we are facing an issue when attempting to automatically install the same iOS application onto iPhones connected to our macOS application via USB. Our Intended Workflow A user connects one or multiple iPhones to a Mac using USB cables. Our macOS application automatically detects the connected devices. The macOS application initiates installation of our iOS diagnostic application onto the connected iPhones. The iOS application performs hardware diagnostic tests. Test results are transferred back to the macOS application. Once testing is completed, the iOS application can be removed from the connected devices. Current Issue When installing the iOS application manually through TestFlight, everything works correctly. However, when attempting to install the application programmatically from our macOS application over USB, we encounter a developer recognition or trust-related error. Our objective is to support commercial hardware diagnostic testing on customer-owned iPhones without requiring users to manually install the application, enable Developer Mode, trust developer certificates, or register individual device UDIDs. Questions Is there an officially supported Apple API, framework, or method that allows a macOS application to programmatically install an iOS application onto USB-connected iPhones? Is this functionality available for applications distributed through TestFlight, or does it require an App Store production release? Can installation be initiated on customer-owned, unmanaged iPhones without requiring Developer Mode, manual certificate trust, or device registration? Are there specific code-signing, provisioning profile, or distribution requirements for installing an iOS application through USB? Does Apple provide a supported solution for deploying diagnostic applications to multiple USB-connected iPhones simultaneously? If direct USB installation is restricted, what alternative Apple-supported workflow would be recommended for commercial device diagnostic and refurbishment applications? Additional Information Our iOS diagnostic application and macOS desktop application have already been developed, and the core diagnostic functionality is working. The remaining challenge is determining the correct Apple-supported method for installing the iOS companion application automatically onto connected devices. We would appreciate guidance from Apple engineers or developers who have experience with USB-based iOS application deployment, device management, or commercial diagnostic solutions. Thank you for your assistance.
3
0
764
1d
macOS application renaming
Hello, We are developing a macOS application with many different components that are required for our business features. We distribute the product outside the App Store and sign it with our Developer ID certificate. Rebranding an app is a rare case, but sometimes it happens. My question is: Does Apple have any guide or recommendations on how to rebrand an app properly, other than distributing a completely new product? I am asking because our application has a complex structure: UI app (MyApp1, bundle ID = com.myApp1.osx.app) Helper tool (MyApp1HelperTool, bundle ID = com.myApp1.osx.HelperTool) Privileged daemon (MyApp1Daemon, bundle ID = com.myApp1d) System Extension, Transparent Proxy (MyApp1Proxy, bundle ID = com.myApp1.osx.proxy) As you can see, the brand name is used not only in the bundle and product names, but also in the bundle IDs. At some point, I need to change the product name from MyApp1 to MyApp2. Ideally, I would also like to change the bundle IDs to match the new brand. After rebranding, end users should not see MyApp1 anywhere in the system, only MyApp2. Also, components that are already installed and approved (System Extension, proxy configuration, helper tool, etc.) should stay approved. We would like to avoid showing the approval prompts again to all our end users. I did some research and found that bundle IDs technically cannot be changed. To solve this, I would need to release a new app and implement an in-app update mechanism that updates MyApp1 to MyApp2. However, even with a new app and an in-app update mechanism, I did not find a way to avoid user prompts for approving the new extension, the proxy, and possibly the privileged helper tool. For macOS, these will be new components that require explicit user approval. MDM is not a solution for us: some of our customers use MDM, but many of them do not. We want the update to be as smooth as possible. Thank you!
4
0
172
1d
Creating playgrounds from a template does nothing
Attempts to create Swift Playgrounds from the built-in templates fail. Clicking the “Get” button on these templates appears to download something, but it changes back into a “Get” button afterwards without creating a playground. Furthermore, the Swift versions of the templates seem to be behind; it shows Swift 5.8 and Swift 5.9 editions whereas it should be Swift 6.x Steps to Reproduce Start the Swift Playground app (the standalone app, not the Xcode one, on macOS or iPadOS). Select “Learn to Code” Choose the “Get Started With Code” template (or any other template will do). Click the Get button. Wait until the Get button becomes a circular progress indicator. Expected Results A new Swift Playground should be created from the selected template. Actual Results The Get button changes into a circular progress indicator and then changes back. No Playground gets created. Versions Swift Playground 4.7 (2088) macOS 26.4.1 (25E253) iPadOS 26.4.2
3
1
1.4k
1d
PDF Widget Annotations appear Pixelated/Rasterized
The Problem On opening a PDF document in the Preview app, PDF widget annotations appear pixelated/rasterized. This problem exists with button, text, and choice widget subtypes. The pixelation becomes more apparent when zoomed in. Expected Results PDF widgets should appear sharp and smooth, without pixelation. In previous versions of the Preview app, widgets appear vector-based as expected. Impact on User Experience PDF widgets appear pixelated and inconsistent with text content in the same PDF document. Widgets do not look like elements of an interactive form but, instead, resemble low-quality embedded images. Affected Apps/OSs: Preview 11.0 (1147), as well as other apps that use PDFKit, on macOS Golden Gate 27.0 (26A428). A similar problem appears to affect PDFKit on iOS 27.0 and iPadOS 27.0 as well. Feedback/bug report: FB24843022
7
2
1.3k
1d
PDF Widget Annotations Disappear After Saving in PDFKit (including with Preview)
The Problem When a user toggles radio buttons or checkboxes in a PDF using Preview, the widgets disappear following subsequent interactions after the file is saved and reopened. This renders the form fields unusable. Steps to Reproduce the Problem Open a PDF with radio buttons or checkboxes in Preview. Toggle a radio button or checkbox. Save and close the file. Re-open the PDF in Preview. Toggle the same button again. The button (and any others with the same field name) will disappear. Expected Results Toggling a radio button or checkbox should update the field value without causing the button (or related buttons) to disappear. This behavior is consistent with previous versions of PDFKit. What is Happening In Preview, interacting with radio buttons and checkboxes correctly updates their appearance as expected. Saving the PDF, however, causes the appearance dictionary to reference a new N entry that is a single appearance stream unassociated with any state. The annotation's AS entry is not updated. The original N entry remains but is no longer referenced. Subsequent interactions fail to update the visual presentation because the appearance stream is missing. Impact on User Experience Radio buttons and checkboxes may disappear and become unusable when toggled. PDF documents become irreparably altered after a button is toggled and the file is saved. PDF file size significantly increases when the file is saved. Users may believe they have successfully completed a form, only for the data to become inaccessible or invisible to recipients. Forms may need to be completely restarted or recreated from scratch if the original becomes unusable. The corrupted PDF structure might cause the file to render incorrectly or crash in third-party PDF viewers. Affected Apps/OSs Tested with Preview 11.0 (1147), as well as other apps that use PDFKit, on macOS Golden Gate 27.0 (26A428). This problem also affects PDFKit on iOS 27.0 and iPadOS 27.0. Feedback/bug report: FB24866826 Related Sample Output Original PDF File Checkbox widget annotation (6 0 obj), its appearance dictionary (17 0 obj), and normal appearance dictionary (18 0 obj). Button is not checked. 6 0 obj << /Border [ 0 0 0 ] /Rect [ 90 390 110 410 ] /T (button1) /F 4 /Subtype /Widget /DA (/.AppleSystemUIFont 13 Tf 0 g) /MK 16 0 R /C [ 0 ] /AP 17 0 R /V /Off /M (D:20260919225320Z00'00') /AS /Off /FT /Btn /Type /Annot /Ff 0 >> endobj 17 0 obj << /N 18 0 R >> endobj 18 0 obj << /Yes 20 0 R /Off 22 0 R >> endobj PDF File after Save Checkbox widget annotation object (6 0 obj), its new appearance dictionary object (8 0 obj), a new normal appearance stream object (20 0 obj), and the original appearance stream dictionary (now 21 0 obj). File saved after user checked button. 6 0 obj << /Ff 0 /Type /Annot /AS /Off /AP 8 0 R /MK 9 0 R /C [ 0 ] /FT /Btn /M (D:20260919225320Z00'00') /DA (/.AppleSystemUIFont 13 Tf 0 g) /Subtype /Widget /F 4 /Border [ 0 0 0 ] /Rect [ 90 390 110 410 ] /T (button1) /V (Yes) >> endobj 8 0 obj << /N 20 0 R >> endobj 20 0 obj << /Filter /FlateDecode /Resources << /ColorSpace << /CS1 [ /ICCBased 29 0 R ] /CS2 [ /ICCBased 30 0 R ] >> >> /BBox [ 0 0 20 20 ] /Type /XObject /Subtype /Form /Length 123 >> stream x UéA ¬0 Ô}≈|†≈nà¢úÛÇ* —SA =}Ïr(»ñµ≤w◊€YËà’|ÙÎŒç'óRï∂#SäÏÌü∞¢S‰Ì§ôRÌX }–É•åY Éçˆ BŒ H " *â´8™ˆZø6z⁄ÿ ”ú6ɀ੠"∫t˘‹;'¬ endstream endobj 21 0 obj << /Off 22 0 R /Yes 23 0 R >> endobj Note: No object references 21 0 obj in the PDF.
4
0
765
1d
URL Filter fails on macOS 27.2 beta: privacy-proxy failure on PIR status request
On macOS 27.2 beta 1/2 our URL filter never starts: the session loops starting -> stopping. The same build works on macOS 27.0 (26A428). Both our TestFlight and notarized standalone builds fail. Prefilter and PIR registration succeed. The PIR status request then fails: NWPath is satisfied, the connection is configured proxy fail closed, proxy strict fail closed, the proxy fails (event: proxy:children_failed), and the error is NSURLErrorDomain -1009 / POSIX 50 "Network is down" with _NSURLErrorPrivacyProxyFailureKey=true. NEMembershipCheckerErrorDomain Code=3 -> NEAgentURLFilterErrorDomain Code=3; the app sees serverSetupIncomplete. The privacy-proxy allow-list entry is identical on macOS 27.0 and 27.2 beta (com.adguard). Disabling the VPN, rebooting, and recreating the URL filter configuration do not help. Log excerpt: neagent: updatePrefilterWithCompletionHandler - result 1 neagent: <NEPIRChecker> - Register with PIR Server (group <com.adguard.safari.AdGuard> ... PrivacyProxyFailOpen <0> ...) -> completed registration ciphermld: [C3 ...] proxy fail closed, proxy strict fail closed ciphermld: [C3.1.1 ... failed proxy (satisfied (Path is satisfied), interface: en0[802.11], ipv4, dns, uses wifi, flow divert agg: 2, LQM: good)] event: proxy:children_failed ciphermld: queryStatus: NSURLErrorDomain -1009 / POSIX 50 "Network is down", _NSURLErrorPrivacyProxyFailureKey=true, NWPath=satisfied neagent: Failed to startFilter <Error Domain=NEMembershipCheckerErrorDomain Code=3 "(null)"> nesessionmanager: NEURLFilterPlugin(com.adguard.safari.AdGuard[url-filter][inactive]): setStatus:error: - err Error Domain=NEAgentURLFilterErrorDomain Code=3 Filed as FB24933164.
7
2
658
2d
Supported API for native Thunderbolt host-to-host communication?
I'm looking into direct communication between a Mac and a Linux machine connected over Thunderbolt. Thunderbolt networking works fine, but I'd like to explore whether it's possible to transfer data using native Thunderbolt DMA, without going through the TCP/IP stack. I've looked through the IOKit and DriverKit documentation, but most of what I've found relates to drivers for PCIe devices connected over Thunderbolt rather than communication between two hosts. A couple of questions: Is there a supported API for discovering Thunderbolt XDomain services and establishing native DMA-backed send/receive paths between hosts? Can this be done from userspace or DriverKit, or would it require a kernel extension? Ideally, I'd also like to keep the existing Thunderbolt networking interface working alongside it. Any pointers to relevant APIs or documentation would be appreciated. Thanks!
2
0
222
2d
Supported API for managing an iPhone/iPad Home Screen from a sandboxed macOS app
Hello, I’m developing a native macOS application intended for Mac App Store distribution, with App Sandbox enabled. The intended feature is to let users connect their personal iPhone or iPad via USB, read the existing Home Screen layout, rearrange app icons and folders on the Mac, and apply the user-approved layout back to the device. The target devices are ordinary, non-supervised consumer devices, without MDM enrollment. Our current prototype detects the connected iPhone through public IOKit registry APIs. It does not access the Home Screen layout or modify the device. I have reviewed USB access entitlements and the device-management HomeScreenLayout payload, but have not identified a public API for this consumer-device workflow. Is there a public, supported API or documented integration mechanism for reading and updating these Home Screen layouts from a sandboxed macOS app? If supported, which framework and entitlements should we use? We would also need to understand any limitations around preserving folders, Dock contents, widgets, and empty icon positions. If this capability is not available through public APIs, could you clarify that limitation and the appropriate channel for submitting an enhancement request? This is a question about technical API availability, rather than a request for advance App Review approval. Thank you.
1
0
86
2d
Public API for an independent host macOS display in a sandboxed app
I am developing AirZcreen Desktop, a free macOS app that creates an independent extended display in the current user's Mac desktop session and streams only that display to one paired browser on the local network. The required behavior is a real extra macOS display onto which the user can move windows from other apps. The app must not capture, mirror, reconfigure, or make changes to existing physical displays. ScreenCaptureKit handles capture after the owned display exists. There are no user accounts, audio capture, or remote keyboard/mouse controls. Our prototype uses CGVirtualDisplay, CGVirtualDisplayDescriptor, CGVirtualDisplayMode, and CGVirtualDisplaySettings through Objective-C runtime lookup. These interfaces are absent from the public CoreGraphics headers in our installed macOS 26.2 SDK. We understand that App Review guideline 2.5.1 requires public APIs. We are seeking a supported replacement, not assistance using undocumented interfaces. A bundled helper owns the display and its cleanup, including parent-pipe closure and heartbeat timeout. An isolated App Sandbox build can create the display, capture it, stream it to Chrome, and remove it on normal Stop. This runtime result does not establish App Store eligibility. No build has been submitted for review. Is there a documented public API for a third-party sandboxed macOS app to create this kind of independent host display? If so, which framework, minimum macOS version, entitlements, and helper-process model should we use? If this capability is not currently available through public APIs, what is the appropriate way to file a request for it? The PGDisplay documentation describes a display for a guest operating system in a virtual machine, which does not provide the host-desktop behavior we need. I have not found a host-display creation API in the ScreenCaptureKit documentation. References: https://developer.apple.com/app-store/review/guidelines/#software-requirements https://developer.apple.com/documentation/paravirtualizedgraphics/pgdisplay https://developer.apple.com/documentation/screencapturekit
0
0
72
2d
Apple Store Connect submission: ambiguity about "Uploaded to Apple" and "Upload your builds using one of several tools"
In Xcode -> Product -> Archive the Mac application is mark as "Uploaded to Apple" But in Apple Store Connect -> MyApp -> "Add for Review" button show "Unable to Add for Review ... You must choose a build" And Distribution -> Build section is empty (Upload your builds using one of several tools) Need help about the ambiguity: "Uploaded to Apple" and "Upload your builds using one of several tools" Any suggestion will be greatly appreciate.
0
0
101
3d
Separate CGBitmapContexts drawn concurrently produce wrong pixels when another thread fills translucent shapes (FB25211753)
Hi, my first post :-) feel free to say hi! I’ve filed this as FB25211753 and am posting in case others hit it. When several threads each draw into their own CGBitmapContext (separate buffers, separate contexts), one context’s output is corrupted if another thread is filling translucent shapes at the same time. QA1238 says drawing to separate Quartz objects on separate threads is supported. With only identical renders running concurrently, 0 of 64 differ from a serial reference. With another thread filling translucent ellipses into an unrelated context, 32 of 32 differ. On macOS 27.0.1, each corrupted render has about 0.3–4.6% of its bytes wrong, by up to 219 of 255 levels. On 26.5.1 it was smaller: 0.2–0.5%, up to 55. It’s triggered by translucent ellipses or paths. Opaque fills and translucent rectangles don’t trigger it, and per-thread colour spaces don’t help. Thread Sanitizer reports no race in the test code. Configuration: MacBook Pro (M4 Pro), macOS 26.5.1 and 27.0.1, Xcode 26.4 / Swift 6.3. Minimal reproduction (Core Graphics only). Run with swiftc -O repro.swift -o repro && ./repro: // Separate CGBitmapContexts drawn on separate threads give wrong pixels while another thread fills translucent // shapes. Seen on macOS 26.5.1 and 27.0.1 (Apple M4 Pro). Core Graphics only. // Run: swiftc -O repro.swift -o repro && ./repro // Minimal repro: separate CGBitmapContexts on separate threads, Core Graphics only. import CoreGraphics import Foundation let sRGB = CGColorSpace(name: CGColorSpace.sRGB)! /// A fixed drawing: black, a few large translucent ellipses and a stroked circle. func victim() -> [UInt8] { let w = 600, h = 400 let ctx = CGContext(data: nil, width: w, height: h, bitsPerComponent: 8, bytesPerRow: w * 4, space: sRGB, bitmapInfo: CGImageAlphaInfo.premultipliedLast.rawValue)! ctx.setFillColor(CGColor(srgbRed: 0, green: 0, blue: 0, alpha: 1)) ctx.fill(CGRect(x: 0, y: 0, width: w, height: h)) for i in 0..<6 { ctx.setFillColor(CGColor(srgbRed: 1, green: Double(i) / 6, blue: 0.3, alpha: 0.5)) ctx.fillEllipse(in: CGRect(x: 40 + i * 80, y: 100, width: 120, height: 120)) } ctx.setStrokeColor(CGColor(srgbRed: 1, green: 1, blue: 1, alpha: 0.3)) ctx.strokeEllipse(in: CGRect(x: 100, y: 50, width: 400, height: 300)) let p = ctx.data!.assumingMemoryBound(to: UInt8.self) return Array(UnsafeBufferPointer(start: p, count: w * h * 4)) // read the context's own memory: no image decoding } /// Unrelated work on another context: many tiny translucent ellipses. func aggressor() { let ctx = CGContext(data: nil, width: 800, height: 500, bitsPerComponent: 8, bytesPerRow: 0, space: sRGB, bitmapInfo: CGImageAlphaInfo.premultipliedLast.rawValue)! for k in 0..<1600 { ctx.setFillColor(CGColor(srgbRed: 1, green: 1, blue: 1, alpha: Double(k % 7) / 7)) ctx.fillEllipse(in: CGRect(x: k % 800, y: k % 500, width: 1, height: 1)) } } let reference = victim() for mode in ["victims only", "victims + aggressors"] { let lock = NSLock() nonisolated(unsafe) var bad = 0, compared = 0 DispatchQueue.concurrentPerform(iterations: 64) { i in if mode != "victims only", i % 2 == 1 { aggressor(); return } let same = victim() == reference lock.lock(); compared += 1; if !same { bad += 1 }; lock.unlock() } print("\(mode): \(bad) of \(compared) renders differ from the serial reference") } Has anyone else seen this, or found a workaround other than drawing on a single thread?
4
0
1.7k
5d
UITableView row reordering no longer works under macOS 27 with Mac Catalyst
Under macOS 27 using Mac Catalyst for a UIKit-based app, If you present a view controller with a table view as a form sheet or page sheet, row reordering fails to function. You can drag a row as expected but the blue movement bar never appears and if you drop the row it simply returns to its original location. The exact same view controller presented as a popover works just fine. The exact same view controller not presented as a modal (such as the app's root controller) works just fine. This is a serious bug affecting existing applications and being reported by paying customers. This has been reported as FB25038883 which includes a simple sample app demonstrating the issue.
Replies
1
Boosts
0
Views
383
Activity
1h
macOS 27 beta: every OS update fails — MobileSoftwareUpdate 1259 "failed to copy firmware identity" (orphaned iSCPreboot volume-group dir) — FB24342236
Every macOS update fails during preflight personalization on my MacBook Pro (Mac15,6, Apple Silicon), currently on 27.0 build 26A5378j. It's failed on every build from beta 5 (26A5406e) through beta 7. Identical failure via Software Update and via startosinstall. It fails LOCALLY, before contacting Apple (gs.apple.com and gdmf.apple.com are both reachable with valid certs). Error (install.log + unified log): reaches PREFLIGHT_PERSONALIZE (~0.15), then aborts MobileSoftwareUpdateErrorDomain Code=1259 "failed to copy firmware identity" "could not obtain device identity information through SFR installer" SUMacControllerErrorPreflightPersonalizeFailed=7723 Root cause I've traced: an orphaned volume-group boot-policy directory in /System/Volumes/iSCPreboot/. ls shows two volume-group UUID dirs — the live one (matches diskutil info /) and an orphan (3D3287DE-...) with no corresponding APFS volume group (diskutil apfs list shows only one live group). Both date to Feb 2024. The preflight can't reconcile the System Recovery boot policy in the orphaned dir. Note: NOT caused by Erase All Content and Settings (unlike the commonly reported case). The orphan predates the beta, so any pre-existing second volume-group boot-policy directory reproduces it. It was harmless for ~2 years; macOS 27's stricter preflight rejects it. Ruled out (no effect): disk space, VPN, DNS, clock, Apple Account, refreshing the beta seed entitlement, reboot, Time Machine, re-downloading the installer, and Recovery reinstall (same 1259). Filed as FB24342236 — no response across beta 5, 6, 7. Questions: Is this a known issue with a planned fix, and in which build? Any supported recovery path that does NOT require a second Mac? (Recovery reinstall fails the same way.) Or is DFU Revive/Restore the only option? Will the public 27.0 release install on this machine, or hit the same preflight?
Replies
6
Boosts
1
Views
892
Activity
8h
Is it possible to programmatically disable USB-C VBUS power on Apple Silicon Macs?
I'm developing a native macOS menu-bar utility that aims to toggle USB power to an iPhone connected directly to a MacBook Pro. Hardware: MacBook Pro with M2 Pro iPhone 13 connected via USB-C to Lightning No external hubs or adapters Goal: I want to temporarily stop the iPhone from charging without physically disconnecting the cable, then restore charging programmatically. Losing the USB data connection while power is disabled is completely acceptable. What I've investigated: uhubctl doesn't expose the built-in USB-C ports as controllable in my setup. IOKit and USBDriverKit provide USB device management, but I haven't found a supported method to disable physical VBUS. I found IOUSBHostCIMessageTypePortPowerOff, but it appears to relate to host-controller interfaces rather than controlling Apple's existing USB-C hardware. My questions: Is there any supported API or system-level mechanism for disabling VBUS on a MacBook's built-in USB-C port? Can the USB-C Power Delivery controller be instructed to stop supplying power without physically disconnecting the device? Alternatively, is there a supported mechanism for requesting that a connected iPhone temporarily stop drawing charging current? I'm open to lower-level macOS development if necessary, but I'd like to understand whether this is technically possible before pursuing it. Any insight from Apple engineers or developers familiar with Apple Silicon USB controllers would be greatly appreciated.
Replies
2
Boosts
0
Views
86
Activity
10h
CometCal not working with Siri AI on macOS ?
Hello 👋, We finally gets our hands-on Siri AI here in France on macOS 27.2 As a macOS developer supporting App Intents into my app I would like to add App Schema to my AppIntent / AppEntity to make them available through Siri AI in my next release. So I've started by downloading the CometCal app and add a target for macOS (because I supposed the existing Mac Catalyst target provided was not supported by Siri AI ?). On my machine CometCal does not work with Siri AI. It either fail or repond it cannot do the action. Doing those actions (Find event, Create event, ...) in Apple Shortcut works just fine. Do I miss something specific on macOS ? A specific configuration or something ? Is Siri AI supposed to work on macOS as I tried to ? (I also tried making a Release build or moving the app into /Applications) NB: I don't have a Siri AI compatible iPhone (+ blocked in Europe) to run CometCal on iOS to compare with. Thanks,
Replies
0
Boosts
0
Views
60
Activity
15h
Supported diagnosis for posix_spawn EPERM when launching a sandboxed local QA host
On macOS 15.7.9 (24G830), arm64, using Xcode 16.4 (16F6), a locally built QA host fails to launch through LaunchServices using open -W. The recorded signature is ad hoc, with no TeamIdentifier; its only recorded effective entitlement is com.apple.security.app-sandbox=true. The historical launch returned -10810. Correlated logs report posix_spawn: Operation not permitted (errno 1). Host entry was not observed. A packaging revision embedded the same Info.plist in __TEXT,__info_plist. Recorded signature verification succeeded, but the next launch produced the same rejection. The responsible policy remains unidentified; these observations are not an independently validated minimal reproducer. What supported diagnostic procedure can identify the policy responsible for this rejection without disabling security protections or using an alternative launch route?
Replies
1
Boosts
0
Views
89
Activity
16h
Stuck Waiting for Review
Hi, I'm curious if others have spent a long time stuck waiting for review. I submitted a week ago, and have a growing audience exited to play my new game and continuing to not have it available is hurting my growth. Should I submit a form for expedited review? Apple ID : 6816716633 Name: Atlas of Crowns Submission ID: 08837345-2546-48a8-a330-930d68dad2e0
Replies
1
Boosts
0
Views
134
Activity
1d
Location Services stopped working across the system on macOS
MacBook Air (M4) Current build: macOS 27 Developer Beta (26A5368g) I have a system-wide Location Services failure affecting Apple Maps, Safari geolocation APIs, and any application requesting the current location. Symptoms: Apple Maps cannot determine current location. Safari and browser geolocation APIs fail. Websites report that location cannot be found. Location Services are enabled and permissions are granted. The issue has persisted across: macOS 26.5 beta macOS 26.6 beta macOS 26.6 beta 2 macOS 27 Developer Beta Troubleshooting already performed: Multiple Wi-Fi networks tested. iPhone hotspot tested. VPN enabled and disabled. Location Services reset. Permissions reset and reauthorized. New clean local user account created (no Apple ID, no third-party software). Issue reproduces identically in the clean account. Technical observations: locationd logs repeatedly show: knownCount = 0 AlsWifi = unknown while Wi-Fi scanning itself appears successful: queryMacAddresses.size = 57 The system sees dozens of nearby access points, but none appear to be recognized for Wi-Fi positioning. Additional findings: Wi-Fi hardware functions normally. Internet connectivity is normal. Bluetooth and Find My device presence work. GeoServices resources are present on disk. No successful location fix is ever produced. Has anyone seen similar CoreLocation / GeoServices behavior where Wi-Fi scans succeed but knownCount always remains 0 and no location fix is generated?
Replies
11
Boosts
2
Views
2k
Activity
1d
How to Programmatically Install an iOS App on USB-Connected iPhones from a macOS Application?
Hello Apple Developer Community, We are developing a hardware diagnostic solution consisting of a macOS desktop application and a companion iOS application. Our iOS application is currently distributed through Apple TestFlight for testing purposes. The application installs and functions correctly when users download it manually through TestFlight. However, we are facing an issue when attempting to automatically install the same iOS application onto iPhones connected to our macOS application via USB. Our Intended Workflow A user connects one or multiple iPhones to a Mac using USB cables. Our macOS application automatically detects the connected devices. The macOS application initiates installation of our iOS diagnostic application onto the connected iPhones. The iOS application performs hardware diagnostic tests. Test results are transferred back to the macOS application. Once testing is completed, the iOS application can be removed from the connected devices. Current Issue When installing the iOS application manually through TestFlight, everything works correctly. However, when attempting to install the application programmatically from our macOS application over USB, we encounter a developer recognition or trust-related error. Our objective is to support commercial hardware diagnostic testing on customer-owned iPhones without requiring users to manually install the application, enable Developer Mode, trust developer certificates, or register individual device UDIDs. Questions Is there an officially supported Apple API, framework, or method that allows a macOS application to programmatically install an iOS application onto USB-connected iPhones? Is this functionality available for applications distributed through TestFlight, or does it require an App Store production release? Can installation be initiated on customer-owned, unmanaged iPhones without requiring Developer Mode, manual certificate trust, or device registration? Are there specific code-signing, provisioning profile, or distribution requirements for installing an iOS application through USB? Does Apple provide a supported solution for deploying diagnostic applications to multiple USB-connected iPhones simultaneously? If direct USB installation is restricted, what alternative Apple-supported workflow would be recommended for commercial device diagnostic and refurbishment applications? Additional Information Our iOS diagnostic application and macOS desktop application have already been developed, and the core diagnostic functionality is working. The remaining challenge is determining the correct Apple-supported method for installing the iOS companion application automatically onto connected devices. We would appreciate guidance from Apple engineers or developers who have experience with USB-based iOS application deployment, device management, or commercial diagnostic solutions. Thank you for your assistance.
Replies
3
Boosts
0
Views
764
Activity
1d
macOS application renaming
Hello, We are developing a macOS application with many different components that are required for our business features. We distribute the product outside the App Store and sign it with our Developer ID certificate. Rebranding an app is a rare case, but sometimes it happens. My question is: Does Apple have any guide or recommendations on how to rebrand an app properly, other than distributing a completely new product? I am asking because our application has a complex structure: UI app (MyApp1, bundle ID = com.myApp1.osx.app) Helper tool (MyApp1HelperTool, bundle ID = com.myApp1.osx.HelperTool) Privileged daemon (MyApp1Daemon, bundle ID = com.myApp1d) System Extension, Transparent Proxy (MyApp1Proxy, bundle ID = com.myApp1.osx.proxy) As you can see, the brand name is used not only in the bundle and product names, but also in the bundle IDs. At some point, I need to change the product name from MyApp1 to MyApp2. Ideally, I would also like to change the bundle IDs to match the new brand. After rebranding, end users should not see MyApp1 anywhere in the system, only MyApp2. Also, components that are already installed and approved (System Extension, proxy configuration, helper tool, etc.) should stay approved. We would like to avoid showing the approval prompts again to all our end users. I did some research and found that bundle IDs technically cannot be changed. To solve this, I would need to release a new app and implement an in-app update mechanism that updates MyApp1 to MyApp2. However, even with a new app and an in-app update mechanism, I did not find a way to avoid user prompts for approving the new extension, the proxy, and possibly the privileged helper tool. For macOS, these will be new components that require explicit user approval. MDM is not a solution for us: some of our customers use MDM, but many of them do not. We want the update to be as smooth as possible. Thank you!
Replies
4
Boosts
0
Views
172
Activity
1d
Creating playgrounds from a template does nothing
Attempts to create Swift Playgrounds from the built-in templates fail. Clicking the “Get” button on these templates appears to download something, but it changes back into a “Get” button afterwards without creating a playground. Furthermore, the Swift versions of the templates seem to be behind; it shows Swift 5.8 and Swift 5.9 editions whereas it should be Swift 6.x Steps to Reproduce Start the Swift Playground app (the standalone app, not the Xcode one, on macOS or iPadOS). Select “Learn to Code” Choose the “Get Started With Code” template (or any other template will do). Click the Get button. Wait until the Get button becomes a circular progress indicator. Expected Results A new Swift Playground should be created from the selected template. Actual Results The Get button changes into a circular progress indicator and then changes back. No Playground gets created. Versions Swift Playground 4.7 (2088) macOS 26.4.1 (25E253) iPadOS 26.4.2
Replies
3
Boosts
1
Views
1.4k
Activity
1d
PDF Widget Annotations appear Pixelated/Rasterized
The Problem On opening a PDF document in the Preview app, PDF widget annotations appear pixelated/rasterized. This problem exists with button, text, and choice widget subtypes. The pixelation becomes more apparent when zoomed in. Expected Results PDF widgets should appear sharp and smooth, without pixelation. In previous versions of the Preview app, widgets appear vector-based as expected. Impact on User Experience PDF widgets appear pixelated and inconsistent with text content in the same PDF document. Widgets do not look like elements of an interactive form but, instead, resemble low-quality embedded images. Affected Apps/OSs: Preview 11.0 (1147), as well as other apps that use PDFKit, on macOS Golden Gate 27.0 (26A428). A similar problem appears to affect PDFKit on iOS 27.0 and iPadOS 27.0 as well. Feedback/bug report: FB24843022
Replies
7
Boosts
2
Views
1.3k
Activity
1d
PDF Widget Annotations Disappear After Saving in PDFKit (including with Preview)
The Problem When a user toggles radio buttons or checkboxes in a PDF using Preview, the widgets disappear following subsequent interactions after the file is saved and reopened. This renders the form fields unusable. Steps to Reproduce the Problem Open a PDF with radio buttons or checkboxes in Preview. Toggle a radio button or checkbox. Save and close the file. Re-open the PDF in Preview. Toggle the same button again. The button (and any others with the same field name) will disappear. Expected Results Toggling a radio button or checkbox should update the field value without causing the button (or related buttons) to disappear. This behavior is consistent with previous versions of PDFKit. What is Happening In Preview, interacting with radio buttons and checkboxes correctly updates their appearance as expected. Saving the PDF, however, causes the appearance dictionary to reference a new N entry that is a single appearance stream unassociated with any state. The annotation's AS entry is not updated. The original N entry remains but is no longer referenced. Subsequent interactions fail to update the visual presentation because the appearance stream is missing. Impact on User Experience Radio buttons and checkboxes may disappear and become unusable when toggled. PDF documents become irreparably altered after a button is toggled and the file is saved. PDF file size significantly increases when the file is saved. Users may believe they have successfully completed a form, only for the data to become inaccessible or invisible to recipients. Forms may need to be completely restarted or recreated from scratch if the original becomes unusable. The corrupted PDF structure might cause the file to render incorrectly or crash in third-party PDF viewers. Affected Apps/OSs Tested with Preview 11.0 (1147), as well as other apps that use PDFKit, on macOS Golden Gate 27.0 (26A428). This problem also affects PDFKit on iOS 27.0 and iPadOS 27.0. Feedback/bug report: FB24866826 Related Sample Output Original PDF File Checkbox widget annotation (6 0 obj), its appearance dictionary (17 0 obj), and normal appearance dictionary (18 0 obj). Button is not checked. 6 0 obj << /Border [ 0 0 0 ] /Rect [ 90 390 110 410 ] /T (button1) /F 4 /Subtype /Widget /DA (/.AppleSystemUIFont 13 Tf 0 g) /MK 16 0 R /C [ 0 ] /AP 17 0 R /V /Off /M (D:20260919225320Z00'00') /AS /Off /FT /Btn /Type /Annot /Ff 0 >> endobj 17 0 obj << /N 18 0 R >> endobj 18 0 obj << /Yes 20 0 R /Off 22 0 R >> endobj PDF File after Save Checkbox widget annotation object (6 0 obj), its new appearance dictionary object (8 0 obj), a new normal appearance stream object (20 0 obj), and the original appearance stream dictionary (now 21 0 obj). File saved after user checked button. 6 0 obj << /Ff 0 /Type /Annot /AS /Off /AP 8 0 R /MK 9 0 R /C [ 0 ] /FT /Btn /M (D:20260919225320Z00'00') /DA (/.AppleSystemUIFont 13 Tf 0 g) /Subtype /Widget /F 4 /Border [ 0 0 0 ] /Rect [ 90 390 110 410 ] /T (button1) /V (Yes) >> endobj 8 0 obj << /N 20 0 R >> endobj 20 0 obj << /Filter /FlateDecode /Resources << /ColorSpace << /CS1 [ /ICCBased 29 0 R ] /CS2 [ /ICCBased 30 0 R ] >> >> /BBox [ 0 0 20 20 ] /Type /XObject /Subtype /Form /Length 123 >> stream x UéA ¬0 Ô}≈|†≈nà¢úÛÇ* —SA =}Ïr(»ñµ≤w◊€YËà’|ÙÎŒç'óRï∂#SäÏÌü∞¢S‰Ì§ôRÌX }–É•åY Éçˆ BŒ H " *â´8™ˆZø6z⁄ÿ ”ú6ɀ੠"∫t˘‹;'¬ endstream endobj 21 0 obj << /Off 22 0 R /Yes 23 0 R >> endobj Note: No object references 21 0 obj in the PDF.
Replies
4
Boosts
0
Views
765
Activity
1d
URL Filter fails on macOS 27.2 beta: privacy-proxy failure on PIR status request
On macOS 27.2 beta 1/2 our URL filter never starts: the session loops starting -> stopping. The same build works on macOS 27.0 (26A428). Both our TestFlight and notarized standalone builds fail. Prefilter and PIR registration succeed. The PIR status request then fails: NWPath is satisfied, the connection is configured proxy fail closed, proxy strict fail closed, the proxy fails (event: proxy:children_failed), and the error is NSURLErrorDomain -1009 / POSIX 50 "Network is down" with _NSURLErrorPrivacyProxyFailureKey=true. NEMembershipCheckerErrorDomain Code=3 -> NEAgentURLFilterErrorDomain Code=3; the app sees serverSetupIncomplete. The privacy-proxy allow-list entry is identical on macOS 27.0 and 27.2 beta (com.adguard). Disabling the VPN, rebooting, and recreating the URL filter configuration do not help. Log excerpt: neagent: updatePrefilterWithCompletionHandler - result 1 neagent: <NEPIRChecker> - Register with PIR Server (group <com.adguard.safari.AdGuard> ... PrivacyProxyFailOpen <0> ...) -> completed registration ciphermld: [C3 ...] proxy fail closed, proxy strict fail closed ciphermld: [C3.1.1 ... failed proxy (satisfied (Path is satisfied), interface: en0[802.11], ipv4, dns, uses wifi, flow divert agg: 2, LQM: good)] event: proxy:children_failed ciphermld: queryStatus: NSURLErrorDomain -1009 / POSIX 50 "Network is down", _NSURLErrorPrivacyProxyFailureKey=true, NWPath=satisfied neagent: Failed to startFilter <Error Domain=NEMembershipCheckerErrorDomain Code=3 "(null)"> nesessionmanager: NEURLFilterPlugin(com.adguard.safari.AdGuard[url-filter][inactive]): setStatus:error: - err Error Domain=NEAgentURLFilterErrorDomain Code=3 Filed as FB24933164.
Replies
7
Boosts
2
Views
658
Activity
2d
Supported API for native Thunderbolt host-to-host communication?
I'm looking into direct communication between a Mac and a Linux machine connected over Thunderbolt. Thunderbolt networking works fine, but I'd like to explore whether it's possible to transfer data using native Thunderbolt DMA, without going through the TCP/IP stack. I've looked through the IOKit and DriverKit documentation, but most of what I've found relates to drivers for PCIe devices connected over Thunderbolt rather than communication between two hosts. A couple of questions: Is there a supported API for discovering Thunderbolt XDomain services and establishing native DMA-backed send/receive paths between hosts? Can this be done from userspace or DriverKit, or would it require a kernel extension? Ideally, I'd also like to keep the existing Thunderbolt networking interface working alongside it. Any pointers to relevant APIs or documentation would be appreciated. Thanks!
Replies
2
Boosts
0
Views
222
Activity
2d
Supported API for managing an iPhone/iPad Home Screen from a sandboxed macOS app
Hello, I’m developing a native macOS application intended for Mac App Store distribution, with App Sandbox enabled. The intended feature is to let users connect their personal iPhone or iPad via USB, read the existing Home Screen layout, rearrange app icons and folders on the Mac, and apply the user-approved layout back to the device. The target devices are ordinary, non-supervised consumer devices, without MDM enrollment. Our current prototype detects the connected iPhone through public IOKit registry APIs. It does not access the Home Screen layout or modify the device. I have reviewed USB access entitlements and the device-management HomeScreenLayout payload, but have not identified a public API for this consumer-device workflow. Is there a public, supported API or documented integration mechanism for reading and updating these Home Screen layouts from a sandboxed macOS app? If supported, which framework and entitlements should we use? We would also need to understand any limitations around preserving folders, Dock contents, widgets, and empty icon positions. If this capability is not available through public APIs, could you clarify that limitation and the appropriate channel for submitting an enhancement request? This is a question about technical API availability, rather than a request for advance App Review approval. Thank you.
Replies
1
Boosts
0
Views
86
Activity
2d
Public API for an independent host macOS display in a sandboxed app
I am developing AirZcreen Desktop, a free macOS app that creates an independent extended display in the current user's Mac desktop session and streams only that display to one paired browser on the local network. The required behavior is a real extra macOS display onto which the user can move windows from other apps. The app must not capture, mirror, reconfigure, or make changes to existing physical displays. ScreenCaptureKit handles capture after the owned display exists. There are no user accounts, audio capture, or remote keyboard/mouse controls. Our prototype uses CGVirtualDisplay, CGVirtualDisplayDescriptor, CGVirtualDisplayMode, and CGVirtualDisplaySettings through Objective-C runtime lookup. These interfaces are absent from the public CoreGraphics headers in our installed macOS 26.2 SDK. We understand that App Review guideline 2.5.1 requires public APIs. We are seeking a supported replacement, not assistance using undocumented interfaces. A bundled helper owns the display and its cleanup, including parent-pipe closure and heartbeat timeout. An isolated App Sandbox build can create the display, capture it, stream it to Chrome, and remove it on normal Stop. This runtime result does not establish App Store eligibility. No build has been submitted for review. Is there a documented public API for a third-party sandboxed macOS app to create this kind of independent host display? If so, which framework, minimum macOS version, entitlements, and helper-process model should we use? If this capability is not currently available through public APIs, what is the appropriate way to file a request for it? The PGDisplay documentation describes a display for a guest operating system in a virtual machine, which does not provide the host-desktop behavior we need. I have not found a host-display creation API in the ScreenCaptureKit documentation. References: https://developer.apple.com/app-store/review/guidelines/#software-requirements https://developer.apple.com/documentation/paravirtualizedgraphics/pgdisplay https://developer.apple.com/documentation/screencapturekit
Replies
0
Boosts
0
Views
72
Activity
2d
Apple Store Connect submission: ambiguity about "Uploaded to Apple" and "Upload your builds using one of several tools"
In Xcode -> Product -> Archive the Mac application is mark as "Uploaded to Apple" But in Apple Store Connect -> MyApp -> "Add for Review" button show "Unable to Add for Review ... You must choose a build" And Distribution -> Build section is empty (Upload your builds using one of several tools) Need help about the ambiguity: "Uploaded to Apple" and "Upload your builds using one of several tools" Any suggestion will be greatly appreciate.
Replies
0
Boosts
0
Views
101
Activity
3d
iCloud for Mac is stuck on "waiting to upload"
This has been a bug for a while now on Mac OS. When you sync your desktop/documents folders with iCloud at random moments it gets stuck and never finish uploading. The folder says "waiting to upload" indefinitely. I notice it happens more often when you do a git commit on a folder that is synced with iCloud. Are there any work around for that?
Replies
111
Boosts
17
Views
147k
Activity
3d
Separate CGBitmapContexts drawn concurrently produce wrong pixels when another thread fills translucent shapes (FB25211753)
Hi, my first post :-) feel free to say hi! I’ve filed this as FB25211753 and am posting in case others hit it. When several threads each draw into their own CGBitmapContext (separate buffers, separate contexts), one context’s output is corrupted if another thread is filling translucent shapes at the same time. QA1238 says drawing to separate Quartz objects on separate threads is supported. With only identical renders running concurrently, 0 of 64 differ from a serial reference. With another thread filling translucent ellipses into an unrelated context, 32 of 32 differ. On macOS 27.0.1, each corrupted render has about 0.3–4.6% of its bytes wrong, by up to 219 of 255 levels. On 26.5.1 it was smaller: 0.2–0.5%, up to 55. It’s triggered by translucent ellipses or paths. Opaque fills and translucent rectangles don’t trigger it, and per-thread colour spaces don’t help. Thread Sanitizer reports no race in the test code. Configuration: MacBook Pro (M4 Pro), macOS 26.5.1 and 27.0.1, Xcode 26.4 / Swift 6.3. Minimal reproduction (Core Graphics only). Run with swiftc -O repro.swift -o repro && ./repro: // Separate CGBitmapContexts drawn on separate threads give wrong pixels while another thread fills translucent // shapes. Seen on macOS 26.5.1 and 27.0.1 (Apple M4 Pro). Core Graphics only. // Run: swiftc -O repro.swift -o repro && ./repro // Minimal repro: separate CGBitmapContexts on separate threads, Core Graphics only. import CoreGraphics import Foundation let sRGB = CGColorSpace(name: CGColorSpace.sRGB)! /// A fixed drawing: black, a few large translucent ellipses and a stroked circle. func victim() -> [UInt8] { let w = 600, h = 400 let ctx = CGContext(data: nil, width: w, height: h, bitsPerComponent: 8, bytesPerRow: w * 4, space: sRGB, bitmapInfo: CGImageAlphaInfo.premultipliedLast.rawValue)! ctx.setFillColor(CGColor(srgbRed: 0, green: 0, blue: 0, alpha: 1)) ctx.fill(CGRect(x: 0, y: 0, width: w, height: h)) for i in 0..<6 { ctx.setFillColor(CGColor(srgbRed: 1, green: Double(i) / 6, blue: 0.3, alpha: 0.5)) ctx.fillEllipse(in: CGRect(x: 40 + i * 80, y: 100, width: 120, height: 120)) } ctx.setStrokeColor(CGColor(srgbRed: 1, green: 1, blue: 1, alpha: 0.3)) ctx.strokeEllipse(in: CGRect(x: 100, y: 50, width: 400, height: 300)) let p = ctx.data!.assumingMemoryBound(to: UInt8.self) return Array(UnsafeBufferPointer(start: p, count: w * h * 4)) // read the context's own memory: no image decoding } /// Unrelated work on another context: many tiny translucent ellipses. func aggressor() { let ctx = CGContext(data: nil, width: 800, height: 500, bitsPerComponent: 8, bytesPerRow: 0, space: sRGB, bitmapInfo: CGImageAlphaInfo.premultipliedLast.rawValue)! for k in 0..<1600 { ctx.setFillColor(CGColor(srgbRed: 1, green: 1, blue: 1, alpha: Double(k % 7) / 7)) ctx.fillEllipse(in: CGRect(x: k % 800, y: k % 500, width: 1, height: 1)) } } let reference = victim() for mode in ["victims only", "victims + aggressors"] { let lock = NSLock() nonisolated(unsafe) var bad = 0, compared = 0 DispatchQueue.concurrentPerform(iterations: 64) { i in if mode != "victims only", i % 2 == 1 { aggressor(); return } let same = victim() == reference lock.lock(); compared += 1; if !same { bad += 1 }; lock.unlock() } print("\(mode): \(bad) of \(compared) renders differ from the serial reference") } Has anyone else seen this, or found a workaround other than drawing on a single thread?
Replies
4
Boosts
0
Views
1.7k
Activity
5d