Post

Replies

Boosts

Views

Activity

Reply to How does one access a file inside of a XCTestCase class?
Try using a custom working directory set to $(PROJECT_DIR) in the scheme run options. If your tests don't use the run action's arguments and environment variables then you can still manually set the working directory by editing the scheme using a text editor (close Xcode first). eg project.xcodeproj/xcshareddata/xcschemes/tests.xcscheme <LaunchAction buildConfiguration = "Debug" useCustomWorkingDirectory = "YES" customWorkingDirectory = "$(PROJECT_DIR)"
Nov ’21
Reply to Transparent window in SwiftUI macOS application
Try something like this: struct VisualEffect: NSViewRepresentable {    func makeNSView(context: Self.Context) -> NSView { return NSVisualEffectView() } } .background(VisualEffect) For pure transparent try something like class TransparentWindowView: NSView {   override func viewDidMoveToWindow() {     window?.backgroundColor = .clear     super.viewDidMoveToWindow()   } } struct TransparentWIndow: NSViewRepresentable    func makeNSView(context: Self.Context) -> NSView { return TransparentWindowView() } .background(TransparentWIndow)
Nov ’21
Reply to Transparent window in SwiftUI macOS application
Repost with corrections. Try something like this: struct VisualEffect: NSViewRepresentable {    func makeNSView(context: Self.Context) -> NSView { return NSVisualEffectView() }    func updateNSView(_ nsView: NSView, context: Context) { } } .background(VisualEffect()) For pure transparent try something like class TransparentWindowView: NSView {   override func viewDidMoveToWindow() {     window?.backgroundColor = .clear     super.viewDidMoveToWindow()   } } struct TransparentWindow: NSViewRepresentable {    func makeNSView(context: Self.Context) -> NSView { return TransparentWindowView() }    func updateNSView(_ nsView: NSView, context: Context) { } } .background(TransparentWindow())
Nov ’21
Reply to Apache/Tomcat install on Monterey on M1 MacBookPro, and code signing
Try signing in a different location like ~/Downloads/ then copy back to /usr/local/libexec/apache2/ codesign --verbose --sign "Apple Development: A. Malcolm Warren (FV8Y5HRUQ8)" ~/Downloads/mod_jk.so Then update your apache config to include an authority on LoadModule: LoadModule /usr/local/libexec/apache2/mod_jk.so "Apple Development: A. Malcolm Warren (FV8Y5HRUQ8)" sudo apachectl configtest should then show something like: AH06662: Allowing module loading process to continue for module at /usr/local/libexec/apache2/mod_jk.so because module signature matches authority "Apple Development: A. Malcolm Warren (FV8Y5HRUQ8)" specified in LoadModule directive
Jan ’22
Reply to SMJobBlessUtil.py and python 3 on Apple Silicon
Try something like this (not a python expert so expecting comments): 1c1 < #! /usr/bin/python  --- > #! /usr/bin/python3 96c96 <   except subprocess.CalledProcessError, e: --- >   except subprocess.CalledProcessError as e: 110,111c110,111 <     req = subprocess.check_output(args, stderr=open("/dev/null")) <   except subprocess.CalledProcessError, e: --- >     req = subprocess.check_output(args, stderr=open("/dev/null"), encoding="utf-8") >   except subprocess.CalledProcessError as e: 122c122,123 <     info = plistlib.readPlist(infoPath) --- >     with open(infoPath, 'rb') as fp: >       info = plistlib.load(fp) 143,144c144,145 <     plistDump = subprocess.check_output(args) <   except subprocess.CalledProcessError, e: --- >     plistDump = subprocess.check_output(args, encoding="utf-8") >   except subprocess.CalledProcessError as e: 149a151 >  155c157 <     bytes = [] --- >     data = [] 163,164c165,167 <         bytes.append(int(hexStr, 16)) <     plist = plistlib.readPlistFromString(bytearray(bytes)) --- >         data.append(int(hexStr, 16)) >  >     plist = plistlib.loads(bytes(data)) 223c226 <   if not info.has_key("SMPrivilegedExecutables"): --- >   if "SMPrivilegedExecutables" not in info: 263c266 <     if not info.has_key("CFBundleInfoDictionaryVersion") or info["CFBundleInfoDictionaryVersion"] != "6.0": --- >     if "CFBundleInfoDictionaryVersion" not in info or info["CFBundleInfoDictionaryVersion"] != "6.0": 266c269 <     if not info.has_key("CFBundleIdentifier") or info["CFBundleIdentifier"] != os.path.basename(toolPath): --- >     if "CFBundleIdentifier" not in info or info["CFBundleIdentifier"] != os.path.basename(toolPath): 269c272 <     if not info.has_key("SMAuthorizedClients"): --- >     if "SMAuthorizedClients" not in info: 289c292 <     if not launchd.has_key("Label") or launchd["Label"] != os.path.basename(toolPath): --- >     if "Label" not in launchd or launchd["Label"] != os.path.basename(toolPath): 355c358 <     if not toolInfo.has_key("CFBundleIdentifier"): --- >     if "CFBundleIdentifier" not in toolInfo: 358c361 <     if not isinstance(bundleID, basestring): --- >     if not isinstance(bundleID, str): 365c368 <   needsUpdate = not appInfo.has_key("SMPrivilegedExecutables") --- >   needsUpdate = "SMPrivilegedExecutables" not in appInfo 370,371c373,374 <     appToolDictSorted = sorted(appToolDict.iteritems(), key=operator.itemgetter(0)) <     oldAppToolDictSorted = sorted(oldAppToolDict.iteritems(), key=operator.itemgetter(0)) --- >     appToolDictSorted = sorted(appToolDict.items(), key=operator.itemgetter(0)) >     oldAppToolDictSorted = sorted(oldAppToolDict.items(), key=operator.itemgetter(0)) 376,377c379,381 <     plistlib.writePlist(appInfo, appInfoPlistPath) <     print >> sys.stdout, "%s: updated" % appInfoPlistPath --- >     with open(appInfoPlistPath, 'wb') as fp: >       plistlib.dump(appInfo, fp) >     print ("%s: updated" % appInfoPlistPath, file = sys.stdout) 385c389 <     needsUpdate = not toolInfo.has_key("SMAuthorizedClients") --- >     needsUpdate = "SMAuthorizedClients" not in toolInfo 396c400 <       print >> sys.stdout, "%s: updated" % toolInfoPlistPath --- >       print("%s: updated" % toolInfoPlistPath, file = sys.stdout) 425c429 <   except CheckException, e: --- >   except CheckException as e: 427c431 <       print >> sys.stderr, "%s: %s" % (os.path.basename(sys.argv[0]), e.message) --- >       print("%s: %s" % (os.path.basename(sys.argv[0]), e.message), file = sys.stderr) 432c436 <       print >> sys.stderr, "%s: %s" % (path, e.message) --- >       print("%s: %s" % (path, e.message), file = sys.stderr) 434,436c438,440 <   except UsageException, e: <     print >> sys.stderr, "usage: %s check /path/to/app" % os.path.basename(sys.argv[0]) <     print >> sys.stderr, "    %s setreq /path/to/app /path/to/app/Info.plist /path/to/tool/Info.plist..." % os.path.basename(sys.argv[0]) --- >   except UsageException as e: >     print("usage: %s check /path/to/app" % os.path.basename(sys.argv[0]), file = sys.stderr) >     print("    %s setreq /path/to/app /path/to/app/Info.plist /path/to/tool/Info.plist..." % os.path.basename(sys.argv[0]), file = sys.stderr) SMJobBlessUtil-python3.py
Jan ’22
Reply to Safari on Monterey 12.3 not redrawing windows inside VM
Probably best asked in the Parallels Mac OS X Guest OS Discussion forum where there are already some posts about 12.3 rendering issues. This appears to be another issue with Metal accelerated graphics when using the Parallels video adapter that you probably enabled to avoid the host freezes / crashes when using the Apple video adapter with the Paravirtualized Graphics framework. prlctl set vm --video-adapter-type parallels (rendering issues with Metal accelerated graphics) prlctl set vm --video-adapter-type apple (host freezes / crashes and sometimes full panics during VM boot with the Apple Paravirtualized Graphics framework) Hopefully Apple and Parallels are working on the Apple Paravirtualized Graphics framework issues. Also really hoping we see more improvements at WWDC to the Hypervisor and Virtualization frameworks for macOS on Apple Silicon.
Mar ’22