Posts under App & System Services topic

Post

Replies

Boosts

Views

Created

SwiftData Migration: Objects Created in Custom Migration Aren't Persisted or Queryable
Description: I'm experiencing a critical issue with SwiftData custom migrations where objects created during migration appear to be inserted successfully but aren't persisted or found by queries after migration completes. The migration logs show objects being created, but subsequent queries return zero results. Problem Details: I'm migrating from schema version V2 to V3, which involves: Renaming Person class to GroupData Keeping the same data structure but changing the class name Using a custom migration stage to copy data from old to new schema Migration Code: swift static let migrationV2toV3 = MigrationStage.custom( fromVersion: LinkMapV2.self, toVersion: LinkMapV3.self, willMigrate: { context in do { let persons = try context.fetch(FetchDescriptor<LinkMapV2.Person>()) print("Found (persons.count) Person objects to migrate") // ✅ Shows 11 objects for person in persons { let newGroup = LinkMapV3.GroupData( id: person.id, // Same UUID name: person.name, // ... other properties ) context.insert(newGroup) print("Inserted GroupData: '\(newGroup.name)'") // ✅ Confirms insertion } try context.save() // ✅ No error thrown print("Successfully migrated \(persons.count) objects") // ✅ Confirms save } catch { print("Migration error: \(error)") } }, didMigrate: { context in do { let groups = try context.fetch(FetchDescriptor<LinkMapV3.GroupData>()) print("Final GroupData count: \(groups.count)") // ❌ Shows 0 objects! } catch { print("Verification error: \(error)") } } ) Console Output: text === MIGRATION STARTED === Found 11 Person objects to migrate Migrating Person: 'Riverside of pipewall' with ID: 7A08C633-4467-4F52-AF0B-579545BA88D0 Inserted new GroupData: 'Riverside of pipewall' ... (all 11 objects processed) ... === MIGRATION COMPLETED === Successfully migrated 11 Person objects to GroupData === MIGRATION VERIFICATION === New GroupData count: 0 // ❌ PROBLEM: No objects found! What I've Tried: Multiple context approaches: Using the provided migration context Creating a new background context with ModelContext(context.container) Using context.performAndWait for thread safety Different save strategies: Calling try context.save() after insertions Letting SwiftData handle saving automatically Multiple save calls at different points Verification methods: Checking in didMigrate closure Checking in app's ContentView after migration completes Using both @Query and manual FetchDescriptor Schema variations: Direct V2→V3 migration Intermediate V2.5 schema with both classes Lightweight migration with @Attribute(originalName:) Current Behavior: Migration runs without errors Objects appear to be inserted successfully context.save() completes without throwing errors But queries in didMigrate and post-migration return empty results The objects seem to exist in a temporary state that doesn't persist Expected Behavior: Objects created during migration should be persisted and queryable Post-migration queries should return the migrated objects Data should be available in the main app after migration completes Environment: Xcode 16.0+ iOS 18.0+ SwiftData Swift 6.0+ Key Questions: Is there a specific way migration contexts should be handled for data to persist? Are there known issues with object persistence in custom migrations? Should we be using a different approach for class renaming migrations? Is there a way to verify that objects are actually being written to the persistent store? The migration appears to work perfectly until the verification step, where all created objects seem to vanish. Any guidance would be greatly appreciated! Additional Context from my investigation: I've noticed these warning messages during migration that might be relevant: text SwiftData.ModelContext: Unbinding from the main queue. This context was instantiated on the main queue but is being used off it. error: Persistent History (76) has to be truncated due to the following entities being removed: (Person) This suggests there might be threading or context lifecycle issues affecting persistence. Let me know if you need any additional information about my setup or migration configuration!
1
0
67
4d
Setting to screen share virtual macOS 15+ machine?
I want to know all settings that need to be set in a macOS 15+ virtual mac in order to successfully screen share into it from the physical machine. Also any virtual machine configuration settings I may not understand. I have successfully set up screen sharing into an macOS 15 M2 mac studio that sits in the corner, on which I am running a cooked up variant of the sample code from apple about virtualizing a mac on a mac. I'm screen sharing into it from my macOS 15 M2 laptop. So I know I have at least one set of screen sharing settings correct. I have also successfully set up a macOS 14 virtual machine in that app into which I am able to screen share into from the mac studio. However, when I set up macOS 15 (and macOS 26) virtual machines, connections for screen sharing and file access don't succeed after 1 minute (I get the aqua-colored cylon / knight-rider -style progress bar for a minute, and then a connection failure dialog). I don't get the prompt to choose standard or enhanced. and I don't get asked for my user name and password. I see the virtual machine host names listed in the Finder Network tab (and the screen share button shows in the toolbar when I double click into them) and also when I instead turn on remote management and use Remote Desktop I can see the machine in Bonjour mode. In remote desktop, verifying log in is what fails, but of course those can be specified up front. I have the Firewalls turned off in the virtual machines, and I've also tried using the explicit vnc:// url with local ip addresses, and that also fails similarly. Unlike the code sample for virtualization a mac on a mac, in order to support multiple simultaneous virtual machines, I created random mac addresses when initially configuring the machine, and I store those in a config file I use to reconstitute the machine when it restores. I also store the machine identifier that's generated at creation time. Other features in the virtual machines seem to work fine when running either one or both virtual machines. And I have the same problems with screen sharing whether I have one or both machines running. The virtual machine which does not seem to work is the one with the custom sharing name. I can screen share out of the virtual machines as well, though all they can see is the mac studio, so controlling the same machine I'm on through the VZVirtualMachineView does not go well, but the connections succeed. I'm also able to file share into the mac studio from the virtual machine, which is how I'm doing things like file transfers, but I'd prefer to drag / drop them through the screen share. I have not tried figuring out if other privacy settings in macOS 15 may be responsible, for instance is there something about screen capturing that should be turned on or off? I don't see any apps set for screen and system audio recording on the real mac studio I'm able to screen share into, so I assumed that wasn't a factor. My goal isn't to build a fully functional virtual machine app, I just have to run some software in specific versions of mac os (i.e. macOS 14) because they have been discontinued by their makers, and they have a history of always failing when new macOS versions are released. and some other software I can run in macOS 15, but not having working screen sharing means I'm stuck trying to learn all the ins and outs of the virtualization framework, when screen sharing ought to be an easier solution for me for now.
2
0
150
4d
Payment Services Exception Unauthorized
We’re attempting to call the Apple Pay Web Merchant Registration API using our Platform Integrator flow and consistently receive 401 Unauthorized, despite successful TLS/mTLS. Details: Endpoint: https://apple-pay-gateway-cert.apple.com/paymentservices/registerMerchant (POST) Payload: { "domainNames": ["breakerfy.com"], "encryptTo": "platformintegrator.ai.packman", "partnerInternalMerchantIdentifier": "merchant.ai.packman.1", "partnerMerchantName": "breakerfy", "merchantUrl": "https://breakerfy.com" } Domain association: URL: https://breakerfy.com/.well-known/apple-developer-merchantid-domain-association What we tried: We created a Payment Platform Integrator ID (platformintegrator.ai.packman) We created a CertificateSigningRequest We used the certificate signing request to create an Apple Pay Platform Integrator Identity Certificate and downloaded the signed certificate. We exported the Private Key from keychain access in PKCS 12 format We converted both the private key and the signed certificate to PEM format We created a merchant id We used the converted keys to send requests to the API We received { "statusMessage": "Payment Services Exception Unauthorized", "statusCode": "401" } we also tried curl with the original p12 file and also had no luck. What could be the issue ?
0
0
42
5d
AccessorySetupKit documentation
This is not a question but rather a small bit of documentation on how Accessory Setup Kit actually works. I spent a couple days figuring this out so I thought let's share my findings. The example app is very light and the documentation definitely has room for improvement so here are a couple important notes. Findings: If you're running > iOS 18 and add any property to your Info.plist file you're no longer able to scan for devices by using CBCentralManager.scanForPeriphals. This will no longer return discoverable devices. Below iOS 18 these properties in the Info.plist are ignored by the OS and you can safely use the "legacy" method of connecting to bluetooth devices. If you're running > iOS 26 the removeAccessory will show a prompt to the user. If you're running < 26 you can silently remove the accessory and start each session with a clean state. If you create CBCentralManager before you start the ASK session you'll not get the state = PoweredOn. If you have 0 accessories connected to your application CBCentralManager will never enter the state = PoweredOn when you create the CBCentralManager. Pre-ASK this would be the trigger for iOS to ask the user permission. This is no longer necessary with ASK. If you have have 1 or more accessories authorized to your app this will be returned in the session.accessories after the session has started. This is an important indicator to determine app behavior. If you have 1 or more accessories CBCentralManager.scanForPeripherals will ONLY return previously authorized AND discoverable devices. Use this for when you want to connect to a previously authorized device. If you have 1 or more accessories and the CBCentralManager.scanForPeripherals returns nothing you can (safely) assume the user attempts to onboard a new device. So for my application I take the following steps: Check for iOS version, if > iOS 18 start ASK session. Are there previously authorized devices? -- yes: run CBCentralManger.scanForPeripherals -- no: show the picker Did the scan return any devices? -- yes: show UI to select device or connect with first available device in the list -- no: show the picker Feel free to add any of your findings and @Apple please update the documentation!
0
0
328
5d
[iPadOS 26] EACCES (Permission Denied) on UDP Broadcast despite Multicast Networking Entitlement
My application (using a nested framework for networking) was working correctly on iPadOS 18, but failed to perform a UDP broadcast operation after upgrading the device to iPadOS 26. The low-level console logs consistently show a "Permission denied" error. Symptoms & Error Message: When attempting to send a UDP broadcast packet using NWConnection (or a similar low-level socket call within the framework), the connection fails immediately with the following error logged in the console: nw_socket_service_writes_block_invoke [C2:1] sendmsg(fd 6, 124 bytes) [13: Permission denied] (Error code 13 corresponds to EACCES). Verification Steps (What I have checked): Multicast Networking Entitlement is Approved and Applied: The necessary entitlement (com.apple.developer.networking.multicast) was granted by Apple. The Provisioning Profile used for signing the Host App Target has been regenerated and explicitly includes "Multicast Networking" capability (see attached screenshot). I confirmed that Entitlements cannot be added directly to the Framework Target, only the Host App Target, which is the expected behavior. Local Network Privacy is Configured: The Host App's Info.plist contains the NSLocalNetworkUsageDescription key with a clear usage string. Crucially, the Local Network Access alert does not reliably appear when the Broadcast function is first called (despite a full reinstall after OS upgrade). Even when Local Network Access is manually enabled in Settings, the Broadcast still fails with EACCES. Code Implementation: The Broadcast is attempted using NWConnection to the host 255.255.255.255 on a specific port. Request: Since all required entitlements and profiles are correct, and the failure is a low-level EACCES on a newly updated OS version, I suspect this may be a regression bug in the iPadOS 26 security sandbox when validating the Multicast Networking Entitlement against a low-level socket call (like sendmsg). Has anyone else encountered this specific Permission denied error on iPadOS 26 with a valid Multicast Entitlement, and is there a known workaround aside from switching to mDNS/Bonjour?
1
0
82
5d
Wi-Fi Raw Socket Disconnection Issue on iPhone 17 Series
On my iPhone 16 Pro and iPhone 16 Pro Max devices, running iOS 26.0, 26.0.1, and 26.1, Wi-Fi raw socket communication works flawlessly. Even after keeping the connection active for over 40 minutes, there are no disconnections during data transmission. However, on the iPhone 17 and iPhone 17 Pro, the raw socket connection drops within 20 seconds. Once it disconnects, the socket cannot reconnect unless the Wi-Fi module itself is reset. I believe this issue is caused by a bug in the iPhone 17 series’ communication module. I have looked into many cases, and it appears to be related to a bug in the N1 chipset. Are there any possible solutions or workarounds for this issue?
3
0
65
5d
help getting audio verbs macOS Tahoe Deep Debug Logs
Im running macOS Tahoe and I have the proper nvram boot-args , however when I try to poke the log stream im not getting any verb information related to the card im using. The audio system im using is AppleHDA.kext from the Beta 1 KDK. I've tried asking AI it doesn't make a difference what it suggests to me..... In the meantime of while im asking for assistance what ill do is go ahead and let it template me a kernel extension that I guess just traffics it to the Log for me and hopefully this isn't filtered out as what I suspect is it saying is happening is is that it actually masks some of the information. Why am I doing this? not For the Linux Driver its so I can see from the Log where it came from as this is what the developer said he did GitHub/davidjo/snd_hda_macbookpro is the kabylake iMac.
0
0
16
5d
IAP Product Info Error & Sandbox Webhook/Test API Failures
Hello, I'm suddenly encountering errors with In-App Purchases (IAP) and my sandbox webhooks, which were working correctly just a few days ago. Specifically: Product Information Error: I'm receiving the following error when trying to fetch product information: { "type": "product_info", "result": "error", "error": "An unknown error occurred" } This API call was functioning normally until today. Sandbox Webhook Failure: I have configured a sandbox webhook, but my server is not receiving any notifications from the App Store. Test API 401: When I attempt to call the test API (https://api.storekit-sandbox.itunes.apple.com/inApps/v1/notifications/test), I consistently receive a 401 (Unauthorized) error. Could you please provide some guidance on how to troubleshoot these issues? Thank you.
0
0
24
6d
App-Site-Association file is wrongly cached
Hi Everyone, When we first hosted our apple-app-site-association file, our hosting provider was unintentionally blocking Apple’s crawler. As a result, Apple’s CDN seems to have cached a timeout / missing file response. We’ve since corrected the issue — the AASA file is now valid and accessible at: https://our-domain.com/.well-known/apple-app-site-association sidenote: I am using "our-domain" as an alias. It is not our actual domain. We have verified that we return a valid JSON, HTTPS 200, correct MIME type. We used apple recommended tools to check this as well as other tools we found on the internet. However, when fetching through the Apple CDN: https://app-site-association.cdn-apple.com/a/v1/our-domain.com we still receive: Apple-Failure-Reason: SWCERR00301 Timeout Apple-Failure-Details: {"cause":"context deadline exceeded (Client.Timeout exceeded while awaiting headers)"} This has persisted for several days. Tools like getuniversal.link and yURL show that the CDN works fine in U.S. regions, but in Europe it continues serving the old timeout response. I’ve already opened a support ticket (Case ID: 102734912696), but the current support channel seems to be general developer account assistance rather than technical. They claim they can only assist us with account related issues (even though I used the code-support form...) Can someone please advise or help us escalate this to the appropriate internal team to refresh the Apple CDN cache for our domain? Thank you so much for your time and help.
1
0
38
6d
Create custom internet account on macOS
Hi, A lot of e-mail providers supports OAuth2 authentication. However, Mail.app on macOS and iOS do not support configuring a mail account that would use OAuth2 authentication, unless it's on its hardcoded list of account providers. Is there any framework that allows setting up a custom account for my institution, so that we could begin to offer OAuth2 authentication for mail and calendar?
0
0
15
6d
XPC Service Installed Outside App Doesn't Set Responsible
On macOS 15.7.1 I'm trying to install an XPC service outside the app (Developer ID). It mostly seems to go ok, but when I set Launch Constraints on Responsible, AMFI complains of a violation, saying the service is responsible for itself, and fails to launch. Removing that constraint (or adding the service itself to the constraint) works fine. The service is an optional download, and installed to /Users/Shared with a LaunchAgent specifying the MachService. The service is correctly launched and seems to pass all codesigning, notarization, and other checks, but the Responsible isn't set to the "calling" app. Is this broken, or working as intended?
3
0
155
6d
[iPadOS 28] EACCES (Permission Denied) on UDP Broadcast despite Multicast Networking Entitlement
My application (using a nested framework for networking) was working correctly on iPadOS 18, but failed to perform a UDP broadcast operation after upgrading the device to iPadOS 28. The low-level console logs consistently show a "Permission denied" error. Symptoms & Error Message: When attempting to send a UDP broadcast packet using NWConnection (or a similar low-level socket call within the framework), the connection fails immediately with the following error logged in the console: nw_socket_service_writes_block_invoke [C2:1] sendmsg(fd 6, 124 bytes) [13: Permission denied] (Error code 13 corresponds to EACCES). Verification Steps (What I have checked): Multicast Networking Entitlement is Approved and Applied: The necessary entitlement (com.apple.developer.networking.multicast) was granted by Apple. The Provisioning Profile used for signing the Host App Target has been regenerated and explicitly includes "Multicast Networking" capability (see attached screenshot). I confirmed that Entitlements cannot be added directly to the Framework Target, only the Host App Target, which is the expected behavior. Local Network Privacy is Configured: The Host App's Info.plist contains the NSLocalNetworkUsageDescription key with a clear usage string. Crucially, the Local Network Access alert does not reliably appear when the Broadcast function is first called (despite a full reinstall after OS upgrade). Even when Local Network Access is manually enabled in Settings, the Broadcast still fails with EACCES. Code Implementation: The Broadcast is attempted using NWConnection to the host 255.255.255.255 on a specific port. Request: Since all required entitlements and profiles are correct, and the failure is a low-level EACCES on a newly updated OS version, I suspect this may be a regression bug in the iPadOS 28 security sandbox when validating the Multicast Networking Entitlement against a low-level socket call (like sendmsg). Has anyone else encountered this specific Permission denied error on iPadOS 28 with a valid Multicast Entitlement, and is there a known workaround aside from switching to mDNS/Bonjour?
1
0
53
6d
Content filter installed but not running
We have a content filter system extension as part of our macOS app. The filter normally works correctly, activation and deactivation works as expected but occasionally we see an issue when the content filter is activated. When this issues occurs, the filter activation appears to behave correctly, no errors are reported. Using "systemextensionsctl list" we see the filter is labelled as "[activated enabled]". However, the installed content filter executable does not run. We have seen this issue on macOS 15.3 and later and on the beta macOS 26.1 RC. It happens only occasionally but when it does there is no indication as to why the executable is not running. There are no crash logs or errors in launchd logs. Both rebooting and deactivating/activating the filter do not resolve the issue. The only fix appears to be completely uninstalling the app (including content filter) and reinstalling. I have raised a FB ticket, FB20866080. Does anyone have any idea what could cause this?
1
0
39
6d
Download container SwifData from XCODE
Hi, I'm trying to download the container with SwifData of my App from the iPhone device connect through a cable to my MAC, for debug purpose. I get an error The specified file could not be transferred. Domain: com.apple.dt.CoreDeviceError Code: 7000 User Info: { DVTErrorCreationDateKey = "2025-10-30 10:00:38 +0000"; NSURL = "file:///Users/maurizio/Desktop/DatiTRIPBOOK/mm.com.TripBook%202025-10-30%2011:00.28.199.xcappdata/AppData/Library"; } The specified file could not be transferred. Domain: com.apple.dt.CoreDeviceError Code: 7000 User Info: { NSURL = "file:///Users/maurizio/Desktop/DatiTRIPBOOK/mm.com.TripBook%202025-10-30%2011:00.28.199.xcappdata/AppData/Library"; } Performing a file system operation failed. Domain: com.apple.dt.remoteservices.error Code: 11001 Failure Reason: The file could not be opened for writing. Failed to open Library/SplashBoard/Snapshots/sceneID:mm.com.TripBook-703D890D-C844-4329-B913-288B5FFB9289/9B937793-D789-43D5-B94C-3FA27A508650 for reading, openat(2) returned POSIX error code 1 (parentParam = 5) Domain: NSPOSIXErrorDomain Code: 1 Failure Reason: Operation not permitted System Information macOS Version 26.0.1 (Build 25A362) Xcode 26.0.1 (24229) (Build 17A400) Timestamp: 2025-10-30T11:00:38+01:00
1
0
45
6d
UI-Less Host App for Endpoint Security Extension Installation
According to Apple's development documentation, if I want to install an Endpoint Security system extension, I need to develop a host app that must be installed in the Applications directory. Now, I want to create an ES extension to protect users from accessing certain folders. However, I don't want a custom app to pop up asking the user to allow the installation of the ES extension. (To clarify, it's fine if the system authorization request dialog pops up, but I don't want the host app's UI to appear.) Is there any way to do this?
1
0
25
6d