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

Post

Replies

Boosts

Views

Activity

FileProvider Extension's Version is not matching in Mac
Hello, I would like to know why my FileProvider. apex application cannot run on a Mac OS 12.0 computer after I compiled it on Mac OS 4.5. I have changed the macOS Deployment Target and Minimum Deployment in the XCode configuration file to 11.0, but it still cannot run The error is as follows:  2024-09-23 10:10:24.264067+0800 0xab312 Error 0x0 83438 0 O+Connect: (libFileProviders Manager. dylib) [com. oplus. DeviceSpace: FileProviders Manager] Unable to add domain, error: Error Domain=NSFileProviders Error Domain Code=-2001 "The application is currently unavailable. UserInfo={NSLocalizedDescription=The application is currently unavailable.} I want to know what this error means and how to solve it
2
0
241
Sep ’24
How to allow my app to receive BLE data from sensor while running in background?
I have a sensor that communicates via BLE periodically. The intention is for it to be a set it and forget it kind of thing. The user will check the app periodically but won't be doing so frequently. I need the app to be able to still receive the BLE data from the sensor even if it's running in the background so that when the user does check the app, they can see everything that's been happening. I've read a lot from 2020 - 2021 where it seems many developers are struggling with the same issue. Is there a supported way to do this now? How to have my app run in the background and still be able to receive BLE data?
1
0
224
Sep ’24
Detecting a backgrounded iOS-Peripheral
We are developing an app where we want iPhone to iPhone communication via bluetooth. We are using the core bluetooth API. One iPhone acts as the peripheral and the other as the central. When both apps are on screen they successfully find each other and can connect. However when the peripheral is in background the central can't find it. To be clear the central is still in foreground. I have consulted this page: https://developer.apple.com/library/archive/documentation/NetworkingInternetWeb/Conceptual/CoreBluetooth_concepts/CoreBluetoothBackgroundProcessingForIOSApps/PerformingTasksWhileYourAppIsInTheBackground.html and other resources. From my understanding the service UUID should be moved to the manufacturer data. This makes it difficult for non-iOS devices to detect the service but the documentation says that my central should be able to find the peripheral. I have added the required keys to the pList and am explicitly searching for the mentioned service UUID. When using a third party BLE Tool I'm able to find and communicate with the peripheral even when it is in background mode. I know that some option-keys will be ignored but from my understanding they should still find each other at least once. This was tested with two iOS 18 iPhones. Here is the code im using: import UIKit import CoreBluetooth class ViewController: UIViewController { private var centralManager: CBCentralManager! private var peripheralManager: CBPeripheralManager! override func viewDidLoad() { super.viewDidLoad() } @IBAction func btnPeripheral(_ sender: Any) { peripheralManager = CBPeripheralManager(delegate: self, queue: nil, options: nil) } @IBAction func btnCentral(_ sender: Any) { print("central go") centralManager = CBCentralManager(delegate: self, queue: nil) } } extension ViewController: CBCentralManagerDelegate { func centralManagerDidUpdateState(_ central: CBCentralManager) { print("central state: \(central.state)") switch central.state { case .poweredOn: print("central powered on") centralManager.scanForPeripherals(withServices: [CBUUID(string:"db9acb1e-1ac4-4f70-b58c-3b3dcea84703")], options: [CBCentralManagerScanOptionAllowDuplicatesKey: true]) default: print("central not powered on") } } func centralManager(_ central: CBCentralManager, didDiscover peripheral: CBPeripheral, advertisementData: [String : Any], rssi RSSI: NSNumber) { print("Dicovered \(peripheral)") } } extension ViewController: CBPeripheralManagerDelegate { func peripheralManagerDidUpdateState(_ peripheral: CBPeripheralManager) { print("peripheral state: \(peripheral.state)") if peripheral.state == .poweredOn { print("powered on") let uuid = CBUUID(string: "db9acb1e-1ac4-4f70-b58c-3b3dcea84703") let service = CBMutableService(type: uuid, primary: true) peripheralManager.add(service) peripheralManager.startAdvertising([CBAdvertisementDataServiceUUIDsKey: [uuid], CBAdvertisementDataLocalNameKey: "MyService"]) } } }
2
2
390
Sep ’24
Opening external storage in Finder is not working
I am trying to open external/mounted storage in Finder. I simply just want to show the root directory. I have tried multiple things, none worked. NSWorkspace.shared.open() Does work when opening the user's disk (e.g. Macintosh HD), but when comes to any of the external storages a warning appears: "The application "ABC" does not have permission to open "Folder Name". Now, the app ha been granted all permissions in the preferences (Full Disk Access + Files and Folders). Furthermore, I don't even need or care of accessing this directory from within my app. I want the Finder to open it. I am using com.apple.security.files.user-selected.read-only and testing on MacOS: 14.6.1
5
0
449
Sep ’24
Bluetooth State Restoration: Relaunch app after update?
Hi. Background: We have an app acting as central, keeping a persistent connection to a peripheral body worn sensor, in order to ensure that the sensor behaves as expected. We've managed make a robust system, that stays connected while the peripheral is in range. When the peripheral gets out of range we're fine with the app being suspended, as long as it's revived when the sensor gets back in range. This works fine using the Restoration Identifier This revival works also works fine after a phone restart. Now for the question: It doesn't work when upgrading the app. (tested in testflight) As the App Upgrade case isn't specified in: https://developer.apple.com/library/archive/qa/qa1962/_index.html we'd like to know if this case is supported. If it is supported, we'd be happy if you could provide some additional insights. Best Regards Rasmus Tønnesen UNEEG medical
2
0
196
Sep ’24
App using audio background mode gets suspended
Hi. I am developing an alarm app. My app plays white noise to help users get into sleep properly. To keep white noise playing in the background, my app uses audio background mode. The problem is that my app sometimes gets suspended few hours after getting into background. I cannot find the exact reason for it. Doesn't audio background guarantee that app is not suspended by system? Then how can I handle this issue so that my app can keep white noise playing feature?
3
0
222
Sep ’24
Help with eSIM Entitlement Request for Core Telephony API
Hi everyone, I'm currently developing an app that installs eSIM profiles directly within the app and checks if the device supports eSIM. For this functionality, I understand that I need the eSIM entitlement for the Core Telephony API. I submitted a request for the eSIM entitlement to Apple about three weeks ago, but I haven't received a response yet. Has anyone experienced a similar situation? What would be the best course of action to follow up on this? Any guidance or suggestions would be greatly appreciated. Thank you!
3
0
318
Sep ’24
BLE Scanning stops when phone is in locked mode
I have a solution where my application should scan the Bluetooth enabled Beacon devices in the foreground, background, locked mode for the iphone. Currently we have built the project, which is working fine in foreground mode. We have tried exploring multiple options to enable the feature in background and locked mode. As of now, we have come up with the solution which implements Picture in Picture mode in the application and once the application is minimized. The PIP window opens which solves our problem. But the problem stays with locked mode. The scanning is not working in locked mode. So can we know how the bluetooth scanning will work in background and locked mode. Please also mention the alternative solutions to the problem statement if background and locked mode scanning is not possible. I have attached the project source code for reference. This project is being built for Google, so it is bit urgent. Can I expect a quick response to this query?
4
0
437
Sep ’24
Host Card Emulation / Card Session for payment URL
We have a financial application where we want to use NFC to broadcast a Payment URL to another iPhone or Android device when initiating a payment transaction. This will then open the banking application installed on the recipient’s device, allowing the transaction to be completed. We have already made the necessary requests to Apple and configured the entitlements file as follows: <key>aps-environment</key> <string>development</string> <key>com.apple.developer.nfc.hce</key> <true/> <key>com.apple.developer.nfc.hce.iso7816.select-identifier-prefixes</key> <array> <string>D2760000850101</string> </array> <key>com.apple.developer.nfc.readersession.formats</key> <array> <string>TAG</string> <string>NDEF</string> </array> </dict> I've tried to use CardSession with the sample code provided by Apple on their site: Card Session The connection between the devices (two iPhones, OS is above iOS 17.4) is established, the event stream's case .received(let cardAPDU): works, however, when I send the response, nothing really happens Initial APDU response: CLA | 0x00 INS | 0xA4 P1 | 0x04 P2 | 0x00 DATA | 0x7D2760000850101 (guess this is the AID) Le | 00 Sending the apdu response in the event stream via: do { guard let request = APDUUtil.createAPDURequest(from: paymentUrl) else { return } try await cardAPDU.respond(response: request) await cardSession.stopEmulation(status: .success) } static func createAPDURequest(from paymentUrl: URL?) -> Data? { guard let paymentUrl else { return nil } let ndefMessage = APDUUtil.createNDEFMessage(from: paymentUrl) APDUUtil.updateNdefRecordFile(ndefMessage: ndefMessage) let data = Data(mNdefRecordFile) let apdu = NFCISO7816APDU(instructionClass: 0x00, instructionCode: 0xA4, p1Parameter: 0x04, p2Parameter: 0x00, data: data, expectedResponseLength: -1) // Tried with different values return apdu.data } static func createNDEFMessage(from url: URL?) -> NFCNDEFMessage? { guard let url, let payload = NFCNDEFPayload.wellKnownTypeURIPayload(url: url) else { return nil } return NFCNDEFMessage(records: [payload]) } static func updateNdefRecordFile(ndefMessage: NFCNDEFMessage?) { guard let ndefMessage else { return } // Convert the NFCNDEFMessage to Data let ndefMessageData = ndefMessage.records.reduce(Data()) { result, record -> Data in var result = result result.append(record.payload) return result } let nlen = ndefMessageData.count mNdefRecordFile = [UInt8](repeating: 0, count: nlen + 2) // Store the length in the first two bytes (big-endian format) mNdefRecordFile[0] = UInt8((nlen & 0xFF00) >> 8) mNdefRecordFile[1] = UInt8(nlen & 0xFF) // Copy the NDEF message data into the data starting at index 2 mNdefRecordFile.replaceSubrange(2..<mNdefRecordFile.count, with: ndefMessageData) } Could someone please help? I also tried to send the payment url as Data made from url. We have a working Android application, which uses HCE too (they use NDEF message and byte arrays in communication). As I've seen, the NFCNDEFReaderSessionDelegate and NFCTagReaderSessionDelegate is not suitable for communication between two iOS devices...
1
0
377
Sep ’24
Install non-sandboxed Helper app from sandboxed Main app
Hi, I developed a utility app that allows monitoring system activity and usage. It is a sandboxed app distributed via the Mac App Store. Because in the sandbox I cannot fetch enough data about system activity (like processor temperature, fans, etc.), I developed a little Helper app (non-sandboxed), which currently is distributed via my website, and to enable extra features it provides, the user is asked to download and install it manually (it installs itself as a daemon). I'm looking for ways to improve the user experience. Ideally, it would be a button inside the main app, which would download and install the helper app, without asking the user to do more than pressing a button. As far as I understand, in the previous versions of macOS, it would be possible with privileged helpers and SMJobBless, but those are deprecated APIs now. Another way I tried, is simply downloading the installer app from the website, but opening it programmatically from the main app is tricky since it cannot remove it from the quarantine, in other words, it fails with "operation not permitted". Any advice is appreciated!
4
0
370
Sep ’24
Has iOS 18 changed the threshold for decoding base64 into ASCII code?
This code fails to decode when running on iOS 18.0 or 18.1 beta device. But succeeds below iOS 18, such as iOS 17.5. Xcode Version 16.0 (16A242d) let base64String = "1ZwoNohdE8Nteis/IXl1rg==" if let decodedData = Data(base64Encoded: base64String, options: .ignoreUnknownCharacters) { if let decodedString = String(data: decodedData, encoding: .ascii) { print("Decoded string: \(decodedString)") } else { print("Failed to decode string using ascii encoding") } } else { print("Failed to decode Base64 string") }
7
0
657
Sep ’24
vnop_lookup returning ENOENT aborts rm(1)
When recursively removing a directory with a large number of entries that resides on my custom filesystem, rm(1) aborts with ENOENT. % rm -Rv /Volumes/myfs/linux-kernel/linux-6.10.6 [...] /Volumes/myfs/linux-kernel/linux-6.10.6/include/drm/bridge/aux-bridge.h /Volumes/myfs/linux-kernel/linux-6.10.6/include/drm/bridge/dw_hdmi.h rm: fts_read: No such file or directory I'm observing the following sequence of calls being made. 2024-09-17 17:58:25 vnops.c:281 myfs_vnop_lookup: rm-936 -> dw_hdmi.h ;initial lookup call 2024-09-17 17:58:25 vnops.c:315 myfs_vnop_lookup: -> cache_lookup(dw_hdmi.h) 2024-09-17 17:58:25 vnops.c:317 myfs_vnop_lookup: <- cache_lookup(dw_hdmi.h) -> 0 ;cache miss 2024-09-17 17:58:25 rpc.c:431 myfsLookup: rm-936 -> dw_hdmi.h ;do remote lookup 2024-09-17 17:58:25 rpc.c:500 myfsLookup: -> myfs_lookup_rpc(dw_hdmi.h) 2024-09-17 17:58:25 rpc.c:502 myfsLookup: <- myfs_lookup_rpc(dw_hdmi.h) -> 0 ;file found and added to vfs cache 2024-09-17 17:58:25 vnops.c:281 myfs_vnop_lookup: rm-936 -> dw_hdmi.h ;subsequent lookup call 2024-09-17 17:58:25 vnops.c:315 myfs_vnop_lookup: -> cache_lookup(dw_hdmi.h) 2024-09-17 17:58:25 vnops.c:317 myfs_vnop_lookup: <- cache_lookup(dw_hdmi.h) -> -1 ;cache hit 2024-09-17 17:58:25 vnops.c:1478 myfs_vnop_remove: -> myfs_unlink(dw_hdmi.h) ;unlink sequence 2024-09-17 17:58:25 rpc.c:1992 myfs_unlink: -> myfs_unlink_rpc(dw_hdmi.h) 2024-09-17 17:58:25 rpc.c:1994 myfs_unlink: <- myfs_unlink_rpc(dw_hdmi.h) -> 0 ;remote unlink succeeded 2024-09-17 17:58:25 vnops.c:1480 myfs_vnop_remove: <- myfs_unlink(dw_hdmi.h) -> 0 2024-09-17 17:58:25 vnops.c:1487 myfs_vnop_remove: -> cache_purge(dw_hdmi.h) 2024-09-17 17:58:25 vnops.c:1489 myfs_vnop_remove: <- cache_purge(dw_hdmi.h) 2024-09-17 17:58:25 vnops.c:1499 myfs_vnop_remove: -> vnode_recycle(dw_hdmi.h) 2024-09-17 17:58:25 vnops.c:1501 myfs_vnop_remove: <- vnode_recycle(dw_hdmi.h) 2024-09-17 17:58:27 vnops.c:281 myfs_vnop_lookup: fseventsd-101 -> dw_hdmi.h ;another lookup; why? 2024-09-17 17:58:27 vnops.c:315 myfs_vnop_lookup: -> cache_lookup(dw_hdmi.h) 2024-09-17 17:58:27 vnops.c:317 myfs_vnop_lookup: <- cache_lookup(dw_hdmi.h) -> 0 2024-09-17 17:58:27 rpc.c:431 myfsLookup: fseventsd-101 -> dw_hdmi.h 2024-09-17 17:58:27 rpc.c:500 myfsLookup: -> myfs_lookup_rpc(dw_hdmi.h) 2024-09-17 17:58:27 rpc.c:502 myfsLookup: <- myfs_lookup_rpc(dw_hdmi.h) -> ENOENT(2) 2024-09-17 17:58:27 vnops.c:371 myfs_vnop_lookup: SET(NNEGNCENTRIES): dw_hdmi.h 2024-09-17 17:58:27 vnops.c:373 myfs_vnop_lookup: ENOENT(2) <- shouldAddToNegativeNameCache(dw_hdmi.h) I checked the value of vnode's v_iocount when vnop_remove and vnop_reclaim are being called. Each vnop_remove and followed by vnop_reclaim with v_iocount set to 1 in both calls, as expected. What I don't understand is why after removing the file is there another lookup call being made, which returns ENOENT to rm(1), which causes it to abort. Any pointers on what could be amiss there would be much appreciated.
3
0
357
Sep ’24
SwiftUI @main Accessing UserDefaults Too Early Before applicationDidFinishLaunching
I'm working on a macOS and iOS app using SwiftUI. And received bug from very few user that they are being logged out, even tho they didn't. So i'm assuming issue is relevant to this forum post, and that the keychain data and user defaults aren't available very early on in an app's lifecycle (presumably from cold start). There is fix available for iOS but didn't find anything relevant to isProtectedDataAvailable for macOS. I'm accessing UserDefaults in my @main view's sub view. It seems that UserDefaults is accessed too early, before applicationDidFinishLaunching. And therefore, not getting user data on launch sometimes. This issue is very rare, i'm not able to reproduce this, but assuming this can be cause based on some form post, also because view's onAppear calls before applicationDidFinishLaunching.
3
0
264
Sep ’24
[iOS18] Crash in `static NSDecimal./ infix(_:_:)`
Crashed: com.apple.main-thread 0 Foundation 0x2bd25c specialized static NSDecimal._integerDivide(dividend:divisor:maxResultLength:) + 1996 1 Foundation 0x2c1c0c specialized NSDecimal._divide(by:roundingMode:) + 2432 2 Foundation 0x372710 static NSDecimal./ infix(_:_:) + 64 Crashed: com.um.positions.fiber.queue 0 Foundation 0x2bdc94 <redacted> + 1996 1 Foundation 0x2c2644 <redacted> + 2432 2 Foundation 0x372804 $sSo9NSDecimala10FoundationE1doiyA2B_ABtFZ + 64 After iOS18, some new crashes appeared, but they never appeared before iOS18. How to avoid such crashes? I checked the API documentation and there is no relevant modification, https://developer.apple.com/documentation/foundation/1409398-nsdecimaldivide However, I parsed iOS_22A5326g/../Foundation.framework/Foundation, and found that this EXC_BREAKPOINT is newly added You can reproduce it with the following code: let a: Decimal = .greatestFiniteMagnitude let b: Decimal = .greatestFiniteMagnitude let c = a / b // if < iOS18, c = 1. if = iOS18, will crashed ;< print(c)
3
1
567
Sep ’24
Bluetooth connection unexpectedly timing out with macOS Sequoia
After the macOS Sequoia update, my app seems to have an issue with Bluetooth communication between macOS and iOS that uses CoreBluetooth for Central-Peripheral communication. Setup: The iPhone (in my case: iPhone 14 Pro with iOS 18.0 (22A3354)) acts as the Central, and the Mac (in my case: 14" MacBook Pro 2023 with macOS 15.0 (24A335)) as the Peripheral. I’ve implemented a mechanism where the Central (iPhone) sends a message to the Peripheral (Mac) every 15 seconds to keep the connection alive (Because it needs to wait for notify characteristic updates). I never noticed this kind of issue before, but with macOS Sequoia I get it permanently. Issue: The connection drops unexpectedly after a period of time (sometimes 20 seconds, sometimes a few minutes) with CBErrorDomain - code 6: The connection has timed out unexpectedly. Sample Code: Peripheral (Mac): ContentView (Peripheral).txt ContentViewModel (Peripheral).txt Central (iPhone): ContentView (Central).txt ContentViewModel (Central).txt Reproduce: I attached sample code including the Central-Sample (for iPhone) and Peripheral-Sample (for Mac). Just run the Peripheral-Sample (after granting Bluetooth permissions). Then run the Central-Sample and select the Mac device in the list After selecting it should connect, discover the service & characteristic and should start writing messages to it. After some time the func centralManager(_ central: CBCentralManager, didDisconnectPeripheral peripheral: CBPeripheral, error: (any Error)?) {should get called with timed out unexpectedly error. Could anyone please look into this issue and advise on whether there’s a known bug or any workaround? Any guidance would be greatly appreciated, as this impacts the stability of Bluetooth communication between the devices. Thanks in advance. Logs: I also ran the console.app during this issue which got these errors (if this is helpful): console_logs.txt
5
4
1.2k
Sep ’24
system crash on ios and freeze
Feedback ID: FB15148112 Hello, I have submitted a feedback on feedback assistant. I am using iphone 14 pro ios 17.5.1. Since yesterday, I can not enter settings app. and on some screens my phone crashes. While deleting an app, also system crashes. Can you look at the logs at sysdiagnose_2024.09.16_23-52-06+0300_iPhone-OS_iPhone_21F90.tar.gz ? Thank you I want to share my ticket here due to current issue is very crucial for me. Ticket: Which of the following did you encounter on-screen when the system crash occurred? Gray Loading Spinner appeared over black screen What were you doing on the device just before the crash occurred? whatever i do Please describe the issue and what steps we can take to reproduce it: when i open settings, it is not opening and also when i switch between screens it freezes and shutdown with spinner. i am very sad :( i can not use my phone. it began today morning i am software engineer, i try to find log details via xcode but i could not catch it. only localization text missings error exist on logs. but i could not find the solution. please help me thank you
1
0
232
Sep ’24
CallKit: Blocked Calls Appearing as Unanswered in iOS 18
Hello Apple Developer Community, I'm developing a call-blocking app for iOS and have encountered an issue with iOS 18. Despite calls being successfully blocked by our app's Call Directory extension, they are still appearing as unanswered calls in the native Phone app. Details: iOS version: 18 App uses CallKit and Call Directory extension Calls are blocked successfully (not ringing on device) Blocked calls show up as "Unanswered" in Phone app's recent calls list Expected behavior: Blocked calls should not appear in the Phone app's recent calls list. Actual behavior: Blocked calls appear as "Unanswered" in the recent calls list.
11
1
796
Sep ’24
Can't enroll in 15.1 beta in VM after signing into iCloud
I have created an Apple silicon macOS Sequoia VM using UTM on my Mac also running macOS Sequoia. As noted in the documentation, I can now sign-in to iCloud in the VM. I want to update the VM to macOS Sequoia 15.1 beta. (I understand that Apple Intelligence won't be available in the VM. I need to test my software.) However, when I go to Software Update in the System Settings, I am not offered the opportunity to enroll in the beta. (The "Beta Updates" section never appears.) Is this intentional?
0
1
313
Sep ’24
How to make my daemon run only in pre login mode.
Hi, I'd like to be able to run my daemon process only in pre-logon mode that can be reach by either reboot the machine prior to provide user credentials, or by log out from current user. So far I couldn't find any useful configuration in the plist file under /Library/LaunchDaemon. Perhaps there's a way to get notification programmatically for when the system enter/exit pre-login mode ? Thanks
1
0
262
Sep ’24