In Xcode 12.3, printing a log to Xcode's console seems still not working :(
Messages sent with os_log or NSLog will go to system log (which can be viewed in Console.app).
Post
Replies
Boosts
Views
Activity
Same issue with XCode 12.3 (12C33). At last I can "print" with debugger breakpoints.
Same issue on my side in Xcode 12.3 (12C33). Seems a bug. At least po something prints to Xcode console in Debug Preview.
Removing a paired watch from iPhone simulator seems helped. But it is rather workaround :0
I was able to solve issue App containing System Extension to be activated must be in /Applications folder with build settings shown below:
DEPLOYMENT_LOCATION = YES
DSTROOT = /
INSTALL_PATH = $(LOCAL_APPS_DIR)/MyDevelopmentApps
SKIP_INSTALL = NO
Idea behind, that the build product placed into a /Applications/MyDevelopmentApps directory instead into /.../DerivedData/.../Build/Products directory.
This is what we are doing:
class EntryPoint: FIFinderSync {
private var windowController: MainWindowConreoller?
override func menu(for menuKind: FIMenuKind) -> NSMenu {
let menu = NSMenu(title: "")
menu.addItem(withTitle: "Example Menu Item", action: #selector(openMainWindow(_:)), keyEquivalent: "")
return menu
}
@objc private func openMainWindow(_ sender: AnyObject?) {
DispatchQueue.main.asyncAfter(deadline: .now() + 0.3) { // [1] Switch to main thread !!!
NSApplication.shared.activate(ignoringOtherApps: true) // [2] Activate App !!!
let wc = MainWindowConreoller()
wc.showWindow(nil)
self.windowController = wc // [3] Retain window controller !!!
}
}
}
Working App example:
https://objective-see.com/products/whatsyoursign.html
https://github.com/objective-see/WhatsYourSign/blob/master/WhatsYourSignExt/FinderSync/InfoWindowController.m#L40
Thank you Ed,
Issue report is created: FB15300340
FYI: Issue also reproducible when using Xcode 16.1 Beta 2 (16B5014f).
Removing user default key DVTDeviceVisibilityPreferences fixes issue.
defaults delete com.apple.dt.Xcode DVTDeviceVisibilityPreferences
I had a wrong value type under DVTDeviceVisibilityPreferences key. String instead of Integer.
Observed
<key>2DDE32D1-C291-4C3A-A76F-2878C9F57F61</key>
<string>1</string>
Should be
<key>2DDE32D1-C291-4C3A-A76F-2878C9F57F61</key>
<integer>1</integer>