I created a macOS app that can run in foreground (NSApplicationActivationPolicyRegular) and in background (NSApplicationActivationPolicyAccessory) and can be launched by an Helper (Login Item) and run in background. I use XCode 15.3 (15E204a) on macOS 14.2.1 on a MacBook Pro 16, 2019, 2,3 GHz Intel Core i9 8 core. I archive my app, I notarize it for direct distribution then I save it to the /Applications folder. Then I delete my Debug app from …/Xcode/DerivedData/MyApp-dal…xu/Build/Products/Debug so I am sure I have one only copy of my app on the disk. I firstly launch my app as NSApplicationActivationPolicyRegular then I select my menu item Set the app as Login Item. So I call SMAppService *service = [SMAppService loginItemServiceWithIdentifier:@com.mydomain.Helper]; I get a service.status == SMAppServiceStatusNotFound So I am stuck. I notice that my app doesn't show up in the System Preferences/Login Items/ Allow Background list. So on Terminal I run the command sudo sfltool resetbtm Now the Allow
missing package product
42,964 results found
Post
Replies
Boosts
Views
Activity
I was able to do this by adding a module.modulemap file to the Headers. This is all within my library Package project: // swift-tools-version: 6.0 import PackageDescription /** This package wraps FTDI’s D2XX library for macOS. In order to simp xcodebuild -create-xcframework -library /Users/rmann/Downloads/lib3mf_sdk_v2.3.1/Bin/lib3mf.dylib -headers /Users/rmann/Downloads/lib3mf_sdk_v2.3.1/Bindings/C -output lib3mf.xcframework */ let package = Package( name: SwiftD2XX, platforms: [.macOS(.v13)], products: [ .library( name: SwiftD2XX, targets: [SwiftD2XX] ), ], dependencies: [ .package(url: https://github.com/apple/swift-testing.git, branch: main), ], targets: [ .target( name: SwiftD2XX, dependencies: [ ftd2xx ] ), .binaryTarget( name: ftd2xx, path: ../ftd2xx.xcframework ), .testTarget( name: SwiftD2XXTests, dependencies: [ SwiftD2XX, .product(name: Testing, package: swift-testing), ] ), ] ) When I build my xcframework, I use this: xcodebui
These are the Developer Forums, where developers of apps for Apple's platforms ask each other for hints and tips on coding. These forums are NOT where Apple's actual developers chat about stuff. Your post is more of a product support one, so I'd suggest you post it over at the Apple Support Forums. Thanks.
For those who have just stumbled upon this thread, my situation is that I am trying to run the code above in the first post to verify that the colors that I get from an asset catalog are being correctly converted into SwiftUI Color instances so that frequently used custom colors can be more easily managed. This conversion is done automatically using a Swift package plugin that generates the accessors automatically based on the asset catalogs. The persistent issue that I've been having for a longer period of time as I am writing this is that neither XCTest nor Swift Testing find the two instances equal because one is instantiated using the initializer that takes three Double instances (one red, one green, and one blue) and the other is instantiated using the initializer that specifies the color as it appears in an asset catalog. These tests have been consistently failing as a result and are marked as being known issues. My updated version of this project uses Swift Testing for these tests, though the
Hello! I am working on a project that does some automatic code generation using SwiftSyntax and SwiftSyntaxBuilder. As part of this project, I want to put in a comment at the top of the file warning users to not modify the file and make it obvious that the code was automatically generated. I was trying to use the .lineComment(String) static member of the Trivia (or TriviaPiece) types and I expected that the comment would automatically be prefixed with the expected // and space for use in code. (For example, Trivia.lineComment(No comment) would be written as // No Comment when sent through a BasicFormat Object or similar SyntaxRewriter). I was surprised to find that this is not the case and was wondering before I write an issue on GitHub whether this behavior is intentional or a bug. If it is intentional, I'm not entirely sure if I'm missing something regarding this to more easily generate these comments. At the moment my comment generation consists of constructing the comment in the leadingTrivia of
Another option is to use the sftp CLI command via the foundation Process object. I like this option and am considering experimenting with this, but it seems like a hack. How much of a hack this turns into really depends on how you end up needing to interact with the tool If you can structure your interactions with the tool such that you're simply sending the command and getting a result, then it can actually work reasonably well. Indeed, there are a number of command line tools that effectively operate as API and have even been designed to facilitate that functionality (notably, hdiutil and disk image mounting). ssh is another example of this- many applications intentionally use the ssh command line tool instead of integrating with a library because using the command line allows them to rely more on the users existing security configuration instead of having to duplicate that functionality. However, if you'll end up need to drive the tool interactively, that can be pretty painful. Similarly, things like progr
I compared the console log from a phone with this problem and another one that works: good case: (iOS 17.4) Connection 0: creating secure tcp or quic connection Connection 4: enabling TLS bad case: (iOS 16.0.2) Connection 1: enabling TLS I.e. the bad case is missing the log line creating secure tcp or quic connection. Any ideas how this could happen?
Is there an easy way to programmatically use SFTP in my SwiftUI macOS app? In my macOS app I need to do things like: upload local files to a remote server create a directory on a remote server download files from a remote server delete files on a remote server I have been researching this subject for awhile and people are recommending things like SwiftNIO and libssh. But those seem pretty low level and kind of a headache to use. Another option is to use the sftp CLI command via the foundation Process object. I like this option and am considering experimenting with this, but it seems like a hack. Will this work on all macOS computers? Is there an easy way to import and use a C/C++ SFTP library in my SwiftUI macOS app? At this point in my research of this subject I feel like I have to go deep down some rabbit hole in order to pull of some SFTP functionality. But I'm wondering, is there some easy way to do this that I'm missing?
I have the same trouble. Sometimes I get SMAppServiceStatusNotFound status. I noticed that my macOS app is not in the System Preferences/Login Items/Allow Background apps list. So I did run a terminal command sudo sfltool resetbtm I rebooted, and my app was in that list. I had to turn back off all the apps in the Allow Background list, which turned on since the Terminal command. You would agree with me, this is not the way to distribute the app to the customers. I can't ask my customers to run the Terminal command, reboot then turn off all the unwanted apps from the Allow Background list. I guess I miss something. Any idea? How to get my app in that list just after I copied the app within the /Applications folder?
Thank you for your response. I tried the suggested solution, and although it resolved the issue of the view being popped automatically, a different problem has now arisen. (The new issue: Tapping Back from a lower-level View returns to the Root View / No transition animation ) However, while this fix may work for the simplest code, I think it cannot be applied to our production code for the following three reasons: This fix requires placing navigationDestination directly under NavigationStack. In our production code, we have multiple levels such as two, three, or more, each handling different data models within a large navigation view. It's not practical to describe all levels of navigationDestination directly under NavigationStack. This fix introduces another problem, making it unsuitable for inclusion in our production code at this time. I am unsure whether this behavior is due to a specification change in iOS 18 or a bug in the iOS 18 beta, and whether this solution is just a tem
Yes, I have the same issue, Package resolution errors must be fixed before building
Thanks. The part I was missing is the one the documentation for NSTextContentManager doesn't mention, which is that it is an abstract class whose (apparently) only concrete subclass is NSTextContentStorage, which has a textStorage property. guard let textStorage: NSTextStorage = (textLayoutManager?.textContentManager as? NSTextContentStorage)?.textStorage else { return } The sample code also changes the textStorage inside the block passed to textContentManager.performEditingTransaction(_:), which the documentation doesn't seem to explain why it's necessary.
This change is terrible and, as messages show, discriminatory. My hearing is starting to go, which I didn't expect in my 40s, and I work in healthcare and am on call overnights often. I keep missing texts since there's no way to make the phone extra loud and some of my go-to ringtones that were at least a bit longer seem to be gone. Please consider an option to make it louder- even if it's under accessibility.
Hello, I want to add virtual serial ports to a macOS VM (host = Sonoma, guest = Sonoma). Here is what I tried so far: option 1 I create a VZVirtioConsoleDeviceConfiguration and I add a port to it, with a VZFileHandleSerialPortAttachment connected to two pipes: let consoleDeviceConfiguration = VZVirtioConsoleDeviceConfiguration() let guestPort = VZVirtioConsolePortConfiguration() guestPort.isConsole = false guestPort.name = myserialport let guestToHostPipe = Pipe() let hostToGuestPipe = Pipe() guestPort.attachment = VZFileHandleSerialPortAttachment( fileHandleForReading: hostToGuestPipe.fileHandleForReading, fileHandleForWriting: guestToHostPipe.fileHandleForWriting ) consoleDeviceConfiguration.ports[0] = guestPort // config is my VZVirtualMachineConfiguration config.consoleDevices = [consoleDeviceConfiguration] Then after the VZVirtualMachine is instantiated, I get the runtime VZVirtioConsoleDevice for my device and I set my service as its delegate. In the guest system, the device is created with the expected
Hello - I am trying to add a more descriptive Location Purpose String for submitting my app to the store. I previously had a placeholder, generic string for testing. I have updated my info.plist file, but the old string is still appearing. I have 1) deleted the app from simulator device and rebuilt 2) tried pushing the version to TestFlight 3) Deleted and replaced the values in the info.plist, none of which have resolved this issue. What am I missing here?