Post not yet marked as solved
I am really stuck. I uploaded my Mac Catalyst app. The binary passes validation beforehand. I submit for review. After being in "waiting for review" for a couple of minutes it is rejected with "invalid binary" and comes back with an email saying
"ITMS-90053: This bundle is invalid - The bundle identifier is already in use by a different software package."
The only app that is using the same bundle is the IOS version where I added the Mac platform.
Post not yet marked as solved
My app uses CGEventTapCreateForPid to monitor keyboard events of a corresponding process. My app has already enabled the Accessibility permission, and AXIsProcessTrustedWithOptions returns true. However, CGEventTapCreateForPid returns null. What could be the problem? Does anyone know? I tested and found that if CGEventTapCreateForPid returns null, I can reset the Accessibility permission using tccutil reset Accessibility myapp_bundleid without restarting my app. But my app can still get the permission through AXIsProcessTrustedWithOptions
Hey, I am trying to use Family Controls in Mac Catalyst. On the iOS app it works fine. On macOs using Mac Catalyst it builds fine but I get following console output.
Failed to get service proxy: Error Domain=NSCocoaErrorDomain Code=4099 "The connection to service named com.apple.FamilyControlsAgent was invalidated: failed at lookup with error 159 - Sandbox restriction." UserInfo={NSDebugDescription=The connection to service named com.apple.FamilyControlsAgent was invalidated: failed at lookup with error 159 - Sandbox restriction.}`
When i try to open the FamilyActivityPicker on the macOs app following error is displayed in the GUI.
The operation could not be completed. (FamilyControls.ActivityPickerRemoteView Error error 2.)
Do I need a familyControls capability for macOs? If yes, I only find it for iOS.
Thanks for hints and help :)
Post not yet marked as solved
Starting with the macOS version 14.x.x and TextKit1, selecting multiple lines of text triggers a text replacement bug: some of the text on one of the selected lines inadvertently replaces a portion of the selected text.
For example, the bug is exhibited when selecting the following lines:
Carnaroli, Maratelli, or Vialone Nano are best
Vialone Nano cooks quickly – watch it! It also absorbs condiments nicely.
Avoid Baldo, Originario, Ribe and Roma
To trigger the bug, select the three line paragraph using either the cursor or shift with arrow keys. Notice that a portion of the selected text was replaced. Command-Z to undo will allow you to repeat the undesired behavior.
In this case, "e Nano cooks quickly - " is replaced by "Baldo, Originario, Ribe."
This does not occur with all strings or selected strings, but in cases where it does occur, it is perfectly reproducible. It does not occur on iOS. Pasteboard contents are irrelevant. After triggering the bug repeatedly, at some point it stops occurring.
Why does this bug occur? How can it be fixed?
Here is some sample code to reproduce the issue.
@end
@implementation TestNoteViewController
- (void)viewDidLoad {
[super viewDidLoad];
[self createTextView];
}
- (void)createTextView {
NSAttributedString *attrString = [[NSAttributedString alloc] initWithString:self.note.text
attributes:nil];
NSTextStorage *textStorage = [NSTextStorage new];
[textStorage appendAttributedString:attrString];
CGRect newTextViewRect = self.view.bounds;
// Create the layout manager
NSLayoutManager *layoutManager = [NSLayoutManager new];
[textStorage addLayoutManager:layoutManager];
// Create a text container
NSTextContainer *container = [[NSTextContainer alloc] initWithSize:CGSizeMake(newTextViewRect.size.width, CGFLOAT_MAX)];
[layoutManager addTextContainer:container];
// Create and place a text view
UITextView *textView = [[UITextView alloc] initWithFrame:newTextViewRect
textContainer:container];
[self.view addSubview:textView];
textView.translatesAutoresizingMaskIntoConstraints = NO;
UILayoutGuide *safeArea = textView.superview.safeAreaLayoutGuide;
[textView.leadingAnchor constraintEqualToAnchor:safeArea.leadingAnchor].active = YES;
[textView.trailingAnchor constraintEqualToAnchor:safeArea.trailingAnchor].active = YES;
[textView.topAnchor constraintEqualToAnchor:safeArea.topAnchor].active = YES;
[textView.bottomAnchor constraintEqualToAnchor:textView.superview.bottomAnchor].active = YES;
}
@end
Post not yet marked as solved
For some reason, I have to build my iOS app project on target My Mac(Designed for iPhone) instead of using Mac Catalyst.
Now I want to access these window buttons, is there any possible way to do that? or print current view/components whatever it is while clicking button?
Post not yet marked as solved
Hello,
We've an iOS application that can be launched on macOS (with the "designed for iPhone" available with Catalyst).
This application request authorization on MPMediaLibrary and play MPMediaItem with an audio player. After accepted, the authorization status is well flagged as .authorized
I can browse all MPMediaItem without issue and display them in my app.
But, when it comes the time to convert the MPMediaItem file's URL in AVAudioFile with:
AVAudioFile(forReading: fileURL)
We got 2 warnings in the console:
ExtAudioFile.cpp:211 about to throw -54: open audio file
AVAEInternal.h:109 [AVAudioFile.mm:135:AVAudioFileImpl: (ExtAudioFileOpenURL((CFURLRef)fileURL, &_extAudioFile)): error -54
We finally get an exception with this error:
Error Domain=com.apple.coreaudio.avfaudio Code=-54 "(null)" UserInfo={failed call=ExtAudioFileOpenURL((CFURLRef)fileURL, &_extAudioFile)}
This working perfectly on iOS and iPadOS, but with Catalyst we always got this error whatever the audio (from iTunes library) we try to play.
Why do we have this permission issue only on macOS ? There is something different to do to get permission on macOS ?
thanks !
Post not yet marked as solved
I recently updated to macOS Sonoma 14.4 and now UIDevice.current.batteryLevel is always 0.
Code to reproduce:
import SwiftUI
struct ContentView: View {
@State
private var monitoringEnabled = UIDevice.current.isBatteryMonitoringEnabled;
@State
private var batteryLevel = UIDevice.current.batteryLevel;
var body: some View {
VStack {
Text("Battery Monitoring Enabled: " + String(monitoringEnabled))
Text("Battery Level: " + String(batteryLevel))
Button("Toggle Monitoring") {
monitoringEnabled = !monitoringEnabled;
UIDevice.current.isBatteryMonitoringEnabled = monitoringEnabled;
batteryLevel = UIDevice.current.batteryLevel;
}
}
.padding()
}
}
Run the above on a macOS 14.4 target, click "Toggle Monitoring", and you'll see battery level is reported as 0:
I also see the following error in my app logs when running on macOS 14.4:
Error retrieving battery status: result=-536870207 percent=0 hasExternalConnected=1 isCharging=0 isFullyCharged=0
This code displays the expected battery level when running on an actual iOS device:
I have an iOS app that uses os_signpost API for instrumentation.
When I profile it from Xcode on real iOS device, it works as expected.
When I profile its macCatalyst variant (using the identical code) on the same Mac where Xcode is running, the os_signpost Instrument does not show anything, not even the Apple provided signposts that are otherwise visible on the iOS.
How do I make it work?
Post not yet marked as solved
I am adding Group Activities integration with a MacCatalyst app. I have added the Group Activities entitlement in Xcode. I also checked the entitlements with :
codesign --display --entitlements :-
I can see the entitlement :
<key>com.apple.developer.group-session</key><true/><key>
The feature work fine on iPadOS but when I run it on MacOS, the GroupActivitySharingController is not loading properly. I get the following error messages:
Cannot run query EXQuery: extension point com.apple.groupactivities platforms: 6 with error: (null)
Failed to lookup extension with query EXQuery: extension point com.apple.groupactivities platforms: 6 on <_GroupActivities_UIKit.PeoplePickerController: 0x600005020980>
Failed to fetch config for hostViewController <_GroupActivities_UIKit.PeoplePickerController: 0x600005020980>
Failed to build remote hostViewController for <_GroupActivities_UIKit.GroupActivitySharingController: 0x1417f1250>
Failed to fetch extensionViewController
Calling -viewDidAppear: directly on a view controller is not supported, and may result in out-of-order callbacks and other inconsistent behavior. Use the -beginAppearanceTransition:animated: and -endAppearanceTransition APIs on UIViewController to manually drive appearance callbacks instead. Make a symbolic breakpoint at UIViewControllerAlertForAppearanceCallbackMisuse to catch this in the debugger. View controller: <_GroupActivities_UIKit.GroupActivitySharingController: 0x1417f1250>
I got a similar error on iPadOS when the entitlement was not added. Now that I have the entitlement, the error appears only on MacOS.
Does MacOS/MacCatalyst use a different entitlements file? What could be cuasing this?
Post not yet marked as solved
Preparing an iPad App for native MacOS experience using Mac Catalyst (and AppKit when needed) and using SwiftUI.
We observe that Horizontal Scroll is tricky using a Mouse! Most users have the habit of click+drag to scroll horizontally. This does not seem to be default behavior on ScrollView.
Strange: Same App when compiled on "Mac (Designed for iPad)" [aka Silicon only] scrolls horizontally with click drag. But not if compiled with Mac Catalyst.
Question: How can we enable general click-drag for horizontal scrolling using SwiftUI on Mac Catalyst? I wouldn't mind using specific AppKit framework if needed.
Thanks in advance.
Post not yet marked as solved
Hi,
I have an imagePickerController where .allowsEditing is set to true after picking an image. I can move/scale it in iPhone/iPad simulators, but running on my Mac the scaling part of it doesn't work and I don't know how I could go about making the scaling work. Any suggestions much appreciated.
Update: I am using a Magic Mouse. No Trackpad or Touchscreeen Mac.
Post not yet marked as solved
I experience an issue with SceneKit that is driving me crazy ;(
I have severe hangs when I disable Metal API Validation (which is default when you don't run from Xcode). So is there any way to force enable Metal API Validation for AppStore binary? (run MTL_DEBUG_LAYER=1 for Testflight or App Store)
Hangs happen on Catalyst but also on iOS if I use lightingEnvironment...
Post not yet marked as solved
We have an iOS app with a web View.
To develop and debug, we inspect the web view using Safari Dev Tools (Developer menu).
This Works: We are able to inspect the web view when the application is run on physical devices as well as on simulated devices (iPhone and iPad).
This Does NOT Work: We are not able to inspect the web view of the same app running, unmodified, on same Mac. Safari’s Developer menu says “No Inspectable Applications” against the Mac.
Requesting guidance or leads on ways to inspect and debug the app under these conditions. Many thanks!
Post not yet marked as solved
In our mac catalyst app we access AppKit api's by using MacOS bundle(plugin).
when using CGDisplayCreateImage(_: CGDirectDisplayID, rect: CGRect) method the plugin crashes.
Implementation:
@objc
func windowMoved(_ notification: NSNotification) {
guard let win = self.window else {
return
}
let displayId = CGMainDisplayID()
let winRect = win.contentView?.convert(qrRect, from: self)
var rect = win.convertToScreen(winRect ?? self.bounds)
if let screenFrame = NSScreen.main?.visibleFrame {
rect.origin.y = screenFrame.height - rect.maxY
rect.origin.y += screenFrame.minY + win.titlebarHeight
}
guard let image = CGDisplayCreateImage(
displayId,
rect: rect) else {
return
}
guard let qrString = image.detectQRCode().first else { return }
// ...
}
Crash report in printed in console:
-[RPDaemonProxy proxyCoreGraphicsWithMethodType:config:machPort:completionHandler:]: unrecognized selector sent to instance 0x600000500960
(
0 CoreFoundation 0x00000001931deccc __exceptionPreprocess + 176
1 libobjc.A.dylib 0x0000000192cc6788 objc_exception_throw + 60
2 CoreFoundation 0x000000019329102c -[NSObject(NSObject) __retain_OA] + 0
3 CoreFoundation 0x0000000193148a80 ___forwarding___ + 976
4 CoreFoundation 0x00000001931485f0 _CF_forwarding_prep_0 + 96
5 ScreenCaptureKit 0x0000000227d9d95c SLSHWCaptureDesktopProxying + 692
6 SkyLight 0x0000000198b370a8 SLSHWCaptureDesktop + 488
7 SkyLight 0x0000000198b3b1ac SLSDisplayCreateImage + 252
8 MacPlugin 0x0000000112e0d374 $s9MacPlugin14MZMacQrScannerC11windowMovedyySo14NSNotificationCF + 1500
9 MacPlugin 0x0000000112e0d714 $s9MacPlugin14MZMacQrScannerC11windowMovedyySo14NSNotificationCFTo + 52
10 CoreFoundation 0x000000019315eb1c __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ + 148
11 CoreFoundation 0x00000001931f2db8 ___CFXRegistrationPost_block_invoke + 88
12 CoreFoundation 0x00000001931f2d00 _CFXRegistrationPost + 440
13 CoreFoundation 0x000000019312d648 _CFXNotificationPost + 768
14 Foundation 0x0000000194249434 -[NSNotificationCenter postNotificationName:object:userInfo:] + 88
15 AppKit 0x00000001969ffbfc -[NSWindow _setFrameCommon:display:fromServer:] + 2056
16 AppKit 0x0000000197475080 -[NSWindow _windowMovedToRect:dueToMoveEvent:] + 184
17 AppKit 0x0000000196ae8630 -[NSWindow _windowMoved:] + 832
18 AppKit 0x0000000196ae82a4 -[NSWindow _internalHandleAppKitDefinedEvent:] + 152
19 AppKit 0x0000000196ae8074 -[NSWindow(NSEventRouting) _reallySendEvent:isDelayedEvent:] + 528
20 AppKit 0x0000000196ae7c90 -[NSWindow(NSEventRouting) sendEvent:] + 284
21 AppKit 0x00000001971adda8 -[NSApplication(NSEventRouting) sendEvent:] + 1800
22 UIKitMacHelper 0x00000001acb964f8 -[NSApplication(UINSApplicationSwizzling) _uinsSwizzledSendEvent:] + 252
23 AppKit 0x0000000196dfb954 -[NSApplication _handleEvent:] + 60
24 AppKit 0x00000001969afd24 -[NSApplication run] + 512
25 AppKit 0x0000000196986fa4 NSApplicationMain + 880
26 AppKit 0x0000000196bd9798 +[NSWindow _savedFrameFromString:] + 0
27 UIKitMacHelper 0x00000001acb82198 UINSApplicationMain + 972
28 UIKitCore 0x00000001c2ea2924 UIApplicationMain + 148
29 MyApp-DEBUG 0x00000001049d2d04 main + 64
30 dyld 0x0000000192d020e0 start + 2360
This is working fine in all previous version but crashing in macOS beta 14.4 and 14.4.1.
I wanted to post this here in the hope that this will draw attention to what I think is a serious change in behavior that could negatively affect Catalyst apps in macOS 14.4.
Prior to macOS 14.4, when the completion handler was invoked from calling dismiss() to dismiss a presented view controller in a Catalyst app, the dismissed controller no longer appeared in the chain. That is to say that if the root view controller presents View Controller A, when View Controller A is dismissed, the root view controller's presentedViewController property is nil when the completion handler for dismiss() is called.
With macOS 14.4, this is no longer the case. If the root view controller presents View Controller A and then View Controller A is dismissed, the presentedViewController property of the root view controller still refers to Controller A when dismiss()'s completion handler is called.
The side effect of this change in behavior means that if you try to present another view controller from the completion handler of the one being dismissed, it will fail to show because the top most view controller in the chain is the controller being dismissed and presenting from it will result in nothing showing up because it is removed from the chain immediately after the completion handler is invoked. Before macOS 14.4, it the top of the chain would have been the controller that presented the controller that was dismissed, which is what you actually want.
This problem does not exist in the betas for iOS 17.4 or iPadOS 17.4. It appears to affect only Catalyst apps running under macOS 1.4.4.
I think this change in behavior has the potential to affect a number existing Catalyst apps and it may not be obvious to the user something is going wrong. It really should be fixed before macOS 14.4 is released to the public.
I've created a feedback with a sample Xcode project that demonstrates the problem (feedback number FB13622757).
Post not yet marked as solved
Running in a Mac (Catalyst) target or Apple Silicon (designed for iPad).
Just accessing the playbackStoreID from the MPMediaItem shows this error in the console:
-[ITMediaItem valueForMPMediaEntityProperty:]: Unhandled MPMediaEntityProperty subscriptionStoreItemAdamID.
The value returned is always “”.
This works as expected on iOS and iPadOS, returning a valid playbackStoreID.
import SwiftUI
import MediaPlayer
@main
struct PSIDDemoApp: App {
var body: some Scene {
WindowGroup {
Text("playbackStoreID demo")
.task {
let authResult = await MPMediaLibrary.requestAuthorization()
if authResult == .authorized {
if let item = MPMediaQuery.songs().items?.first {
let persistentID = item.persistentID
let playbackStoreID = item.playbackStoreID // <--- Here
print("Item \(persistentID), \(playbackStoreID)")
}
}
}
}
}
}
Xcode 15.1, also tested with Xcode 15.3 beta 2.
MacOS Sonoma 14.3.1
FB13607631
Post not yet marked as solved
It appears the app is sandboxed. I need to be able to access the broader file-system and pick a folder/file. Is this possible?
Is it possible to invoke the app with a command-line argument? If so, how is it accessed (in code)?
Post not yet marked as solved
While I'm keen on being on the latest version of macOS, I'm having trouble meeting the requirement that my app can run on a version of macOS that doesn't exist :)
I'm using Xcode 15.2 (15C500b), targeting iOS 17.2.
I've elected to have the App Store choose the minimum version for Catalyst. I've also tried selecting a version.
ITMS-90899: Apple silicon Mac support issue - The app is not compatible with the provided minimum macOS version of 14.2. It can run on macOS 14.4 or later. Please specify an LSMinimumSystemVersion value of 14.4 or later in a new build, or select a compatible version in App Store Connect. For details, visit: ...
Is there something I could be doing wrong to prompt this behaviour?
Post not yet marked as solved
Running a Process executableURL path for a Catalyst target using a macOS type bundle returns the following error as output:
(/Applications/Xcode-15.1.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Debugger/libViewDebuggerSupport_macCatalyst.dylib), but incompatible platform (have \'MacCatalyst\', need \'macOS\'))
Is it possible to set which dylib platform is used by the macOS bundle executable file instead of using the MacCatalyst one?
Post not yet marked as solved
Hello,
I am working on an AUv3 extension project using SwiftUI in Xcode and have encountered a peculiar issue when implementing a simple alert on Mac Catalyst. The code is straightforward; it's merely an alert triggered by a button within a SwiftUI view. Here's the relevant portion of the code:
import SwiftUI
struct SwiftAUv3ExtensionMainView: View {
var parameterTree: ObservableAUParameterGroup
@State var showingAlert = false
var body: some View {
VStack {
ParameterSlider(param: parameterTree.global.gain)
Button(action: {showingAlert = true}, label: {
Text("Button")
})
}
.alert("Alert", isPresented: $showingAlert, actions: {}, message: { Text("Message") })
}
}
The problem arises when this alert is displayed and subsequently closed. Upon closing the alert, the cursor turns into a spinning rainbow and the app freezes for several seconds. Additionally, Xcode's console displays the warning: -[NSWindow makeKeyWindow] called on _NSAlertPanel which returned NO from -[NSWindow canBecomeKeyWindow].
I am looking for insights or solutions to address this issue. Has anyone else experienced similar problems with SwiftUI alerts in AUv3 extension projects, especially when using Mac Catalyst? Any advice or suggestions would be greatly appreciated.
Thank you.