Explore the core architecture of the operating system, including the kernel, memory management, and process scheduling.

Post

Replies

Boosts

Views

Activity

Discover and connect to BLE peripherals more rapidly in background
We are developing an app which connects to a BLE peripheral in the background whenever it gets close to it. What we have used so far is that we monitor a circular region. When the phone enters the region the app will start scanning for peripherals and when it discovers the peripheral it connects to it. This worked pretty well for the last few iOS versions, perhaps iOS 14-16. It wasn't perfect but for the most part it would feel like it connected rather quickly when you would approach the BLE peripheral. If you listen to music via BLE or talk to someone using your BLE headset then it could sometimes work noticeably worse. But, as said, for the most part it would work satisfactory. Starting with iOS 17 and analyzing the functionality over the past 6 months or so we've noticed a clear worsening of it. It does generally connect to the peripheral but the user might often have to wait for quite some time. Rather frequently the user must even light up the screen of the phone before anything even happens. It appears that some sort of resource allocation, battery saving feature or similar has affected this functionality greatly. The time difference between entering a region and physically approaching the device is generally around 2-3 minutes. We have tried to do it more in line with documentation and follow the guidelines that we find in: https://developer.apple.com/library/archive/documentation/NetworkingInternetWeb/Conceptual/CoreBluetooth_concepts/CoreBluetoothBackgroundProcessingForIOSApps/PerformingTasksWhileYourAppIsInTheBackground.html So in doing this we do not start scanning for peripherals when a region is entered, but instead we directly invoke connectPeripheral:options:. This way we offload to the system that we want to connect to that peripheral. However, when testing this we see no real improvement. Sometimes it connects satisfactorily. Sometimes it doesn't really connect at all. Many times it connects if the user lights up the screen. So just looking at what the user is experiencing our analysis is that doing it this way works even worse than what we previously did. I understand that the system has many resources to consider and that some may have to wait while others perform things. But are there any documentation on what one could expect from initiating a connectPeripheral:options: from the background? In the link I posted it simply states the iOS device will reconnect when the user returns home. So not much detail in terms of performance which is crucial for our application. If there aren't any further details on the performance, are there any other ways to improve this functionality? We are not looking at draining the battery whatsoever but we simply need our background running app to be as responsive as possible for a few minutes after it has been launched by the region monitoring. We understand that battery life is important but since this happens rarely and sparsely (not more than a few times per day) it seems reasonable that there should be a way to be able to make it function properly.
2
0
377
May ’24
RADIUS Server Certificate Trust Issue with Apple Devices (CA in Trusted Root Store)
I'm currently facing an issue with my RADIUS server's EAP configuration and Apple devices. I'm using a certificate signed by "DigiCert Global Root G2", which is included in Apple's trusted store CA's (https://support.apple.com/en-us/105116). However, DigiCert uses an intermediate authority, "DigiCert Global G2 TLS RSA SHA256 2020 CA1", to sign customer certificates, and this seems to be causing a problem. When an Apple device tries to connect to the WiFi, the RADIUS server presents its certificate, but the device doesn't trust it due to the untrusted intermediate certificate. Here's my current configuration: Root CA in FreeRADIUS: "DigiCert Global Root G2" Server certificate in FreeRADIUS: "Intermediate + Server certificate" I have also tried to extend the CA with the full chain, but since the final certificate is issued by the intermediate authority, my Apple devices continue to report that they don't trust the certificate. Has anyone else experienced this issue and found a solution? It seems unlikely that DigiCert would sign certificates with their (presumably offline) root authority. Any help or suggestions would be greatly appreciated. Thanks!
0
0
254
May ’24
Watch OS 10.4 How to turn on developer mode
Watch model: A2985 Watch system: 10.4(21T216) Settings > Privacy can not find Developer Mode in Watch OS 10.4. xcode Recent device can not find this watch device.How do I turn on developer mode in Watch OS 10.4。Watch OS 9.5 can find and open it,but Watch OS 10.4 can not find。 I look forward to hearing from you soon.
2
0
317
May ’24
command delete mail app's password in keychain
Dear all, I want to delete mail app and outlook for mac app saved password (exchange on-promised server) in keychain (macOS big sur 11.7.10). I can delete outlook for mac app's password by command: security delete-generic-password -l "Exchange" But I cannot delete mail app's password by command: security delete-generic-password -l "com.apple.account.Exchange.password" Please provide the right command. Thanks in advanced.
1
0
176
May ’24
Filevault encryption key on macOS
Hello, It is possible to encrypt a mac's hard-drive with Filevault. All home user folders are encrypted with the same encryption key. (This is the same encryption key for the whole hard-drive). This encryption key is encrypted with user password. But i don't understand how it works when there are multiple user accounts. Maybe there is a table: The same encryption key is stored several times (one per user account) ? Is there a way for a user to read the filevault encryption key ? Thanks
0
0
299
May ’24
watchOS app gets killed by filecoordinationd when in Always on mode
Hi, I have a watchOS app which is able to control Sonos speakers. So people set it to stay active for 1 hour. Unfortunately, the system kills the application every time after 5 to 15 min. I have made many system diagnosis and the pattern is always the same. Carousel decides that the app must be suspended. runnungboardd suspends the app. filecoordinationd kills with SIGKILL because it detected it has been suspended. launchd reports that the app has been killed. The issue is that I don't understand why Carousel wants to suspend the app. I have disabled all animations while the app is in Always on mode. The app does not perform any operations. If anyone has any idea on what do try, I would be glad for help. Here are some of the related logs. There are thousands around that but I could not deduce anything useful from them. The app gets suspended and then the filecoordinationd decides to kill it. But why is it suspended ? Just before, the app invalidates the timelines. But the timelines here are from the Backlight service. debug 2024-05-11 10:19:47.116194 +0200 WatchSonos WatchKit Extension 0x16d57dd0 invalidateAllTimelinesForReason:Host update. for environment:de.heinrich.alexander.WatchSonos.watchkitapp default 2024-05-11 10:19:47.116285 +0200 WatchSonos WatchKit Extension [(FBSceneManager):de.heinrich.alexander.WatchSonos.watchkitapp] Sending action(s): BLSInvalidateFrameSpecifiersAction Here an error occurs when setting the darwin gpu. This could be related default 2024-05-11 10:19:47.176223 +0200 runningboardd [app<de.heinrich.alexander.WatchSonos.watchkitapp((null))>:1706] Shutdown sockets (ALL) default 2024-05-11 10:19:47.176259 +0200 runningboardd [app<de.heinrich.alexander.WatchSonos.watchkitapp((null))>:1706] Set darwin role to: None default 2024-05-11 10:19:47.176264 +0200 runningboardd 1706 Set Darwin GPU to "deny" error 2024-05-11 10:19:47.176292 +0200 runningboardd 1706 setGPURole failed with result = e00002c7 Here the carousel requests suspension which then later performed by the runningoardd default 2024-05-11 10:19:47.177176 +0200 Carousel [app<de.heinrich.alexander.WatchSonos.watchkitapp((null))>:1706] Setting process task state to: Suspended info 2024-05-11 10:19:47.177309 +0200 Carousel Client requesting suspension of PID:1706 Name:<redacted> info 2024-05-11 10:19:47.177407 +0200 Carousel Update delivered for [app<de.heinrich.alexander.WatchSonos.watchkitapp((null))>:1706] with taskState 3 Suspending the process default 2024-05-11 10:21:13.851752 +0200 runningboardd [app<de.heinrich.alexander.WatchSonos.watchkitapp((null))>:1707] Suspending task. info 2024-05-11 10:21:13.851963 +0200 runningboardd Process: [app<de.heinrich.alexander.WatchSonos.watchkitapp((null))>:1707] has changes in inheritances: {( <RBSInheritance| environment:UIScene:@com.apple.frontboard.systemappservices/FBSceneManager:de.heinrich.alexander.WatchSonos.watchkitapp name:com.apple.frontboard.visibility origID:74-186-52947 payload 646688203>, <RBSInheritance| environment:(none) name:com.apple.frontboard.visibility origID:74-186-53033 0> )} info 2024-05-11 10:21:13.852269 +0200 runningboardd Current inheritances: {( <RBSInheritance| environment:(none) name:com.apple.frontboard.visibility origID:74-186-53032 0>, <RBSInheritance| environment:UIScene:@com.apple.frontboard.systemappservices/FBSceneManager:de.heinrich.alexander.WatchSonos.watchkitapp name:com.apple.frontboard.visibility origID:74-186-52947 payload 646688203>, <RBSInheritance| environment:(none) name:com.apple.frontboard.visibility origID:74-186-52948 0>, <RBSInheritance| environment:(none) name:com.apple.frontboard.visibility origID:74-186-53033 0> )} default 2024-05-11 10:21:13.852375 +0200 runningboardd Process: [app<de.heinrich.alexander.WatchSonos.watchkitapp((null))>:1707]: Sending inheritance changeset: <RBSInheritanceChangeSet| gained:{( )} lost:{( <RBSInheritance| environment:(none) name:com.apple.frontboard.visibility origID:74-186-53032 0>, <RBSInheritance| environment:(none) name:com.apple.frontboard.visibility origID:74-186-52948 0> )}> default 2024-05-11 10:21:13.852794 +0200 runningboardd [app<de.heinrich.alexander.WatchSonos.watchkitapp((null))>:1707] Shutdown sockets (SVC) default 2024-05-11 10:21:13.852829 +0200 runningboardd [app<de.heinrich.alexander.WatchSonos.watchkitapp((null))>:1707] Set darwin role to: None Killing the process: default 2024-05-11 10:19:48.441773 +0200 filecoordinationd Detected process suspension: 1706 info 2024-05-11 10:19:48.441776 +0200 filecoordinationd Update delivered for [app<de.heinrich.alexander.WatchSonos.watchkitapp((null))>:1706] with taskState 4 default 2024-05-11 10:19:48.441776 +0200 filecoordinationd Claim 562AB55E-CE67-46FA-A080-798F89013643 observed suspension of client with 1706 error 2024-05-11 10:19:48.444295 +0200 filecoordinationd SimulateCrash() on another process is not supported default 2024-05-11 10:19:48.444361 +0200 filecoordinationd Claim 562AB55E-CE67-46FA-A080-798F89013643 was revoked Reporting the kill default 2024-05-11 10:19:48.455485 +0200 launchd exited due to SIGKILL | sent by filecoordinationd[316], ran for 7913ms
0
0
208
May ’24
How to take a snapshot programmatically on visionOS?
Hi there. I've been trying to take a snapshot programmatically on apple vision pro but haven't succeeded. This is the code I am using so far: func takeSnapshot<Content: View>(of view: Content) -> UIImage? { var image: UIImage? uiQueue.sync { let controller = UIHostingController(rootView: view) controller.view.bounds = UIScreen.main.bounds let renderer = UIGraphicsImageRenderer(size: controller.view.bounds.size) image = renderer.image { context in controller.view.drawHierarchy(in: controller.view.bounds, afterScreenUpdates: true) } } return image } However, UIScreen is unavailable on visionOS. Any idea of how I can achieve this? Thanks Oscar
1
0
261
May ’24
Handling 4xx Errors in Subscribed Calendar APIs: Does iPhone Stop Syncing?
I am managing a subscribed calendar through my iPhone and am curious about how iOS handles 4xx error responses from calendar APIs. Specifically, I would like to know if there is a process that stops the iPhone from attempting to sync the calendar if it consistently receives 4xx errors from the server. Does iOS have a mechanism to pause or stop calendar sync under such error conditions to prevent unnecessary data usage and battery drain? Any guidance or insights on this behavior would be greatly appreciated.
0
0
146
May ’24
iCalendar (.ics) feed, how to force calendar client to stop the subscription
I have an online service where it lets people subscribe to iCalendar feed. I'm wondering if there is a way to force the subscriber (their Calendar client) to stop their subscription. I have some subscribers who subscribed to a feed that doesn't exist anymore. The annoying part is that these subscribers is fetching the data every 30 seconds! I looked at iCalendar specification and it doesn't look like this is supported. I tried few http response codes (404 and 410), but this doesn't stop the client. The user agent I'm seeing in the log shows "iOS/17.4 (21E219) dataaccessd/1.0". Any help is appreciated.
0
0
161
May ’24
Setting Display Colour Profiles via terminal
Hi, I'm looking at being able to set a display colour profile via terminal. I know apps such as SwitchResX are able to change this but i can't figure out how and if it is possible to switch via a terminal command or via a script. This here is what i would like to change. I have googled about and searched through preference files but can't find anything. Any help is much apreciated. Thanks, James
0
0
285
May ’24
xcode15.3, ios 17.4SDK VPN NEPacketTunnelProvider, After successful socket listen local ip 0.0.0.0, data packets cannot be received in release mode, but data packets can be received in debug mode.
xcode15.3, ios 17.4SDK VPN NEPacketTunnelProvider, After successful socket listen local ip 0.0.0.0, data packets cannot be received in release mode, but can be received in debug mode.This bug has been bothering me for a few days. Please help me. Thank you very much. In networkExtension code: ... let ip4Set = ... ip4Set.includedRoutes = [NEIPv4Route.default()] ... func readDevicePackets(){ ... packetFlow.readPacketObjects { (packetList) in ... let sendPacketList: [NEPacket] = changePacket(packetList) ... packetFlow.writePacketObjects(sendPacketList) readDevicePackets() }
1
0
231
May ’24
Finder displays the old application name after updating to new application
Hi All, Finder is caching the old application name and not showing the new application. I am deploying my iPad app to M1 Mac by generating a package file. In the newer version of this application, I have changed my application name and deployed the application from backend to user machines. Eventhough application is deployed successfully, the application name still remains the old. I went through the forum and tried the reset the finder cache and launcher service caches, but still the new application name is not coming. But when I uninstall and reinstall the application it is showing the new application name. Can someone suggest a way to reset this using script, as we are deploying the application from backend, we dont have direct access to the client machines Thanks Ranga
0
0
236
May ’24
Background AVExportSession for UHD Videos
First off - I have read and fully understand this post - Apple doesn't want us abusing users' hardware so as to maximize the quality of experience across apps for their customers. I am 100% on board with this philosophy, I understand all design decisions and agree with them. To the problem: I have an app that takes photo assets, processes them for network (exportSession.shouldOptimizeForNetworkUse = true), and then uploads them. Some users have been having trouble, did some digging, they're trying to upload 4K 60FPS videos. I think that is ridiculous, but it's not my place. The issue is that the export time for a 4K60FPS video that is ~40s long can be as long as 2m. So if they select a video to upload, and then background the app that upload will ALWAYS fail because the processing fails (I have BG uploads working just fine). My understanding is that default I have 30s to run things in the background. I can use UIApplication.pleasegivemebackgroundtime to request up to 30 more seconds. That is obviously not enough. So my second option is BGProcessingTask - but that's not guaranteed to run ever. Which I understand and agree with, but when the user selects a video while the app is in the foreground the expectation is that it immediately begins processing. So I can't use a BGProcessingTask? Just wondering what the expected resolution here is. I run tasks, beg for time, if it doesn't complete I queue up a BGTask that may or may not ever run? That seems ****** for a user - they start the process, see it begin, but then if the video is too big they just have to deal with it possibly just not happening until later? They open up the app and the progress bar has magically regressed. That would infuriate me. Is there another option I'm not seeing? Some way to say "this is a large background task that will ideally take 30-60s, but it may take up to ~5-7m. It is user-facing though so it must start right away"? (I have never seen 5-7m, but 1-2m is common) Another option is to just upload the full 4K60FPS behemoth and do the processing on my end, but that seems worse for the user? We're gobbling upload bandwidth for something we're going to downsample anyway. Seems worse to waste data than battery (since that's the tradeoff at the end of the day). Anyway, just wondering what the right way to do this is. Trivially reproducible - record 1m 4K60FPS video, create an export session, export, background, enjoy failure.
2
0
305
May ’24
SMAppService.daemon as root
Hello, I was wondering, is it possible to run SMAppService.daemon... as root? let service = SMAppService.daemon(plistName: "myApp.agent.plist") Also, is it possible to launch the SMAppService.daemon without the XPC connection? The daemon currently supports grpc. I was thinking about running it via Process?
4
0
305
May ’24
Widget does not appear in gallery If widget extension is not sandboxed
I have a bundled application that contains a widget extension. On launching the application once the widget appears in the widget gallery, However, I have observed that If my widget extension is not sandboxed, the widget fails to show in the widget gallery. Is this expected? I am using the same xcode project and just that AppSandbox capability for the widget extension target is causing this. Can someone please explain why is this happening?
0
2
330
May ’24