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

Unable to discover the BLE device which is in range
We have iOS application to connect and monitor the Wiser smart devices. This application supports WiFi access point change as well. When there is change in the WiFi, wiser devices supports for 3mins BLE mode for re-pairing. When BLE devices are newly commissioning, all devices are being able to discover by CoreBluetooth. But when we try to change the WiFi, Previously connected BLE devices are not being discoverable though they are in pairing mode.
2
0
199
3w
General > Login Items > Allow in Background (User visible item names) in Ventura
In the latest beta of Ventura (and perhaps earlier versions) there is a section of the System Settings > General > Login Items pane called "Allow in Background". It appears that helpers (LaunchAgents/LaunchDaemons) that are installed by apps are listed here. As you can see in the screenshot below, I have 3 such items installed on my test system. The per User LaunchAgent for the Google Updater, the WireShark LaunchDaemon for the ChmodBPF script, and the LaunchDaemon for my userspace CoreAudio Driver (labelled "Metric Halo Distribution, Inc."). The WireShark and Google Updater have nice user identifiable names associated with them, whereas my Launch Daemon only has my company name associated with it. I don't see anything in the plists for Wireshark or GoogleUpdater that seem to specify this user-visible string, nor in the bundles the plists point to. How do I go about annotating my LaunchDaemon plist or the helper tool's plist so that the string in this pane helps the user properly identify what this Background item is for so that they don't accidentally turn it off and disable the driver they need to use our audio hardware? Obviously, we will document this, but just as obviously users don't always read the docs, and it would be better if the user just could make the immediate association that this Background item is needed for our CoreAudio driver.
5
2
2.2k
3w
Help with storage on my Mac
I know you guys probably dont care or what to help with this but I got taken down in the support communities because I simply run a beta version (didn’t even discuss it) but here we go **My MacBook Air has multiple accounts and the other users & shared category takes up 100+ gb. When I sign into one of the accounts, that 100+ gb gets moved to System Data. When I look in finder, the user only seems to take up 12 gb, though. I’ve shown hidden items and looked through the library, but it’s not showing anything that’s taking up that much space! **
3
0
56
3w
libiconv crashes on iOS 18, iOS 16 beta and macOS 15 for certain combinations of strings and encodings
When converting a string using libiconv, for certain combinations of strings and encodings, sometimes iconv() crashes Assertion failed: (tmpin - *in <= *inbytes), function _citrus_iconv_std_iconv_convert, file citrus_iconv_std.c, line 1916. This means that libiconv is a debug build since it asserts and also that it doesn't handles certain characters, it should not crash but return some error code. I've reported this problem twice to Apple, nothing happens. FB17715360 and FB17567155 Below is a simple code snippet that illustrates the problem: #include <iconv.h> #import <Foundation/Foundation.h> void TestLibIconv() { NSLog(@"Convert a string from some encoding to some other"); NSLog(@"The in string may have some unknown encoding"); const char *inEnc = "SHIFT_JIS"; // Japanese //const char *inEnc = "CP1252"; // works const char *outEnc = "UTF-8"; NSLog(@"inEnc %s outEnc %s", inEnc, outEnc); iconv_t cd = iconv_open(outEnc, inEnc); if (cd != (iconv_t) -1) { #if 1 // works when this flag isn't set int on = 1; // allow illegal byte sequence iconvctl(cd, ICONV_SET_DISCARD_ILSEQ, &on); #endif const size_t m_kMaxOutChars = 200; char outBuffer[m_kMaxOutChars+1]; memset(outBuffer, 0, sizeof(outBuffer)); char inStr[] = "\"\xe5\""; // crashes - the '\"' character seems to be the problem size_t inbytesleft = strlen(inStr); size_t outbytesleft = m_kMaxOutChars; char *pInBuf = inStr; char *pOutBuf = outBuffer; size_t retVal = iconv(cd, &pInBuf, &inbytesleft, &pOutBuf, &outbytesleft); NSLog(@"iconv() returns %ld", retVal); NSLog(@"outBuffer %s", outBuffer); iconv_close(cd); } }
2
0
140
3w
macOS26: MenuBarExtra item not showing
Hi, In macOS26 beta, our app icon is not showing anymore in the MenuBar. It is also not displayed in the new section "Menu Bar > Allow in the Menu Bar", which seems to be the way to show/hide Menu Bar icons in macOS 26. The icon is correctly displayed and working in macOS 15. Our app is signed and notarized. It also has the "LSUIElement" value set to "true" in the Info.plist file. Is there some new mandatory entitlements to add in order to have our app showing in the "Allow in the Menu Bar" section? Thanks in advance for your help. Regards
19
4
243
3w
Can SMAppService Daemon replace SMJobBless for exclusive HID capture from keyboards?
To gain exclusive access to keyboard HID devices like Amazon Fire Bluetooth remote controls, my app has been installing a privileged helper tool with SMJobBless in the past. The app - which also has Accessibility permissions - then invoked and communicated with that helper tool through XPC. Now I'm looking into replacing that with a daemon installed through the newer SMAppService APIs, but running into a permission problem: If I try to exclusively open a keyboard HID device from the SMAppService-registered XPC service/daemon (which runs as root as seen in Activity Monitor), IOHIDDeviceOpen returns kIOReturnNotPermitted. I've spent many hours now trying to get it to work, but so far didn't find a solution. Could it be that XPC services registered as a daemon through SMAppService do not inherit the TCC permissions from the invoking process (here: Accessibility permissions) - and the exclusive IOHIDDeviceOpen therefore fails?
7
0
156
3w
Memory leak in case of using IOHIDManager
Hello, The following simple code leads to memory leak IOHIDManagerRef hidManager = IOHIDManagerCreate(kCFAllocatorDefault, kIOHIDManagerOptionNone); ... IOHIDManagerSetDeviceMatching(hidManager, matchingCriteria); CFRelease(matchingCriteria); if (IOHIDManagerOpen(hidManager, kIOHIDOptionsTypeNone) != kIOReturnSuccess) { return 1; } ... if (IOHIDManagerClose(hidManager, kIOHIDOptionsTypeNone) != kIOReturnSuccess) { return 1; } CFRelease(hidManager); The following leaks report: STACK OF 2 INSTANCES OF ROOT LEAK: : 17 dyld 0x19b3aeb98 start + 6076 16 a.out 0x1027147e4 main + 200 15 com.apple.framework.IOKit 0x19f6781b8 __ApplyToDevices + 100 14 com.apple.CoreFoundation 0x19b801cfc CFSetApplyFunction + 224 13 com.apple.CoreFoundation 0x19b801dc0 CFBasicHashApply + 148 12 com.apple.CoreFoundation 0x19b801f94 __CFSetApplyFunction_block_invoke + 28 11 com.apple.framework.IOKit 0x19f6784c8 __IOHIDManagerDeviceApplier + 76 10 com.apple.framework.IOKit 0x19f5e18ec IOHIDDeviceOpen + 56 9 com.apple.iokit.IOHIDLib 0x102992cf0 0x102984000 + 60656 8 com.apple.iokit.IOHIDLib 0x10298d8ec 0x102984000 + 39148 7 com.apple.iokit.IOHIDLib 0x10298d3e8 0x102984000 + 37864 6 com.apple.framework.IOKit 0x19f5d5760 IORegistryEntrySearchCFProperty + 420 5 com.apple.framework.IOKit 0x19f5d66b4 IOCFUnserializeBinary + 480 4 com.apple.CoreFoundation 0x19b7d9ef0 __NSArrayM_new + 60 3 com.apple.CoreFoundation 0x19b7c2378 __CFAllocateObject + 20 2 libobjc.A.dylib 0x19b35b7ec class_createInstance + 76 1 libsystem_malloc.dylib 0x19b56ba40 _calloc + 88 0 libsystem_malloc.dylib 0x19b581270 _malloc_zone_calloc_instrumented_or_legacy + 132 _ I have not found any mention in documentation what should be released before/after the call IOHIDManagerClose. Are there any advices? Thank you in advance!
2
0
60
3w
Sleep State Notification Inconsistencies on MacBook Devices When Unplugged
There are inconsistent behaviors in sleep/wake notification callbacks across different MacBook devices and macOS versions when the device is not connected to power, with or without external displays, entering sleep mode by closing the lid, and waking up from sleep by opening the lid. When monitoring the following Objective-C notifications: NSWorkspaceScreensDidSleepNotification NSWorkspaceScreensDidWakeNotification NSWorkspaceWillSleepNotification NSWorkspaceDidWakeNotification Different devices exhibit varying notification trigger patterns: Some devices trigger all four notifications properly Some devices fail to trigger NSWorkspaceScreensDidWakeNotification Some devices fail to trigger NSWorkspaceDidWakeNotification Some devices fail to trigger NSWorkspaceWillSleepNotification These inconsistencies make it challenging to implement reliable sleep/wake detection logic across different MacBook models and macOS versions.
1
0
61
3w
iOS swift BLE updateValue() without PeripheralManagerIsReady
I want to fully control the BLE send timing myself, instead of relying on the iOS system. When I try to send a large data block using BLE (i.e., splitting it and sending multiple times), I follow Apple’s official guide. However, after the first successful updateValue() call in my loop, the second call always fails unless I wait for the peripheralManagerIsReady(toUpdateSubscribers:) callback. This callback timing is managed by the system, so I can’t control exactly when I can send the next packet. If I send data manually by clicking a button, updateValue() always returns true—even if I add a long delay (like sleep(10)) between calls. But in a loop, after the first send, updateValue() returns false until the thread leaves or the callback occurs. I suspect this is a thread or queue issue blocking subsequent sends. I also tried using DispatchQueue.global().async {} in the loop, but the result is the same. Is there any way to fully control when I call updateValue(), without waiting for peripheralManagerIsReady()? Or is this a limitation of iOS BLE? Thank you!
1
0
102
3w
Macos File open, close, copy, paste event notification
working on app like dropbox and making a feature like dropbox offline download, so when a file is added from a system it will download in other system but as a placeholder file once user double click or open that file or after copy pasting to another location on demand need to download the file and after that do the action open or paste so here I need file open event and paste event to be block untill it downloads. how to achieve this uing obj c, c , c++ or swift
3
0
78
3w
Virtualization Resources
Virtualization framework is a high-level API to create macOS and Linux virtual machines. Hypervisor is a low-level API to build virtualization solutions without the need for a kernel extension. If you’re interested in containers on the Mac, check out the Containerization package and its associated container tool. Virtualization: Forums subtopic: App & System Services > Core OS Forums tag: Virtualization Virtualization framework documentation Using iCloud with macOS virtual machines documentation article Use iCloud on a virtual machine support article Running macOS in a virtual machine on Apple silicon sample code Running Linux in a Virtual Machine sample code Running GUI Linux in a virtual machine on a Mac sample code Building macOS apps with Xcode 26 on macOS 26 VM forums thread — This thread describes how the development experience in VMs has improved recently, and one remaining issue that you might bump in to. Hypervisor: Forums subtopic: App & System Services > Core OS Forums tag: Hypervisor Hypervisor framework documentation Share and Enjoy — Quinn “The Eskimo!” @ Developer Technical Support @ Apple let myEmail = "eskimo" + "1" + "@" + "apple.com"
0
0
81
3w
macOS 26 Beta - man page of sw_vers is not accurate
A few minutes back I filed a feedback assistant issue for this (FB18173706), but I am not sure I filed it in the correct category and I can't find a way to edit it either. So posting this message here just to have to assigned in the right category if appropriate. The issue is as follows. On macOS 26 Tahoe Beta, "man sw_vers" has this among other details: Previous versions of sw_vers respected the SYSTEM_VERSION_COMPAT environment variable to provide compatibility fallback versions for scripts which did not support the macOS 11.0+ version transition. This is no longer supported, versions returned by sw_vers will always reflect the real system version. It says that SYSTEM_VERSION_COMPAT is no longer supported. That doesn't look right, because running sw_vers as follows on macOS 26 Beta results in: SYSTEM_VERSION_COMPAT=1 sw_vers ProductName: macOS ProductVersion: 16.0 BuildVersion: 25A5279m i.e. setting the environment variable SYSTEM_VERSION_COMPAT=1 results in sw_vers reporting the version as 16.0. Now try with SYSTEM_VERSION_COMPAT=0, and the result is: SYSTEM_VERSION_COMPAT=0 sw_vers ProductName: macOS ProductVersion: 26.0 BuildVersion: 25A5279m notice the output says 26.0. So it appears that SYSTEM_VERSION_COMPAT is supported even on macOS 26. I think the man page requires an update to match this behaviour.
5
0
130
3w
Core OS Resources
General: DevForums subtopic: App & System Services > Core OS Core OS is a catch-all subtopic for low-level APIs that don’t fall into one of these more specific areas: Processes & Concurrency Resources Files and Storage Resources Networking Resources Network Extension Resources Security Resources Virtualization Resources Share and Enjoy — Quinn “The Eskimo!” @ Developer Technical Support @ Apple let myEmail = "eskimo" + "1" + "@" + "apple.com"
0
0
118
4w
CGColorRef is NOT a struct
The documentation for CGColorRef (https://developer.apple.com/documentation/coregraphics/cgcolorref?language=objc) clearly shows that it is a struct. However, when I try to store a cell's border color using CGColorRef originalColor = self.bg.layer.borderColor and inspect what happens in the debugger, both that property and its copy have the same address. And later when I try to restore the border color the copy still has the same address but is no longer valid and causes a crash on assignment (originalColor is actually an instance variable...) This is all object behavior, not struct behavior. If CGColorRef really was a struct, the contents would have been copied, the instance variable would have had its own address that would never have changed, and the value would have remained valid indefinitely and let me copy it back without a problem. Why is this documented wrong? Was this a recent change? I actually had this code working at some point, and now it's broken.
9
0
1k
4w
Prevent non-admin users to prevent unloading launch agent
We want to keep our Mac UI app running all the time, when a user is logged into to a mac machine (app resides in /Applications). To achieve this, we can use launchctl from within post-isntall script to load a plist file which resides in /Library/LaunchAgent. How to prevent a user (without admin password) to unload the agent using launchctl from terminal?
6
1
808
Aug ’25
Is it possible to use the Matter.xcframework without using the MatterSupport extension for onboarding a device to our ecosystem?
Is it possible to use the Matter.xcframework without the MatterSupport extension for onboarding a Matter device to our own ecosystem(own OTBR and matter controller) for an official App Store release? Currently, we can achieve this in developer mode by adding the Bluetooth Central Matter Client Developer mode profile (as outlined here https://github.com/project-chip/connectedhomeip/blob/master/docs/guides/darwin.md). For an official release, what entitlements or capabilities do we need to request approval from Apple to replace the Bluetooth Central Matter Client Developer mode profile? Thank you for your assistance.
3
3
99
Aug ’25