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

Posts under Core OS subtopic

Post

Replies

Boosts

Views

Activity

How to tell if FileProvider Extension is enabled, programatically?
I tried using Pluginkit via terminal to determine if a File Provider Extension is enabled on Mac OS. Although I see the extension listed in the output of pluginkit -m, The status of + or - doesn't seem to change in this output when I disable or enable the FileProvider extension in System Settings. Is there a more reliable way to determine if the extension is enabled ?
1
0
92
May ’25
NFC HCE CardSession.isSupported crash
I am getting report of a crash occurring, while doing a NFC HCE CardSession. The swift code is mostly the same as the example from the CardSession docs: @objc func deviceSupportsNFC (_ call: CAPPluginCall) { call.keepAlive = true let supportsNFCCallbackId = call.callbackId! Task() { guard NFCReaderSession.readingAvailable, CardSession.isSupported, // <-- line 86 await CardSession.isEligible else { print(TAG + " HCE not allowed/available") var support = JSObject() support["supported"] = false; let callback = bridge?.savedCall(withID: supportsNFCCallbackId) call.resolve(); callback?.resolve(support); return; } print(TAG + " HCE allowed") var support = JSObject() support["supported"] = true; let callback = bridge?.savedCall(withID: supportsNFCCallbackId) call.resolve(); callback?.resolve(support); } } Calling it from my plugin, to verify if (HCE) NFC is supported: if(await deviceInfoService.isIos()) { if(iosSupportEnabled === false) { console.log("NfcHceService:iOS but disabled"); return; } this.requiresManualTrigger = true; DfsNfcHce.deviceSupportsNFC((supportObj) => { const support = supportObj?.supported ?? false; this.hceSupported = support; }); } else { this.hceSupported = true; } The crash report i get via Crashlytics is below. It's specifying the error occurs at line 86 (marked it in my code above) The error seems to be in the CoreNFC (NFCHardwareManager areFeaturesSupported). # Crashlytics - Stack trace # Application: com.wodanbrothers.dyflexis # Platform: apple # Version: 2025.04.101356 (1744977392) # Issue: c3a293fbfa73c64f59f92c4b4cdfeb83 # Session: 5c64465c452c41e3abb1ba9f970b54c0_DNE_0_v2 # Date: Wed May 07 2025 07:56:11 GMT+0200 (Central European Summer Time) Fatal Exception: NSInvalidArgumentException 0 CoreFoundation 0x11a2ec __exceptionPreprocess 1 libobjc.A.dylib 0x31a7c objc_exception_throw 2 CoreFoundation 0x18467c +[NSObject(NSObject) _copyDescription] 3 CoreFoundation 0x31b84 ___forwarding___ 4 CoreFoundation 0x314f0 _CF_forwarding_prep_0 5 CoreNFC 0x2ac40 -[NFCHardwareManager areFeaturesSupported:outError:] 6 CoreNFC 0x2b184 -[NFCHardwareManager areFeaturesSupported:expiry:completion:] 7 CoreNFC 0x2f9d8 block_destroy_helper.5 8 Dyflexis 0x5c08 closure #1 in DfsNfcHcePlugin.deviceSupportsNFC(_:) + 86 (DfsNfcHcePlugin.swift:86) 9 Dyflexis 0x7f8d <deduplicated_symbol> 10 Dyflexis 0x7725 specialized thunk for @escaping @isolated(any) @callee_guaranteed @async () -> (@out A) (<compiler-generated>) 11 Dyflexis 0x77fd <deduplicated_symbol> 12 libswift_Concurrency.dylib 0x65241 completeTaskWithClosure(swift::AsyncContext*, swift::SwiftError ... Crashed: com.google.firebase.crashlytics.ios.exception 0 FirebaseCrashlytics 0x1b658 FIRCLSProcessRecordAllThreads + 172 1 FirebaseCrashlytics 0x1ba64 FIRCLSProcessRecordAllThreads + 1208 2 FirebaseCrashlytics 0x13adc FIRCLSHandler + 48 3 FirebaseCrashlytics 0xe9d4 __FIRCLSExceptionRecord_block_invoke + 92 4 libdispatch.dylib 0x1b584 _dispatch_client_callout + 16 5 libdispatch.dylib 0x11728 _dispatch_lane_barrier_sync_invoke_and_complete + 56 6 FirebaseCrashlytics 0xe260 FIRCLSExceptionRecord + 204 7 FirebaseCrashlytics 0xe4f8 FIRCLSExceptionRecordNSException + 452 8 FirebaseCrashlytics 0xdeb8 FIRCLSTerminateHandler() + 396 9 libc++abi.dylib 0x158b4 std::__terminate(void (*)()) + 16 10 libc++abi.dylib 0x18e1c __cxa_get_exception_ptr + 86 11 libc++abi.dylib 0x18dc4 __cxxabiv1::failed_throw(__cxxabiv1::__cxa_exception*) + 90 12 libobjc.A.dylib 0x31be4 objc_exception_throw + 448 13 CoreFoundation 0x18467c +[NSObject(NSObject) _copyDescription] + 362 14 CoreFoundation 0x31b84 ___forwarding___ + 1492 15 CoreFoundation 0x314f0 _CF_forwarding_prep_0 + 96 16 CoreNFC 0x2ac40 -[NFCHardwareManager areFeaturesSupported:outError:] + 364 17 CoreNFC 0x2b184 -[NFCHardwareManager areFeaturesSupported:expiry:completion:] + 96 18 CoreNFC 0x2f9d8 block_destroy_helper.5 + 8028 19 Dyflexis 0x5c08 closure #1 in DfsNfcHcePlugin.deviceSupportsNFC(_:) + 86 (DfsNfcHcePlugin.swift:86) 20 libswift_Concurrency.dylib 0x5c134 swift::runJobInEstablishedExecutorContext(swift::Job*) + 292 21 libswift_Concurrency.dylib 0x5d5c8 swift_job_runImpl(swift::Job*, swift::SerialExecutorRef) + 156 22 libdispatch.dylib 0x13db0 _dispatch_root_queue_drain + 364 23 libdispatch.dylib 0x1454c _dispatch_worker_thread2 + 156 24 libsystem_pthread.dylib 0x4624 _pthread_wqthread + 232 25 libsystem_pthread.dylib 0x19f8 start_wqthread + 8 ...
1
0
67
May ’25
Mac App Store TestFlight not available when using non-Xcode developer tools
@Quinn, The application which is not made with Xcode, has a provision profile, but App Store Connect says "Not Available for Testing". My Googlefu appears weak as I can't seem to figure out why this is, except that it mentions you need to be using Xcode 13 or newer. Am guessing Xcode is adding some meta data to the Info.plist file which TestFlight requires. Is it possible to know which keys and values are required to satisfy TestFlight? If it's not plist keys, is there something else that's needed, that can be shared? We can do this privately if desired.
2
0
1.3k
May ’25
Terminal Command to get the same file count as Get Info in finder
Hi All, I am looking for a terminal command to get the exact same output as the file count you recieve when using Get Info in finder. The closest i can get is using the find command with flags: find 'path/to/folder' -not -path '*/\.*' -and -not -path '*\.key/*' -and -not -path '*\.numbers/*' -and -not -path '*\.pages/*' -and -not -path '*__MACOSX/*' -and -not -path '*\.pdf/*' -and -not -path '*\.app/*' -and -not -path '*\.rtfd/*' | wc -l I will be searching on an external volume that sometimes produces keynote save files that finder sometimes sees as a package and sometimes sees as a folder. If a folder finder counts the items contained if a package it doesn't, I need the command or script to mimic this behaviour. In the example of the screenshot get info on the top folder produces a count of 14 and the find command produces a count of 23. There are also other behaviours that differ the file count between them but i'm not sure what causes them. Any help on a solution it being a command or script would be much apreciated. Thanks, James
1
0
91
May ’25
Matter request extension no long working for Thread devices
My app has been working fine until just recently, now it can not add Matter devices over Thread (Wifi commissioning still works). I didn't change anything on my side, so not sure if an update maybe changed things? In any case, reading through my logs (and i have the matter/thread debug profiles installed). it seems like the device is added to the thread network fine, and it looks to me like the phone is successfully commissioning the device to the Apple setup fabric, but then it seems to choke on this line and i don't think the device is actually added to the keychain/matter db, so it fails later on . error 12:18:03.369036-0700 homed [2610726604/1195614123(679130348)] failed to find metric hmmtrAccessoryMetricNameCommissioningAccessory to complete I can confirm the device does join my thread border router as its pingable, and it does not seem to be in setup mode anymore (light stops flashing), so i assume it thinks its commissioned. The device i'm pairing is a Onvis (matter certified) outlet to an espressif build of a OTBR. My phone is running 18.4.1 if that matters (no pun intended) . I have also cleared out existing Matter pairings from the phone, as well ensured the device was factory reset before every try. Here is a snippet of the log towards the end where is looks like pairing works, but then errors out. I would post more but my post has a 7k character limit. default 12:18:02.836555-0700 homed Success status report received. Session was established default 12:18:02.836734-0700 homed SecureSession[0x9bb100f00, LSID:64711]: State change 'kEstablishing' --> 'kActive' default 12:18:02.837438-0700 homed Successfully finished commissioning step 'kFindOperationalForStayActive' default 12:18:02.837467-0700 homed Commissioning stage next step: 'kFindOperationalForStayActive' -> 'ICDSendStayActive' default 12:18:02.837500-0700 homed Performing next commissioning step 'ICDSendStayActive' default 12:18:02.837574-0700 homed Skipping kICDSendStayActive default 12:18:02.837627-0700 homed Successfully finished commissioning step 'ICDSendStayActive' default 12:18:02.837650-0700 homed Commissioning stage next step: 'ICDSendStayActive' -> 'kFindOperationalForCommissioningComplete' default 12:18:02.837670-0700 homed Performing next commissioning step 'kFindOperationalForCommissioningComplete' default 12:18:02.838036-0700 homed Found an existing secure session to [2:000000009B9C86CC]! default 12:18:02.838149-0700 homed Successfully finished commissioning step 'kFindOperationalForCommissioningComplete' default 12:18:02.838697-0700 homed Commissioning stage next step: 'kFindOperationalForCommissioningComplete' -> 'SendComplete' default 12:18:02.838893-0700 homed Performing next commissioning step 'SendComplete' default 12:18:02.839092-0700 homed <<< [E:35494i S:64711 M:193726318] (S) Msg TX from 0000000086BCA241 to 2:000000009B9C86CC [47A0] [UDP:[fd01:11b8:de1c:1:968a:c465:6fe8:e12a]:5540] --- Type 0001:08 (IM:InvokeCommandRequest) (B:59) default 12:18:02.839133-0700 homed ??1 [E:35494i S:64711 M:193726318] (S) Msg Retransmission to 2:000000009B9C86CC scheduled for 2910ms from now [State:Active II:800 AI:800 AT:4000] default 12:18:02.839257-0700 homed <<< [E:35493i S:0 M:19014618 (Ack:7538941)] (U) Msg TX from 3251BD376C43B658 to 0:0000000000000000 [0000] [UDP:[fd01:11b8:de1c:1:968a:c465:6fe8:e12a]:5540] --- Type 0000:10 (SecureChannel:StandaloneAck) (B:26) default 12:18:03.356373-0700 homed >>> [E:35494i S:64711 M:174417481 (Ack:193726318)] (S) Msg RX from 2:000000009B9C86CC [47A0] to 0000000086BCA241 --- Type 0001:09 (IM:InvokeCommandResponse) (B:70) default 12:18:03.356559-0700 homed Received Command Response Data, Endpoint=0 Cluster=0x0000_0030 Command=0x0000_0005 default 12:18:03.356584-0700 homed Received CommissioningComplete response, errorCode=0 default 12:18:03.356622-0700 homed Successfully finished commissioning step 'SendComplete' default 12:18:03.356648-0700 homed Commissioning stage next step: 'SendComplete' -> 'Cleanup' default 12:18:03.356746-0700 homed Performing next commissioning step 'Cleanup' default 12:18:03.356803-0700 homed Successfully finished commissioning step 'Cleanup' default 12:18:03.356916-0700 homed Closing all BLE connections default 12:18:03.357084-0700 homed Auto-closing end point's BLE connection. default 12:18:03.358146-0700 homed SecureSession[0x9bb1003c0, LSID:64710]: State change 'kActive' --> 'kPendingEviction' default 12:18:03.358652-0700 homed Commissioning complete for node ID 0x000000009B9C86CC: success default 12:18:03.358678-0700 homed <MTRDeviceController_Concrete: 0x9b8e33100, uuid: 3F6C2281-D873-4D82-BE3E-722446EA66E7, suspended: NO> DeviceControllerDelegate Commissioning complete. NodeId 0x000000009b9c86cc Status src/controller/CHIPDeviceController.cpp:2932: Success ... default 12:18:03.367999-0700 homed <MTRDeviceController_Concrete: 0x9b8e33100, uuid: 3F6C2281-D873-4D82-BE3E-722446EA66E7, suspended: NO> 1 delegates called for -[MTRDeviceController controller:commissioningComplete:nodeID:metrics:] error 12:18:03.369036-0700 homed [2610726604/1195614123(679130348)] failed to find metric hmmtrAccessoryMetricNameCommissioningAccessory to complete error 12:18:03.426636-0700 HomeUIService Unexpected accessory setup progress CASE Session Sanity Check Passed default 12:18:03.426850-0700 homed Could not find home with valid fabric ID corresponding to fabric UUID: FB19AA02-5E34-40C5-BB9D-B1B1AF51E08B ... error 12:18:03.460841-0700 homed [188914BD-5163-425C-9E59-CAE9BFA1A288] Could not find system commissioner pairing for newly staged server with identifier f1:64:16:3f:79:b8 in all pairings: ( .. default 12:18:03.460906-0700 homed Answering incoming message HMASC.m.confirmDeviceCredential (186EE57F-330B-435F-A949-0E4C5D6954AB) from client 'HomeUIService' that expects a response with error Error Domain=HMErrorDomain Code=2 "(null)" error 12:18:03.461167-0700 HomeUIService [BD890E19] Failed to stage CHIP accessory pairing in steps: Error Domain=HMErrorDomain Code=2 "(null)" error 12:18:03.462121-0700 HomeUIService -[HSSetupStateMachineCHIPPartnerConfiguration stageCHIPAccessory]_block_invoke Failed to stage CHIP accessory: Error Domain=HMErrorDomain Code=2 "(null)" default 12:18:03.462172-0700 HomeUIService -[HSSetupStateMachineConfiguration setPairingError:] *** Setting pairingError *** = Error Domain=HMErrorDomain Code=2 "(null)"
3
0
124
May ’25
Manufacturer data is duplicated in extended adverts
While implementing the extended adverts scanning, I noticed that фfter some time from the start of scanning(CBCentralManagerScanOptionAllowDuplicatesKey is true), the manufacturer data is duplicated. The first part is the actual data, and the second part is the same bytes that the device sent about 10 seconds before. This replicates on iPhone 11 - 14 but does not work on 16 Pro. I also saw the same behavior in third party BLE scanning applications. We also tried increasing the interval between sending adverts by the device and got the same result Does anyone know what the problem could be?
1
0
94
May ’25
get space which is used on an APFS volume
Hello, I am trying to get space which is consumed by APFS volume. The call getattrlist() works fine on macOS 15 (Apple silicon). However, it returns EINVAL on macOS 11.7.10 (Intel) if ATTR_VOL_SPACEUSED is defined. struct VolAttrBuf { u_int32_t length; off_t spaceUsed; } __attribute__((aligned(4), packed)); int64_t GetVolumeSpaceUsed(const std::string& mountPath) { struct attrlist attrList; std::memset(&attrList, 0, sizeof(attrList)); attrList.bitmapcount = ATTR_BIT_MAP_COUNT; attrList.volattr = ATTR_VOL_INFO | ATTR_VOL_SPACEUSED; VolAttrBuf attrBuf; if (getattrlist(mountPath.c_str(), &attrList, &attrBuf, sizeof(attrBuf), 0) || attrBuf.length > sizeof(attrBuf)) { std::cout << "getattrlist() failed with errno (" << errno << ")" << std::endl; return -1; } return attrBuf.spaceUsed; } Is it bug or ATTR_VOL_SPACEUSED is unsupported on macOS 11? Are there any other way to get space which is used on an APFS volume? (C++) Thank you in advance, Pavel
2
0
62
May ’25
CoreHID: Enumerate all devices *once* (e.g. in a command-line tool)
I am aware the USB / HID devices can come and go, if you have a long running application that's what you want to monitor. But for a "one-shot" command-line tool for example, I would like to enumerate the devices present on a system at a certain point in time, interact with a subset of them (and this interaction can fail since the device may have been disconnected in-between enumerating and me creating the HIDDeviceClient), and then exit the application. It seems that HIDDeviceManager only allows monitoring an Async[Throwing]Stream which provides the initial devices matching the query but then continues to deliver updates, and I have no idea when this initial list is done. I could sleep for a while and then cancel the stream and see what was received up to then, but that seems like the wrong way to go about this, if I just want to know "which devices are connected", so I can maybe list them in a "usage" or help screen. Am I missing something?
7
0
151
May ’25
Xcode project that runs only once under xcode
I have an xcode project that runs fine under xcode the first time, but if I try to run it a second time it fails in trying to open a directory (as part if the observable view data in the view's environment). It throws an error saying "Interupted system call". I have no idea how to debug something like this, so any help would be welcomed. Thanks in advance, Rick
8
0
91
May ’25
Why is HMAC_SHA_512 unsupported on eSIM Java Card 3.0.5 in iPhone?
We are currently working on deploying a Java Card applet onto the eSIM (eUICC) inside an iPhone. According to the GSMA SGP specifications, the eUICC is expected to support Java Card 3.0.5 Classic Edition. As defined in the Java Card 3.0.5 specification, the javacardx.crypto package should support standard algorithms including MessageDigest.ALG_HMAC_SHA_512. However, during our testing on the iPhone's embedded eSIM, we found that ALG_HMAC_SHA_512 appears to be unsupported or disabled. The same applet functions correctly on external Java Card platforms that support Java Card 3.0.5, leading us to believe that this is a restriction specific to the iPhone’s eUICC implementation. Our main questions are: Why is ALG_HMAC_SHA_512, which is part of the standard Java Card 3.0.5 specification, not available on the iPhone eSIM? Has Apple imposed any internal restrictions or exclusions on certain crypto algorithms for security, performance, or compliance reasons? Is there a list or documentation of supported and unsupported Java Card APIs or algorithms on the eUICC used in iPhones? Any insights from Apple engineers or other developers with experience on this topic would be greatly appreciated. Thank you in advance!
1
0
61
May ’25
SwiftUI FileManager MacOS moving a file
Until a few days ago, I had a bit of code that could download a file from elsewhere to my home drive, "Users/eric". Today, the code downloads the file to "locat", but the following no longer works let _ = try fileManager.copyItem(atPath: locat, toPath: "/Users/eric/file.txt" ) After a careful search, I've changed the network to allow Network connections, and set User Selected and Downloads Folder to Read/Write without any luck. I am using Catalina and SwiftUI on a recent Mac (2023). As well, it was working just a few days ago. Any ideas or pointers?
1
0
75
May ’25
A proper design approach for implementing a data logger using BLE in an iOS app.
Thank you for always reading my questions. This time, I'd like to ask some specific questions to gain a deeper understanding of iOS CoreBluetooth. In the previous question, we learned that although iOS can perform BLE scanning in the background, it is not suitable for use as a data logger. I was also taught that when using it as a data logger, the iOS app should use GATT communication, and that instead of reading data from the device one by one, it is recommended to store large amounts of data on the device and connect at an appropriate time (such as when the iOS app enters the foreground) to retrieve the data all at once. My requirements are the same as last time. I want to send data from a device equipped with some kind of sensor via BLE and display it in a graph in the iOS app. Data should be acquired every few to tens of seconds and reflected immediately in the graph. Measurements may take up to 24 hours at most. I would like to avoid making any major changes to the device. Also, it is unclear whether there will be enough memory for the data logger for 24 hours. Therefore, I am first looking for an appropriate communication method for the iOS app. iOS is smart and convenient, so I think users will check the measurement status every time they use this iOS app.Therefore, I want to be able to check the changes from the start of measurement to the present in a graph as soon as the app is launched. I would like to measure data from multiple devices (e.g. 5 devices) at the same time. I have a question based on the above requirements. When thinking about the best way to avoid making changes to the device, the only way I could come up with, as someone with insufficient iOS technology, is to keep the connection open via GATT communication and continue to obtain data. However, does iOS GATT communication have any limitations in this regard? Will the OS automatically disconnect GATT communication at a certain time? Also, if that happens, is there a way to automatically reconnect and obtain the data? Is it possible to smoothly obtain data using iOS GATT communication without any particular restrictions even in the background? Are any other permissions required? Regarding the sixth requirement. Until last time, with BLE scanning, even if there were multiple devices, the iOS app could measure the data for as many devices as it wanted, but this time, how many devices can be read? In the case of GATT communication with iOS CoreBluetooth, can multiple devices maintain a long connection? Or is it basically better to have one device per connection when creating such an app for iOS? I would like to know if there are any restrictions or points to be careful of when using GATT communication with multiple devices. I'm sorry for broadening my question, but if neither question 1 nor question 2 works, it will put a burden on the design of the device. If data is stored on the device, is it possible to automatically and periodically connect to the device at a set time interval (for example, once an hour, allowing for some margin of error) when the iOS app is in the background, and obtain log data from the device? If you can think of any other best methods, please feel free to let me know. Also, I'd be happy if you could reply with any reference materials or URLs. Please note that our response may be delayed.
0
0
104
May ’25
How to send events from Bluetooth device to server when app is in background
Hi. I have a device that is connected to my phone and sends few bytes at different times. The app caches those events and sends them to server as soon as internet is available. This all works, but when app goes to background or user locks the phone then after few seconds app has no internet access. It still caches the events that are important but unable to send them until app is brought to foreground. How can app still connect to server? I saw few posts saying they solved it by using URLSession with a background mode, but in my case it says: Terminating app due to uncaught exception 'NSGenericException', reason: 'Upload tasks from NSData are not supported in background sessions.' As I understood URLSession can download or upload files, but the events comming from BLE device are few bytes, so how to send them to server as soon as possible? Found this stackoverflow question and gave me some hopes https://stackoverflow.com/questions/63016680/sending-network-request-after-bluetooth-update-while-ios-app-is-in-background but no examples at all.
1
0
54
May ’25
Getting access to SharedSupport sub-folder of bundle
So if my executable is in the MacOS directory, am I correct in thinking the such things as a related command line application, the help files and other stuff should go into "Shared Support"? If yes, how can my C++ application find and use "stuff" in that SharedSupport sub-directory of the bundle (e.g. open a file or display the help files)? Thanks David
3
0
44
Apr ’25
Request for improved graphics support on MacOS guests (VMs)..
Hi, been exploring macOS VM on both Parallels and UTM and they lack some "GPU/graphics" things vs native MacOS which could be useful on some situations (testing some non trusted graphics apps on a Mac VM) so providing similar usefulness as Windows Sandbox.. Current limitations: 1)In MacOS VM night mode doesn't work.. 2)HDR support isn't exposed even when enabling HDR on host 3)missing GPTK support for the Paravirtual GPU (Paravitual GPU supports Metal but isn't enough for GPTK to work which complains about unsupported GPU).. 4)OpenCL is supported but only the CPU device.. so expose GPU device in addition to current CPU only device.. 5)OpenGL only supports the software renderer.. I assume OpenGL driver on Apple M1-4 GPUs being Metal based, and being Metal supported no reason for software renderer only thanks..
2
0
524
Apr ’25
2 Requests for Rosetta: support BMI1/2 and F16C and support also AVX1/2 on Rosetta Linux..
Hi, REQUEST 1: seems Microsoft is ahead of Apple in X86 ARM emulation support at least in features supported.. see: https://blogs.windows.com/windows-insider/2024/11/06/announcing-windows-11-insider-preview-build-27744-canary-channel/ x64 emulated applications through Prism will now have support for additional extensions to the x86 instruction set architecture. These extensions include AVX and AVX2, as well as BMI, FMA, F16C BMI1/2 and F16C aren't yet supported by Rosetta.. would be useful for games like Alan Wake 2.. so asking for Rosetta equaling features to Prism emulator.. REQUEST 2: there is no way to currently enable AVX1/2 on Rosetta Linux.. on macOS using export ROSETTA_ADVERTISE_AVX=1 does the trick.. but not on Linux VM's.. tested setting this via: /bin/launchctl setenv ROSETTA_ADVERTISE_AVX 1 on Mac before VM launch and inside Linux VM but AVX2 isn't exposed..
3
1
1.7k
Apr ’25