I have read the other most relevant posts on this topic here and here. However, the situations described in these posts are different. My app is just a regular Mach-O bundle with a single executable that is launched by the user from the Finder. I've read the Local Network Privacy FAQ and TN3179 carefully and these also doesn't cover the problem described below, which is being reported to me by several of my users.
The problem is that some days after giving Local Network permission to my app, without having changed anything, local network connections will spontaneously start failing with EHOSTUNREACH, indicating that it is being blocked by macOS. This typically happens after a Mac reboot. Toggling off/on the Local Network permission for my app will get it working again, until the next time it fails.
My users who are reporting this have stated that they are running macOS Sonoma 15.2, with only a single version/copy of my app installed.
I've tried, and failed, to reproduce this in a VM with a clean 15.2 system, but maybe this is due to the relatively short duration of my testing (days rather than weeks).
I know there isn't much to go on here, and it may be tempting to put this down to misreporting. After all, the vast majority of my users aren't reporting this, and I can't reproduce it. But, I have received enough similar reports at this point that it's starting to feel like a macOS bug.
Is anyone else seeing this? If there is anything that anyone can suggest - either modifications in my app, or anything that my users can do on their side - this would be very much appreciated!
Many thanks,
Ben
Posts under macOS tag
176 Posts
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
I'm trying to implement a 3 column NavigationSplitView in SwiftUI on macOS - very similar to Apple's own NavigationCookbook sample app - with the slight addition of multiple sections in the sidebar similar to how the Apple Music App has multiple sections in the sidebar.
Note: This was easily possible using the deprecated
NavigationLink(tag, selection, destination) API
The most obvious approach is to simply do something like:
NavigationSplitView(sidebar: {
List {
Section("Section1") {
List(section1, selection: $selectedItem1) {
item in
NavigationLink(item.label, value: item)
}
}
Section("Section2") {
List(section2, selection: $selectedItem2) {
item in
NavigationLink(item.label, value: item)
}
}
}
},
content: {
Text("Content View")
}, detail: {
Text("Detail View")
})
But unfortunately, this doesn't work - it doesn't seem to properly iterate over all of the items in each List(data, selection: $selected) or the view is strangely cropped - it only shows 1 item. However if the 1 item is selected, then the appropriate bindable selection value is updated. See image below:
If you instead use ForEach for enumerating the data, that does seem to work, however when you use ForEach, you loose the ability to track the selection offered by the List API, as there is no longer a bindable selection propery in the NavigationLink API.
NavigationSplitView(sidebar: {
List {
Section("Section1") {
ForEach(section1) {
item in
NavigationLink(item.label, value: item)
}
}
Section("Section2") {
ForEach(section2) {
item in
NavigationLink(item.label, value: item)
}
}
}
},
content: {
Text("Content View")
}, detail: {
Text("Detail View")
})
We no longer know when a sidebar selection has occurred.
See image below:
Obviously Apple is not going to comment on the expected lifespan of the now deprecated API - but I am having a hard time switching to the new NavigationLink with a broken sidebar implementation.
I have tried all of the above options, cleaned cached data, restarted several times, did not work.
The tunnel connection failed while the system tried to connect to the device.
Domain: com.apple.dt.RemotePairingError
Code: 4
System Information
macOS Version 15.2 (Build 24C101)
Xcode 16.2 (23507) (Build 16C5032a)
iOs 18.1.1
Hey there! Hope you are starting the year with great joy.
My situation
I'm building a new product that is based on detecting certain text on screen in realtime. The product is only targeted for Mac and it's built with Swift
My problem
I need to get the exact position of a text element with the Apple Accessibility API but I can't figurate it out. I managed to get the AXUIElement where the text is placed but it's position is too broad and off target.
My discoveries so far
I've tried OCR but is too slow for what I'm building, so the only possible way I can think of is with the Accessibility API.
Thank you in advanced.
Here is a relatively simple code fragment:
let attributedQuote: [NSAttributedString.Key: Any] = [ .font: FieldFont!, .foregroundColor: NSColor.red]
let strQuote = NSAttributedString.init(string:"Hello World", attributes:attributedQuote)
strQuote.draw(in: Rect1)
It compiles without an issue, bur when I execute it, I get:
"*** -colorSpaceName not valid for the NSColor <NSColor: 0x6000005adfd0>; need to first convert colorspace."
I have tried everything I can think of. What's going on?
I have the same problem as this question: https://developer.apple.com/forums/thread/757605
"That indicates you’re using a unique App ID prefix. This is a legacy feature that’s not supported on macOS."
Mine is a macOS App distributed in 2021, that now needs an update.
It has always been under Xcode automatically managed signing with a Team. (Still have the project files from 2021: automatic)
Now validating a new version gives me that error :
Invalid Provisioning Profile. The provisioning profile included in the bundle com.*** [***.pkg/Payload/***.app] is invalid. [Invalid 'com.apple.application-identifier' entitlement value.] For more information, visit the macOS Developer Portal. (ID: ***)
And even re-validating the old archive from 2021 gives me this error.
I have looked at my Apple Id's on "Certificates, Identifiers & Profiles", and I can indeed see that this app has an "App ID Prefix" that is not my Team, but something I don't recognise.
I can not make a new App ID Configuration for the bundle id I have been using: "An App ID with Identifier 'com..appname' is not available. Please enter a different string."
Removing the existing App ID Config does not work either: The App ID '.com..' appears to be in use by the App Store, so it can not be removed at this time.
So, I'm a bit stuck. (Help!)
Topic:
App Store Distribution & Marketing
SubTopic:
App Store Connect
Tags:
Bundle ID
Entitlements
macOS
Provisioning Profiles
I've having trouble deleting AppleDouble files residing on my custom filesystem through Finder.
This also affects files that use the AppleDouble naming convention, i.e. their names start with '._', but aren't AppleDoubles themselves.
dtrace output
In vnop_readdir, 'struct dent/dentry' is set up for dotbar files and written to the uio_t buffer.
It's just that my vnop_remove is never called for dotbar files, and I don't understand why not.
Dotbar files are removed successfully, when deleted through command line.
For SMBClients, vnop_readdir is followed by vnop_access, followed by vnop_lookup, followed by vnop_remove of dotbar files.
SMBClient rm dotbar files dtrace output
Implementing vnop_access for my filesystem did not result in the combination of vnop_lookup and vnop_remove being called for dotbar files.
Perusing the kernel sources, I observed the following functions that might be involved, but I have not way of verifying this, as none of the functions of interest are dtrace(1)-able, rmdir_remove_orphaned_appleDouble() in particular.
rmdir_remove_orphaned_appleDouble() -> VNOP_READDIR().
rmdirat_internal() -> rmdir_remove_orphaned_appleDouble()
unlinkat()-> rmdirat_internal()
rmdir()-> rmdirat_internal()
Any pointers on how dotbar files may be removed through Finder would be greatly appreciated.
I have an error when I use Apple Git-154 to clone the repository:
My OS version: Sequoia 15.2
tannguyen@Mys-MacBook-Pro ~ % git -v
git version 2.39.5 (Apple Git-154)
tannguyen@Mys-MacBook-Pro ~ % git clone https://github.com/nestjs/nest.git
Cloning into 'nest'...
remote: Enumerating objects: 187515, done.
remote: Counting objects: 100% (118/118), done.
remote: Compressing objects: 100% (42/42), done.
error: inflate: data stream error (incorrect data check)10 MiB/s
fatal: pack has bad object at offset 212760331: inflate returned -3
fatal: fetch-pack: invalid index-pack output
Attempting to acquire the value of the 'kern.hostname' ctl from a kext by calling sysctlbyname() returns EPERM with no hostname returned.
sysctlbyname() is aliased to kernel_sysctlbyname():
config/Libkern.exports:839:_sysctlbyname:_kernel_sysctlbyname
Looking at the implementation of kernel_sysctlbyname(), EPERM is returned by sysctl_root(). Not sure how to correctly identify the point of failure.
Alternately, calling
sysctlbyname("hw.ncpu")
does return the value set for the ctl.
The kext was compiled with SYSCTL_DEF_ENABLED defined to have the relevant section of sys/sysctl.h enabled.
bsd_hostname() is a private symbol which is inaccessible to my kext.
% sysctl -n kern.hostname
does return the host name, so the ctl must be set.
Is it possible to get the name of a host from the context of my kext?
Thanks.
With the new macOS 15, Apple introduced the new Local Network Privacy feature.
This is causing issues for our customers as - even though they granted the required permission for our software - connections to a server in their local network are being blocked. The situation is not fixed by recent macOS updates.
As far as I know, this issue exists for machines running on Apple Silicon. Systems running macOS versions (e.g. Sonoma) are not affected.
Currently, the workaround is to re-enable the permission under Settings > Privacy & Security > Local Network. The list shows our application with an enabled checkbox. Users now have to de-select the box and then re-select it again for the application to work. They have to do this after each and every reboot of their system, which is slightly annoying (so at the moment we recommend to not upgrade macOS to Sequoia, if possible)
I did some research and saw that other products are also affected by this bug. Is there a solution to this issue or any plans to fix it?
I'm trying to use DDM manager Safari Extensins in macOS Sequoia. I generate json and load it by mdm and ddm , but it doesn't seems to work. The json I loading is the following:
{
"Type": "com.apple.configuration.safari.extensions.settings",
"Payload": {
"ManagedExtensions": {
"*": {
"State": "AlwaysOn",
"PrivateBrowsing": "AlwaysOn",
"AllowedDomains": [],
"DeniedDomains": []
}
}
},
"Identifier": "com.test.safari"
}
This following image is macOS Sequoia Console log. It show the "com.apple.configuration.safari.extensions.settings" had been run successfully, and no errors.
macOS Sequoia response is the following:
{
"StatusItems" : {
"management" : {
"declarations" : {
"activations" : [
{
"active" : true,
"identifier" : "com.example.act",
"valid" : "valid",
"server-token" : "5cc191206d1b1933"
}
],
"configurations" : [
{
"active" : true,
"identifier" : "com.test.safari",
"valid" : "unknown",
"server-token" : "29d3ec5ab48e6367"
}
],
"assets" : [
],
"management" : [
]
}
}
},
"Errors" : [
]
}
you can see macOS Sequoia response , The "valid" value is always "unknown" at ""identifier" : "com.test.safari", but "Errors" is empty, Safari app don't load extensions , the SafariExtensionSettings" ddm don't work, Is there anything wrong with "SafariExtensionSettings" json? or how can I debug it
Topic:
Business & Education
SubTopic:
Device Management
Tags:
macOS
Safari Extensions
Device Management
Hi,
I'm working on an app that will mostly live in the menu bar.
I'm trying to make a menu item that looks similar to the Tailscale app's menu:
Note: I'm inspired by how Tailscale's menu is rendered:
I have made a View that shows my avatar, name, and optionally the company I work for:
import SwiftUI
struct MenuWhoAmI: View {
var username: String
var binding: String?
var body: some View {
HStack {
AsyncImage(url: URL(string: "https://avatars.githubusercontent.com/u/76716")!){ image in
image.resizable().scaledToFit()
} placeholder: {
ProgressView()
}
.clipShape(Circle())
VStack(alignment: .leading) {
Text(username)
if let binding = binding {
Text("\(binding)").foregroundStyle(.secondary)
}
}
}
}
}
#Preview {
VStack(alignment: .leading) {
MenuWhoAmI(username: "grahamc").padding()
Divider()
MenuWhoAmI(username: "grahamc", binding: "DeterminateSystems").padding()
}.padding()
}
I tried using it in my menu bar:
import SwiftUI
@main
struct DeterminateApp: App {
var body: some Scene {
MenuBarExtra("Determinate", image: "MenuIcon") {
MenuWhoAmI(username: "grahamc")
Button("Two") {}
Button("Three") {}
Divider()
Button("Quit") {
NSApplication.shared.terminate(nil)
}.keyboardShortcut("q")
}.menuBarExtraStyle(.menu)
}
}
and it renders differently:
After reading the forums and documentation, I understood the MenuBarExtra only renders certain elements. I then tried to use an NSStatusBar with an AppDelegate:
import AppKit
import SwiftUI
@main
struct DeterminateApp: App {
@NSApplicationDelegateAdaptor private var appDelegate: AppDelegate
var body: some Scene {
Window("Authentication", id: "login") {}
}
}
class AppDelegate: NSObject, NSApplicationDelegate, ObservableObject {
private var statusItem: NSStatusItem!
func applicationDidFinishLaunching(_ notification: Notification) {
statusItem = NSStatusBar.system.statusItem(withLength: NSStatusItem.variableLength)
if let button = statusItem.button {
button.image = NSImage(named: NSImage.Name("MenuIcon"))
}
statusItem.menu = NSHostingMenu(rootView: Group {
Button(action: { print("hi") }) {
MenuWhoAmI(username: "grahamc")
}
})
}
}
and still, the avatar/name doesn't render like I'd expect, missing the circle clipping:
...and I'm a bit mystified.
How can I make this menu render the way I'm trying for?
Thank you!
Like I said in the title, it looks like MetalTools.framework is missing or corrupted. I think I saw that the symbolic link was broken. They look like aliases in the finder, but I can't find the original.
This was a problem with Ventura (using the last compatible Xcode version) and Sequoia 15.2 (Xcode 16.2). I didn't use Xcode before that. Note that none of my apps need Metal API (I don't think). I only noticed it when Xcode gave an error regarding Metal.
Sorry this is so long; I hope the Terminal info will help.
I don't want to reinstall Sequoia and this has been a problem since at least Ventura.
Recommendations?
ls -l /System/Library/PrivateFrameworks/MetalTools.framework/
total 0
lrwxr-xr-x 1 root wheel 27 Dec 7 01:11 MetalTools -> Versions/Current/MetalTools
lrwxr-xr-x 1 root wheel 26 Dec 7 01:11 Resources -> Versions/Current/Resources
drwxr-xr-x 4 root wheel 128 Dec 7 01:11 Versions
ls -la /System/Library/PrivateFrameworks/MetalTools.framework/
total 0
drwxr-xr-x 5 root wheel 160 Dec 7 01:11 .
drwxr-xr-x 1885 root wheel 60320 Dec 7 01:11 ..
lrwxr-xr-x 1 root wheel 27 Dec 7 01:11 MetalTools -> Versions/Current/MetalTools
lrwxr-xr-x 1 root wheel 26 Dec 7 01:11 Resources -> Versions/Current/Resources
drwxr-xr-x 4 root wheel 128 Dec 7 01:11 Versions
codesign -v /System/Library/PrivateFrameworks/MetalTools.framework/MetalTools
/System/Library/PrivateFrameworks/MetalTools.framework/MetalTools: No such file or directory
ls -la /System/Library/PrivateFrameworks/MetalTools.framework/Versions/
total 0
drwxr-xr-x 4 root wheel 128 Dec 7 01:11 .
drwxr-xr-x 5 root wheel 160 Dec 7 01:11 ..
drwxr-xr-x 4 root wheel 128 Dec 7 01:11 A
lrwxr-xr-x 1 root wheel 1 Dec 7 01:11 Current -> A
ls -la /System/Library/PrivateFrameworks/MetalTools.framework/Versions/A/
total 0
drwxr-xr-x 4 root wheel 128 Dec 7 01:11 .
drwxr-xr-x 4 root wheel 128 Dec 7 01:11 ..
drwxr-xr-x 10 root wheel 320 Dec 7 01:11 Resources
drwxr-xr-x 3 root wheel 96 Dec 7 01:11 _CodeSignature
Note - -rwxr-xr-x 1 root wheel MetalTools should be in the above list (according to ChatGPT)
system_profiler SPDisplaysDataType
Intel UHD Graphics 630 and AMD Radeon Pro 5500M (includes:
Metal Support: Metal 3
Playground code => "Metal is supported." Default device: Apple iOS simulator GPU.
Thanks, Ashley
I am developing apps using NWJS framework, which access devices on the local network. I am doing this on Sequoia on Macos (Desktop). I have developed other apps using NWJS before, but on earlier versions of Macos.
My issue is, I am unable to give my app permission to app to access devices on local network on one of the apps.
Some background:
Other apps which I have used which access devices on the local network, on first-time launching, have given a prompt asking me if I want to allow or deny access to local device for the app.
However, on first-time launching (and many others after that), It simply says the device cannot be reached, and I never get a prompt asking me if I want to allow or deny access to local device for my app.
In its barebones proof-of-concept stage of my app, I have an iframe who's src attribute is the IP address of a device known on the network with that address. I have tried the protocol https://192.168.1.99 and http://192.168.1.99 in the src attribute. This protocol works in another app I have built where upon first-time launch, I was able to get a prompt and give it the needed permission.
If I check in System Settings > Privacy and Security > Network, the app doesn't appear where I can toggle a setting. I also am unable to explicitly add my app to the list.
**
This worked for one app, but not another:
In researching this issue, it was recommended that I add the following keys in info.plist:
com.apple.developer.networking.multicast - boolean true
NSLocalNetworkUsageDescription - string description
NSNearbyInteractionUsageDescription - string description
This worked for one of my apps, but not another, which has a nearly identical structure. In fact, other than CFBundleIdentifier, CFBundleDisplayName and CFBundleName, info.plist is identical.
Why did this work one time, and how can I get my app to prompt for permission for local network access?
When my iOS app runs on macOS in "designed for iPad" mode, the system foreground colour RGBA values seem strange.
Looking at [UIColor labelColor], [UIColor secondaryLabelColor] etc. on iOS, I see values like these: (Light Mode)
// R G B A
fg0 = 0 0 0 255
fg1 = 10 10 13 153
fg2 = 10 10 13 76
fg3 = 10 10 13 45
Note in particular that fg0, aka labelColor, is solid black.
When I run it on my Mac, the values I see are:
// R G B A
fg0 = 0 0 0 216
fg1 = 0 0 0 127
fg2 = 0 0 0 66
fg3 = 0 0 0 25
Here, fg0 has alpha = 216.
The result is that it looks like a dark grey, on a white background.
Of course it's reasonable for macOS to have a different colour palette than iOS - but native macOS apps seem to have solid 100% black as their foreground colour.
Do others see this? What should I be doing?
Note that I'm getting colour values using UIColor's getRed: blue: green: alpha: method and then using these colour values for some custom GPU drawing. Previously I was using solid black and white, but at some point I updated it to use UIColor in order to respond to light/dark-mode changes.
I'm trying to use DDM manager Safari Extensins in macOS Sequoia. I generate json and load it by mdm and ddm , but it doesn't seems to work. The json I loading is the following:
{
"Type": "com.apple.configuration.safari.extensions.settings",
"Payload": {
"ManagedExtensions": {
"*": {
"State": "AlwaysOn",
"PrivateBrowsing": "AlwaysOn",
"AllowedDomains": [],
"DeniedDomains": []
}
}
},
"Identifier": "com.test.safari"
}
macOS Sequoia response is the following:
{
"StatusItems" : {
"management" : {
"declarations" : {
"activations" : [
{
"active" : true,
"identifier" : "com.example.act",
"valid" : "valid",
"server-token" : "5cc191206d1b1933"
}
],
"configurations" : [
{
"active" : true,
"identifier" : "com.test.safari",
"valid" : "unknown",
"server-token" : "29d3ec5ab48e6367"
}
],
"assets" : [
],
"management" : [
]
}
}
},
"Errors" : [
]
}
you can see, The "valid" value is always "unknown" at ""identifier" : "com.example.act", but "Errors" is empty, Safari app don't load extensions , the SafariExtensionSettings" ddm don't work, Is there anything wrong with "SafariExtensionSettings" json? or how can I debug this bug .
Topic:
Business & Education
SubTopic:
Device Management
Tags:
macOS
Apple Business Manager
Safari Extensions
Device Management
As can be seen in the screenshot attached, I can not see the options in this window. A prompt window before this also did not show any buttons in the visible space. However, I made a guess and could get to this window by clicking on what I think was "Ok" or something similar.
But on this I could not do any action and had to force quit the app.
In System Settings -> General -> Date & Time, there is an option called "Set time and date automatically".
Is there a way to check whether it is enabled programmatically?
I have downloaded xcode version 14.2 from apple official archive. I ran xcode using these steps:
Right click -> Show Package content
Go to folder Contents -> Macos -> Xcode
Run the xcode terminal app
After this as soon as I try to open a project, xcode crashes. How do i run xcode of lower version as that specific version is required, I don't want to downgrade my macos as it will result in clearing my data or I have to transfer data.
Please help me with this issue.
I am currently running Xcode Version 14.0 beta (14A5228q) creating a Multiplatform app. I wanted to include a LaunchScreen so added a Launch Screen Storyboard to my project. To the the app to see it I went under Target for my app, General, and under App Icons and Launch Screen I set the Launch Screen File to my storyboard.
This works perfectly when I run the app on iOS; however, when I run it on macOS I get an error:Launch Screen.storyboard error build: iOS storyboards do not support target device type "Mac".
I see there's no way to differentiate between macOS and iOS with the file and there's only one target. Does anyone know a way to make the storyboard only launch when running the iOS app (and iPadOS) and not be seen when running macOS?
Thanks