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

Post

Replies

Boosts

Views

Activity

iOS18 crash
I'm having a problem launching an iOS app。Appeared on individual iOS 18 and iPhone 16。 The real-time log displays the following errors: Sep 26 18:51:58 hetieweideiPhone SpringBoard(FrontBoard)[3869] : Bootstrapping failed for <FBApplicationProcess: 0x7c898ad00; app<cn.com.***>:> with error: <NSError: 0x303c0e6d0; domain: RBSRequestErrorDomain; code: 5; "Launch failed."> { NSUnderlyingError = <NSError: 0x303c0d590; domain: NSPOSIXErrorDomain; code: 85> { NSLocalizedDescription = Launchd job spawn failed; }; } 20240926_185203_474_iPhone.log
0
0
401
Sep ’24
How to contact the NSFileProviderDomainUsageDescription
Hi,Regarding FileProvider, I know it has a permission authorization pop-up to control whether to open the FileProvider extension in the application settings But when I first used it, the switch was turned off by default. I noticed that some applications can pop up an authorization pop-up to prompt the user to turn on this permission I would like to ask what API this authorization pop-up is displayed through I expect the authorization pop-up window to pop up as shown in the following picture Thanks
2
0
293
Sep ’24
Odd dyld crash: '/usr/lib/libc++.1.dylib' (no such file, no dyld cache)
We recently started encountering a perplexing crash when we build our iOS application to device: Termination Reason: DYLD 1 Library missing Library not loaded: /usr/lib/libc++.1.dylib Referenced from: <2A9D8B8D-E81E-3FEC-A4B7-1EA4841CFC4F> /Volumes/VOLUME/*/Walmart.app/Walmart Reason: tried: '/usr/lib/libc++.1.dylib' (no such file), '/private/preboot/Cryptexes/OS/usr/lib/libc++.1.dylib' (no such file), '/usr/lib/libc++.1.dylib' (no such file, no dyld cache) (terminated at launch; ignore backtrace) Highlighted by Thread: 0 See attachment for full crash log. We've been spinning our wheels trying to understand why this could be happening. We've had the OTHER_LDFLAGS= -lc++ for some time now and we tried linking libc++.1.tbd to no avail. Any help? Walmart-2024-09-26-154332.ips
7
2
611
Sep ’24
Opening up Siri prefs from an app
In our onboarding sequence we inform the user that Siri is required and to set it up if they have it off. We have a link that takes us to the root of the Systems tree, but have been unable to get it to launch into the Siri prefs itself, using a scheme that's widely available on StackOverflow, GitHub and so on. ChatGPT says it can't be done as of 2022. I see a list on GitHub of the domains that was last updated just a year ago, suggesting that at least as of 17 it "should" work. Another place said Apple would bounce apps which attempt to do that (we have the recommended URL string already in there which should have been detectable by their scans, and have not been bounced due to that so far).
1
0
229
Sep ’24
BGTask expiry is never called for the requested BGTask.
We have a push-to-talk client, Part of Push APNS, app never received the BG task expiry. The app is suspended. Received Push-To-Talk APNS Here requested a BGTask and it got successfully registered Since it is a PTT call path, it ended immediately(via code) due to internal restrictions Ex: DND mode for client specific. The client allowed BG time more than 30 seconds and looks client has been suspended but Never received a BG task expiration handler from OS In sys diagnose logs confirmed, BGTask registered successfully 2024-09-03 16:18:47.331890 +0530 default AT&T EPTT : Created background task . But never got fired expiration handler. Feedback - FB15145380
3
0
218
Sep ’24
Crash with any app when switching input method on iOS 18 using iPhone Mirroring
It crashes any app including System Preferences or etc. Below is an example of crash log with my own app. 2024-09-26_15-05-07.3244_+0800-b0897577a4d8c61bb9452bf8ae1f2a0ca097aabc.crash Last Exception Backtrace: 0 CoreFoundation 0x19fa6508c __exceptionPreprocess + 164 (NSException.m:249) 1 libobjc.A.dylib 0x19cd672e4 objc_exception_throw + 88 (objc-exception.mm:356) 2 CoreFoundation 0x19fa29140 -[__NSArrayM objectAtIndexedSubscript:] + 592 (NSArrayM.m:309) 3 UIKitCore 0x1a2fb6554 -[UIInputSwitcherView localizedTitleForItemAtIndex:] + 32 (UIInputSwitcherView.m:860) 4 UIKitCore 0x1a2fbda68 -[UIKeyboardMenuView customizeCell:forItemAtIndex:] + 384 (UIKeyboardMenuView.m:1392) 5 UIKitCore 0x1a2fb68ac -[UIInputSwitcherView customizeCell:forItemAtIndex:] + 88 (UIInputSwitcherView.m:914) 6 UIKitCore 0x1a2fb681c -[UIInputSwitcherView tableView:cellForRowAtIndexPath:] + 192 (UIInputSwitcherView.m:907)
1
0
274
Sep ’24
poll(2) slower than select(2)
I have a program that creates a TCP server socket and listens on it. When the program accepts a connection from a client, it calls poll(2) repeatedly to see if there is any input available, like this: for (int i = 0; i < 1000000; i++) { struct pollfd fds[] = {{ .fd = clientfd, .events = POLLIN, .revents = 0 }}; int r = poll(fds, 1, 0); if (r < 0) { perror("poll"); exit(1); } } On my Intel iMac, this takes about 15 seconds. If I use select(2) instead, as follows, it takes about 550ms. for (int i = 0; i < 1000000; i++) { struct timeval timeout = { .tv_sec = 0, .tv_usec = 0 }; fd_set infds; FD_ZERO(&infds); FD_SET(clientfd, &infds); int r = select(1, &infds, 0, 0, &timeout); if (r < 0) { perror("select"); exit(1); } } https://gist.github.com/xrme/cd42d3d753ac00861e439e012366f2cf is a C source file that contains a complete example. If you're inclined to take a look, please download the file from the gist and do cc poll-test.c and then ./a.out. Connect to it with nc 127.0.0.1 6444 and observe that it will take quite a while. (Activity Monitor will show a large number of "idle wake ups", but I'm not clear what that signifies.) Recompile with cc -DUSE_SELECT, run ./a.out and connect again, and it will complete in under a second. Advisability of this usage aside (which is adapted from a much larger system), is there anything here to be done to make poll faster? Other systems I have looked at (FreeBSD, OmniOS, Linux) do not exhibit the same slowdown with poll.
2
0
181
Sep ’24
Issue with IOServiceOpen
I have an app that is used to control features of a device with a driverkit driver. I am having trouble creating a connection a certain device. The Sample code from "Communicating between a DriverKit extension and a client app. The sample code shows: ret = IOServiceGetMatchingServices(kIOMainPortDefault, IOServiceNameMatching(kDextIdentifier), &iterator); I cannot use kDextIdentifier but need to find a service with a certain BSD Name. So in this case I try: ret = IOServiceGetMatchingServices(kIOMainPortDefault, IOBSDNameMatching(kIOMasterPortDefault, NULL, interface), &iterator); In each case the call completes correctly, and we get an iterator. I can also use IOServiceGetMatchingService with IOBSDNameMatching, and that completes correctly as well. However when I attempt IOServiceOpen with the first case, the connection is created correctly. However, I have four of these in the machine, and I need to select the service and subsequently connection for a certain BSD name. When I attempt the IOServiceOpen with the second/third calls, the IOServiceOpen call fails with error 0x2c7 which is unsupported. Is there an entitlement I need to make this work?
1
0
233
Sep ’24
iOS 18 crash
Bootstrapping failed for <FBApplicationProcess: 0x52ed3f180; app:> with error: <NSError: 0x3020c42a0; domain: RBSRequestErrorDomain; code: 5; "Launch failed."> { NSUnderlyingError = <NSError: 0x3020c4630; domain: NSPOSIXErrorDomain; code: 85> { NSLocalizedDescription = Launchd job spawn failed; }; }
1
0
235
Sep ’24
Message filter extension doesn't run on iOS 18
If I run an app with a message filter extension on < iOS 18 everything is as expected, if I run the same app, without any changes on iOS 18 then it doesn't work. I've discovered that problems occur if the extension has the following code: extension MessageFilterExtension: ILMessageFilterQueryHandling, ILMessageFilterCapabilitiesQueryHandling { func handle(_ capabilitiesQueryRequest: ILMessageFilterCapabilitiesQueryRequest, context: ILMessageFilterExtensionContext, completion: @escaping (ILMessageFilterCapabilitiesQueryResponse) -> Void) { let response = ILMessageFilterCapabilitiesQueryResponse() response.transactionalSubActions = [.transactionalCarrier, .transactionalHealth, .transactionalPublicServices, .transactionalFinance, .transactionalWeather, .transactionalRewards, .transactionalOrders, .transactionalOthers, .transactionalReminders] response.transactionalSubActions = [.transactionalFinance, .transactionalOrders, .transactionalHealth] completion(response) } This code doesn't run on iOS 18, however the following code does run on iOS 18: let response = ILMessageFilterCapabilitiesQueryResponse() completion(response) I downloaded several apps from the app store which provide message filtering, within the Message app they all had one thing in common, on < iOS 18 they all show 12 filtering categories, but within iOS 18 they only show 2. So it seems the issue is endemic and effects other apps, not just mine.
3
1
337
Sep ’24
CoreHID HidVirtualDevice Returning Nil
I'm trying to follow the guide for creating a virtual device here. My goal was to see the set report print the data (and to eventually create a virtual gamepad and dispatch input reports of button presses). I am on MacOS v15.0 and I have CoreHID.framework linked (not embedded). However, when using the sample code below, HIDVirtualDevice returns nil. import Foundation import CoreHID // This describes a keyboard device according to the Human Interface Devices standard. let keyboardDescriptor: Data = Data([0x05, 0x01, 0x09, 0x06, 0xA1, 0x01, 0x05, 0x07, 0x19, 0xE0, 0x29, 0xE7, 0x15, 0x00, 0x25, 0x01, 0x75, 0x01, 0x95, 0x08, 0x81, 0x02, 0x95, 0x01, 0x75, 0x08, 0x81, 0x01, 0x05, 0x08, 0x19, 0x01, 0x29, 0x05, 0x95, 0x05, 0x75, 0x01, 0x91, 0x02, 0x95, 0x01, 0x75, 0x03, 0x91, 0x01, 0x05, 0x07, 0x19, 0x00, 0x2A, 0xFF, 0x00, 0x95, 0x05, 0x75, 0x08, 0x15, 0x00, 0x26, 0xFF, 0x00, 0x81, 0x00, 0x05, 0xFF, 0x09, 0x03, 0x75, 0x08, 0x95, 0x01, 0x81, 0x02, 0xC0]) let properties = HIDVirtualDevice.Properties(descriptor: keyboardDescriptor, vendorID: 1) let device = HIDVirtualDevice(properties: properties) final class Delegate : HIDVirtualDeviceDelegate { // A handler for system requests to send data to the device. func hidVirtualDevice(_ device: HIDVirtualDevice, receivedSetReportRequestOfType type: HIDReportType, id: HIDReportID?, data: Data) throws { print("Device received a set report request for report type:\(type) id:\(String(describing: id)) with data:[\(data.map { String(format: "%02x", $0) }.joined(separator: " "))]") } // A handler for system requests to query data from the device. func hidVirtualDevice(_ device: HIDVirtualDevice, receivedGetReportRequestOfType type: HIDReportType, id: HIDReportID?, maxSize: size_t) throws -> Data { print("Device received a get report request for report type:\(type) id:\(String(describing: id))") assert(maxSize >= 4) return (Data([1, 2, 3, 4])) } } if (device != nil) { print("Device is ready") await device?.activate(delegate: Delegate()) try await device?.dispatchInputReport(data: Data([5, 6, 7, 8]), timestamp: SuspendingClock.now) } else { print("Device not created") }
4
0
218
Sep ’24
Sequoia - incorrect alert about "app wants to access data from other app
We have a sync solution with two apps that are an application-group. I use an NSUserDefaults object opened with initWithSuiteName to share config data between the two. That has not been a problem in the past. However,in the Sequoia Beta 7 (24a5327a), when I read or write to the NSUserDefaults from either app, the " would like to access data from other apps" dialog appears. This occurs on every restart on our test systems and more often for some of our customers testing (perhaps with older betas). The warning is not indicative of what I'm doing, and the fact that it comes up every single launch will freak out customers. There was a similar issue opened in Beta 4 that was marked fixed in beta 5: https://developer.apple.com/forums/thread/760072?answerId=799001022#799001022 I posted this in the beta feedback forums before GA but got no response.
5
1
295
Sep ’24
iOS 18 Different Behavior in CallKit with Dynamic Island Phones
We’ve encountered significant differences in our VoIP app’s workflow between iOS 17 and iOS 18, particularly on devices with Dynamic Island. Our app functioned as expected in iOS 17 and even iOS 18 on devices without Dynamic Island, but with the public release of iOS 18 on Dynamic Island-supported iPhones, we’re receiving a lot of feedback from users reporting confusing behavior during both incoming and outgoing calls. Here’s a breakdown of the issue: In iOS 17 and iOS 18 (on non-Dynamic Island models), when our app initiates a second call, the app remains in the foreground, allowing the user to see both calls within our UI. Users can manage their calls, swap between them, and even merge them, all without leaving the app. If the user switches to the CallKit controller via the app switcher, it reflects the state of the calls in our app, which has worked well for our users. However, on iOS 18 devices with Dynamic Island, adding a second call now backgrounds our app and brings the CallKit controller UI to the foreground. This causes confusion, as users lose context of managing multiple calls within our app. Though users can switch back to our app manually, this extra step disrupts their workflow, especially when handling multiple active calls. This change doesn't occur on iOS 18 devices without Dynamic Island. Additionally, during an active call, if an incoming call arrives, the Dynamic Island notification takes over, and the app UI is again backgrounded in favor of the CallKit controller screen. Even when declining the incoming call from the notification, the user remains in the CallKit controller UI, requiring another step to return to our app using the app switcher or the "app" button in CallKit. This inconsistent behavior makes call management unnecessarily complex for our users, who need a streamlined experience, especially since our app is used in healthcare communications that is often critical in nature. Is there any documentation on changes to CallKit behavior specific to Dynamic Island devices in iOS 18? We’d appreciate any guidance on designing a VoIP experience that doesn’t involve these disruptive view switches, particularly for Dynamic Island-supported iPhones. Thank you for your help!
2
0
440
Sep ’24
API to fetch dhcpv6 information
I am trying to fetch DHCP server identifiers of the current network. For IPv4 I am able to get this information using SCDynamicStoreCopyDHCPInfo and then using DHCPInfoGetOptionData fetching option 54. I am trying to do the same thing for IPv6, in my scutil I do see DHCPv6 present. Is there any API present which fetches this information for v6 DHCP servers, or do I have to get this direct from scutil?
5
0
297
Sep ’24
Need Help! ANCS Client
Hi I am looking for examples where a BLE Device (ESP32 or Arduino) can be a BLE Client and subscribe to iPhone ANCS Services. Unfortunately my code is UNABLE TO FIND my iPhone device even after scanning for nearby BLE Devices. ANCS Documentation (Not helpful): https://developer.apple.com/library/archive/documentation/CoreBluetooth/Reference/AppleNotificationCenterServiceSpecification/Specification/Specification.html I am able to create a BLE Device as a server but I am looking to subscribe to incoming call notifications. PLEASE HELP if you have done this before. Thanks
2
0
220
Sep ’24
Creating file bookmarks doesn't work anymore on macOS 15 Sequoia
Before updating to macOS 15 Sequoia, I used to be able to create file bookmarks with this code: let openPanel = NSOpenPanel() openPanel.runModal() let url = openPanel.urls[0] do { let _ = try url.bookmarkData(options: [.withSecurityScope]) } catch { print(error) } Now I get an error Error Domain=NSCocoaErrorDomain Code=256 "Failed to retrieve app-scope key" These are the entitlements: com.apple.security.app-sandbox com.apple.security.files.user-selected.read-write com.apple.security.files.bookmarks.app-scope Strangely, my own apps continued working, after updating to macOS 15 some days ago, until a few moments ago. Then it seems that all of a sudden my existing bookmarks couldn't be resolved anymore, and no new bookmarks could be created. What could be the problem?
18
3
1.4k
Sep ’24
scenePhase change on display cadence change
My Watch app is a workout app that has to be careful to minimize CPU load when backgrounded to get below the 15% avg/60 s in order to avoid being terminated by the system. Accordingly I have logic to detect a transition to the background using a .onChange(of: scenePhase) { phase in… } handler which works well for cases where the app is backgrounded - it is able to reduce its CPU load to just 6-9% while backgrounded. But a special case of the change to scenePhase presents a challenge - when an overlay such as the Control Center or a long-look notification presents, there is no transition to .background, only to .inactive. This is a problem because the system nevertheless imposes the background CPU limit on the app while it’s being covered by the overlay, even though the app didn’t get the .background transition on the scenePhase handler. To further complicate matters, it now seems with watchOS 11 that whenever a transition is made in the screen cadence from .live to .seconds, the scenePhase handler is called with a transition to .inactive. Which is a problem because this transition has to be distinguished from the case of the overlay presentation - the cadence change has no CPU usage implications as long as the app remains foregrounded, but the overlay presentation does, and the system will terminate the app if it exceeds 15% avg/60s. My question: how can I distinguish between the two causes of the transition to .inactive for the two cases: 1) when the overlay presents, and 2) when the display shifts to the slow cadence?
0
0
195
Sep ’24
Problems with SensorKit data calls
The Deligate 'didFetchResult' method of fetching data past 24 hours from SensorKit is not being called. It is confirmed that you have already granted full access to the SensorKit and that data on the Ambient value in the device's personal information -> research sensor & usage data are recorded. It is possible to export to an lz4 file. I want to have the data after 24 hours called to the app, but other Deligate methods are called, but only Deligate that gets the illumination value is not called. Is it understood that only data past 24 hours can be imported after startRecoding() is called? If so, in order to receive data past 24 hours, do I have to continue to receive the illumination data value in the background for more than 24 hours to receive the Ambient value afterwards? import Foundation import SensorKit import UIKit final class SensorKitManager: NSObject, ObservableObject, SRSensorReaderDelegate { static let shared = SensorKitManager() private let ambientReader = SRSensorReader(sensor: .ambientLightSensor) var availableDevices: [SRDevice] = [] @Published var ambientLightData: [AmbientLightDataPoint] = [] var isFetching = false var isRecordingAmbientLight = false private override init() { super.init() setupReaders() checkAndRequestAuthorization() } private func setupReaders() { ambientReader.delegate = self } // MARK: - Permission Request func requestAuthorization() { SRSensorReader.requestAuthorization(sensors: [.ambientLightSensor]) { [weak self] error in DispatchQueue.main.async { guard let self = self else { print("Permission request aborted") return } if let error = error { print("Permission request failed: \(error.localizedDescription)") } else { print("Permission request succeeded") self.startRecordingAmbientLightData() } } } } func checkAndRequestAuthorization() { let status = ambientReader.authorizationStatus switch status { case .authorized: print("Ambient light sensor access granted") startRecordingAmbientLightData() case .notDetermined: print("Ambient light sensor access undetermined, requesting permission") requestAuthorization() case .denied: print("Ambient light sensor access denied or restricted") @unknown default: print("Unknown authorization status") } } // MARK: - Ambient Light Data Logic func startRecordingAmbientLightData() { guard !isRecordingAmbientLight else { print("Already recording ambient light data.") return } print("Starting ambient light data recording") isRecordingAmbientLight = true ambientReader.startRecording() fetchAmbientLightData() fetchAmbientDeviceData() } func fetchAmbientLightData() { print("Fetching ambient light data") let request = SRFetchRequest() let now = Date() let fromTime = now.addingTimeInterval(-72 * 60 * 60) let toTime = now.addingTimeInterval(-25 * 60 * 60) request.from = SRAbsoluteTime(fromTime.timeIntervalSinceReferenceDate) request.to = SRAbsoluteTime(toTime.timeIntervalSinceReferenceDate) print("Fetch request: \(fromTime) ~ \(toTime)") ambientReader.fetch(request) } private func displayAmbientLightData(sample: SRAmbientLightSample) { print("Ambient light: \(sample.lux.value) lux") print("Current ambientLightData content:") for data in ambientLightData { print("Timestamp: \(data.timestamp), Lux: \(data.lux)") } } // MARK: - Device Data Logic private func fetchAmbientDeviceData() { print("Fetching device information") let request = SRFetchRequest() let now = Date() let fromDate = now.addingTimeInterval(-72 * 60 * 60) let toDate = now.addingTimeInterval(-24 * 60 * 60) request.from = SRAbsoluteTime(fromDate.timeIntervalSinceReferenceDate) request.to = SRAbsoluteTime(toDate.timeIntervalSinceReferenceDate) if availableDevices.isEmpty { print("No devices available") ambientReader.fetchDevices() } else { for device in availableDevices { print("Starting data fetch (Device: \(device))") request.device = device ambientReader.fetch(request) print("Fetch request sent (Device: \(device))") } } } // MARK: - SRSensorReaderDelegate Methods func sensorReader(_ reader: SRSensorReader, didFetch devices: [SRDevice]) { availableDevices = devices for device in devices { print("Fetched device: \(device)") } if !devices.isEmpty { fetchAmbientDeviceData() } } func sensorReader(_ reader: SRSensorReader, fetching fetchRequest: SRFetchRequest, didFetchResult result: SRFetchResult<AnyObject>) -> Bool { print("sensorReader(_:fetching:didFetchResult:) method called") if let ambientSample = result.sample as? SRAmbientLightSample { let luxValue = ambientSample.lux.value let timestamp = Date(timeIntervalSinceReferenceDate: result.timestamp.rawValue) // Check for duplicate data and add it if !ambientLightData.contains(where: { $0.timestamp == timestamp }) { let dataPoint = AmbientLightDataPoint(timestamp: timestamp, lux: Float(luxValue)) ambientLightData.append(dataPoint) print("Added ambient light data: \(luxValue) lux, Timestamp: \(timestamp)") } else { print("Duplicate data, not adding: Timestamp: \(timestamp)") } // Output data self.displayAmbientLightData(sample: ambientSample) } return true } func sensorReader(_ reader: SRSensorReader, didCompleteFetch fetchRequest: SRFetchRequest) { print("Data fetch complete") if ambientLightData.isEmpty { print("No ambient light data within 24 hours.") } else { print("ambientLightData updated") for dataPoint in ambientLightData { print("Added ambient light data: \(dataPoint.lux) lux, Timestamp: \(dataPoint.timestamp)") } } } }
0
0
217
Sep ’24