Post

Replies

Boosts

Views

Activity

Reply to Error OSSystemExtensionErrorDomain Code=4 "(null)"
I think this error is OSSystemExtensionErrorExtensionNotFound, from <SystemExtensions/SystemExtensions.h>. I see this error also when I try to deactivate my camera extension (after approving its removal with the OS' dialog), but I'm running on a laptop with a built-in, non-removable camera. Maybe the error doesn't happen if there are no cameras in the system, so my extension can be unloaded. I don't know and don't particularly care, because in our shipping apps we never make a deactivationRequest. It isn't clear to me what that API is for - as far as the user is concerned, the driver is installed because they installed its host app and approved it.
Topic: App & System Services SubTopic: Drivers Tags:
Jan ’24
Reply to unsatisfied entitlements macOS app
@eskimo thanks for the reply codesign --display --entitlements does show a com.apple.application-identifier is present, it is the same for both apps - the bundleID prefixed by our teamID. security cms -D on the embedded.provisionprofile shows the same result for both apps, including the same com.apple.application-identifier value in the Entitlements section. The working and non-working app both refer to the same certificate, with the same serial number, hash and expiration date. The profile for both the working and non-working app expires Sep 23, 2040 at 9:36:53 AM PDT The The plists differ a little, because the two apps were built on different Macs with different toolchains. BuildMachineOSBuild good 22A400, bad 22G90 DTPlatformBuild, good 14A309, bad <empty string> DTPlatformVersion, good 12.3, bad 13.3 DTSDKBuild good 21E226, bad 22E245 DTSDKName good macosx12.3, bad macosx13.3 DTXcode good 1400 bad 1430 DTXcodeBuild good 14A309, bad 14E222b I ran spctl --assess -vvv on the bad app, which said accepted I edited this post, previously I said spctl claimed the bundle format was unrecognized. That was my error - I passed it a path to the app which has spaces in its name with un-escaped spaces. Instead of it telling you that the path doesn't exist, spctl says it is broken. I don't know whether to believe that, because the system log tells me something else. Also, the bundles are almost identical. The "good" app has an additional profile, "embedded.mobileprovision". Which one does the OS use, and why is there an embedded.mobileprovision file in a macOS app? I'll have another look at those links you cited, thanks
Topic: Code Signing SubTopic: Entitlements Tags:
Jan ’24
Reply to unsatisfied entitlements macOS app
Further progress here. Following the instructions in TN3125, I find that the certificate inside the .mobileprovision file is expired after all! The steps were: remove the cms (Cryptographic Message Syntax wrapper) security cms -D -i <path-to-app>/embedded.provisionprofile -o badapp-payload.plist eyeball the badapp-payload.plist file, verifying that it includes a DeveloperCertificates section extract the first certificate plutil -extract DeveloperCertificates.0 raw -o - badapp-payload.plist | base64 -D > cert0.cer inspect the certificate certtool d cert0.cer which says Not After : 21:10:25 Sep 21, 2023 so, big oops on our part. Hopefully someone aside from myself can learn something from this, I'll post if the problems are all fixed by using a valid certificate.
Topic: Code Signing SubTopic: Entitlements Tags:
Jan ’24
Reply to Xcode 15.2.0 has a compilation bug leading to incorrect code generation without warnings
you can enable the undefined behavior sanitizer in the Scheme settings under Diagnostics. This produces this warning for me, even for debug builds: runtime error: shift exponent 64 is too large for 32-bit type 'int' SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior There's another, separate build setting, CLANG_UNDEFINED_BEHAVIOR_SANITIZER_INTEGER, which did not help here. This forum isn't a place to report bugs - use Feedback Assistant for that. Undefined behavior really is undefined, you just got away with it before.
Jan ’24
Reply to Handling data from bluetooth device
Is this a Bluetooth, or a Bluetooth Low Energy device? Is it yours (do you own the firmware, and know what it does)? Or is it a device from a third party that you would like to use? The easiest type of device to support is BLE. Have you looked here: https://developer.apple.com/bluetooth/ ? If you've never done this before, start with the Heart Rate Monitor app and use an off-the-shelf heart rate monitor. The Heart Rate Monitor profile is a published standard profile. If you're comfortable with it, you can also use a low-cost BLE development kit to make your own BLE device, with any profile you like, using chips from TI, Maxim IC, Silicon Labs, Nordic, Dialog etc
Topic: Programming Languages SubTopic: Swift Tags:
Jan ’24
Reply to CPU Saturation with Charts real time plotting from data received from Bluetooth
I see it has been a week and no-one has answered. I've never used Swift Charts, but I'll take a stab at this. You're feeding four channels of data at 2400 samples/sec into an ever-growing array of structs. Each sample struct (VoltagePerTime) contains a string with the channel name, but the channel name probably doesn't change from one sample to the next sample in a given channel, right? So why not infer the channel name from the array you put the sample into. Then you don't store a bunch of identical strings in your sample array. Are the samples arriving at constant intervals? If so, the time can be inferred from the position in the array, so you don't need to store the time. At most, you would need to store the start time of each sample set. I assume the samples arrive in strictly monotonic time order. However, your ChartView filter closure examines every sample you have collected, to see if it falls within the time you wish to graph. As your sample set grows, simply fetching the samples in your graph window takes longer and longer. You should consider using a smarter algorithm to select the data that you pass to the graph, using what you know in advance about the data. Store as little as possible, prefer numbers to strings. Also, you have @Published every array. But if your graph is currently viewing the first 2 seconds of data, while you collect the tenth second, nothing is going to change on screen, but you're nevertheless asking the ChartView's body property to be re-evaluated. If you leave your app running for long enough, you're going to run out of memory, so you should consider implementing some kind of persistent buffer for your data, or a circular in-memory buffer, or both. There are further optimizations you could consider, but these suggestions may be enough to give you acceptable performance so that you can get on with the rest of the project.
Feb ’24
Reply to Color not working properly
@Pokka your screen shot is from "Color LCD", which is what Apple calls the built-in display on their laptop. By default, this uses the P3 color space. If you go to Settings/Displays, select the built-in display and change its Preset to "Internet & Web (sRGB)", the Digital Color Meter should show you the values you expect. Alternatively, you can create the color in the P3 color space: let darkorange = Color(.displayP3, red: 213/255, green: 131/255, blue: 120/255) The default display gamut is sRGB, which isn't as wide as P3. So when you create your dark orange in sRGB, then display it in P3, it isn't as colorful as you'd expect.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Feb ’24