Post

Replies

Boosts

Views

Activity

Unable to view individual non-crash reports: Please provide a valid value
I have been unable to view individual reports for some time now. I can view crash reports and I can view the list of all the other report types (Disk Writes, Energy, Hangs, and Launches), but all individual reports (which would contain the backtrace etc.) show an error: Failed to Download Energy Logs An error occurred while downloading energy reports. Please provide a valid value. This happens on macOS 14.7, macOS 15.0.1, Xcode 15.1, Xcode 15.3, Xcode 16.0, Xcode 16.1, and Xcode 16.2 beta 1, across 2 different Macs. Other people on my team can view the same reports. I'm starting to think this is something to do with how my account is setup. I'm an admin on the App Store Connect account so I don't think it's a permissions issue.
1
0
126
3w
Hang Reports Don't Add up to 100%
We have noticed that the hang reports provided in Xcode include the percentage of hang time, which are used to sort from high to low (effectively sorting by priority). However when adding these percentages up we do not get 100%. For newer releases the total may be quite low (5-20%) but even for older releases we only get up to around 85%. Are there reports we are missing? Is there a threshold or something that lower percentage reports are not hitting? Any level of understanding here would be appreciated!
0
0
164
Sep ’24
Is using @Published in a Sendable type safe?
Is the following code accurate/safe? final class ObjectWithPublished: @unchecked Sendable { @Published var property: Int? } I've tried testing this with the following test, which passes: final class PublishedThreadSafetyTests: XCTestCase { func testSettingValueFromMultipleThreads() { let object = ObjectWithPublished() let iterations = 1000 let completesIterationExpectation = expectation(description: "Completes iterations") completesIterationExpectation.expectedFulfillmentCount = iterations let receivesNewValueExpectation = expectation(description: "Received new value") receivesNewValueExpectation.expectedFulfillmentCount = iterations var cancellables: Set<AnyCancellable> = [] object .$property .dropFirst() .sink { _ in receivesNewValueExpectation.fulfill() } .store(in: &cancellables) DispatchQueue.concurrentPerform(iterations: iterations) { iteration in object.property = iteration completesIterationExpectation.fulfill() } waitForExpectations(timeout: 1) } } There are also no warnings when using the address sanitizer, so it seems like subscriptions and updating @Published values is thread-safe, but the Published type is not marked Sendable so I can't be 100% sure. If this isn't safe, what do I need to protect to have the Sendable conformance be correct?
2
0
2.0k
Jun ’22
Correct sizes and colours for toolbar icon
What are the correct sizes and colours to provide for the toolbar icon of a Safari Extension on iOS? For the size I tried creating a solid black icon and measuring the size. They seem to render at 24x24pt but providing 24px, 48px, and 72px images still look blurry. This also only covers the default text size; the icons scales with the system text size. The MDN documentation (which I cannot link here) says that an SVG can be used but supplying an SVG displays the app icon instead. The example icons are all black (like other toolbar icons on iOS) but when displayed in dark mode they are still black, which does not match the other icons in the list. Do I need to specify black and white icons? I tried using browser_action's theme_icons but they seem to be ignored. I've seen other solutions to switch out the icon at runtime but that requires a content script to be injected in to every page or for the popup to be opened by the user. iOS is already tinting the icon blue when the extension is active, can it tint it white when inactive in dark mode?
2
0
2.4k
Jul ’21
Opening native app from a web extension
Is it possible to open the native app from a web extension? I have tried creating a new tab that uses the app's URL scheme but the UI asking the user to open the app is not shown until the new page UI is dismissed. Creating a tab with an HTTPS URL that the app is setup to handle does not work and always the link in a new tab. I tried sending a message to the app extension and using NSExtensionContext.open(_:completionHandler:) but the URL is not opened and the closure received false, indicating it was not handled. Having the option to link back to the native app would be very useful.
2
0
1.5k
Jul ’21
Opting in to Associated Domains Development on macOS
On iOS I am using the ?mode=developer option described at https://developer.apple.com/documentation/bundleresources/entitlements/com_apple_developer_associated-domains, which requires the "Associated Domains Development" option to be enabled in the Develop screen on the Settings app. I am trying to use this option on macOS but cannot find a "Associated Domains Development" option anywhere. How can I enable this on macOS?
0
1
678
Dec ’20
Read from DMG from sandboxed app
Is it possible to read the files from a DMG from a sandboxed app? I have tried using hdiutil using Process but always run in to the error "hdiutil: attach failed - Device not configured". I am running hdiutil attach -verbose -debug -mountroot /path/to/mount/ /path/to/dmg.dmg where both the mount root and DMG file have been chosen via an NSOpenPanel and support writing by the application. I have also tried moving the DMG to a directory within the app's storage (as returned via FileManager.default.urls(for:in:)) and mounting it within the same directory but get the same error. The full output is: fileURL file:///path/to/dmg.dmg directoryURL file:///path/to/mount/ calling DIHLDiskImageAttach with debug: true image-options: quiet: false mount-type: in drive-options: main-url: file:///path/to/dmg.dmg mount-point: file:///path/to/mount/ verbose: true agent: hdiutil 2020-07-28 17:24:35.848455+0100 hdiutil[15701:1369864] DIHLDiskImageAttach: input dictionary { agent = hdiutil; debug = 1; "drive-options" = { }; "image-options" = { }; "main-url" = "file:///path/to/dmg.dmg"; "mount-point" = "file:///path/to/mount/"; "mount-type" = in; quiet = 0; verbose = 1; } 2020-07-28 17:24:35.848677+0100 hdiutil[15701:1369864] DIHLDiskImageAttach: disabling legacy image format attach 2020-07-28 17:24:35.848700+0100 hdiutil[15701:1369864] DIHLDiskImageAttach: newImagekeys = { "legacy-disabled" = 1; } 2020-07-28 17:24:35.848729+0100 hdiutil[15701:1369864] DIHLDiskImageAttach: creating DIHelperProxy 2020-07-28 17:24:35.848769+0100 hdiutil[15701:1369864] with dictionary: { agent = hdiutil; debug = 1; "drive-options" = {length = 42, bytes = 0x62706c69 73743030 d0080000 00000000 ... 00000000 00000009 }; "image-options" = {length = 65, bytes = 0x62706c69 73743030 d101025f 100f6c65 ... 00000000 0000001e }; "main-url" = "file:///path/to/dmg.dmg"; "mount-point" = "file:///path/to/mount/"; "mount-type" = in; operation = DIHelperAttach; quiet = 0; verbose = 1; } 2020-07-28 17:24:35.848787+0100 hdiutil[15701:1369864] [DIHelperProxy alloc] 2020-07-28 17:24:35.848815+0100 hdiutil[15701:1369864] [DIHelperProxy alloc] returning self 0x600002c0c480, retainCount 1 2020-07-28 17:24:35.852410+0100 hdiutil[15701:1369864] DIHLDiskImageAttach: running DIHelperProxy 2020-07-28 17:24:35.852426+0100 hdiutil[15701:1369864] [DIHelperProxy performOperationReturning] entry 2020-07-28 17:24:35.852438+0100 hdiutil[15701:1369864] [DIHelperProxy performOperationReturning] detaching thread 2020-07-28 17:24:35.852675+0100 hdiutil[15701:1369867] [DIHelperProxy workerThread] entry 2020-07-28 17:24:35.852696+0100 hdiutil[15701:1369867] [DIHelperProxy workerThread] setting up server 2020-07-28 17:24:35.852706+0100 hdiutil[15701:1369867] [DIHelperProxy threadSetupServer] entry 2020-07-28 17:24:35.852737+0100 hdiutil[15701:1369867] [DIHelperProxy threadSetupServer] Cannot start hdiejectd because app is sandboxed 2020-07-28 17:24:35.852750+0100 hdiutil[15701:1369867] [DIHelperProxy threadSetupServer] exiting 2020-07-28 17:24:35.852759+0100 hdiutil[15701:1369867] error: unable to set up framework server. 2020-07-28 17:24:35.852767+0100 hdiutil[15701:1369867] [DIHelperProxy workerThread] waiting for task to terminate to avoid zombies 2020-07-28 17:24:35.852775+0100 hdiutil[15701:1369867] checkHelperStatusWaitingForExit: no helper process, skipping 2020-07-28 17:24:35.852783+0100 hdiutil[15701:1369867] [DIHelperProxy workerThread] helper exited 2020-07-28 17:24:35.852793+0100 hdiutil[15701:1369867] [DIHelperProxy workerThread] exiting 2020-07-28 17:24:35.852824+0100 hdiutil[15701:1369864] [DIHelperProxy performOperationReturning] returning 6 2020-07-28 17:24:35.852847+0100 hdiutil[15701:1369864] DIHLDiskImageAttach: DIHelperProxy returned 6 2020-07-28 17:24:35.852860+0100 hdiutil[15701:1369864] [DIHelperProxy dealloc] DIHLDiskImageAttach() returned 6 (null) hdiutil: attach failed - Device not configured The issue appears to be "Cannot start hdiejectd because app is sandboxed", does this mean it's not possible to read a DMG in a sandboxed app, or is there another method available?
5
0
2.1k
Jul ’20
Spawning interactive process
Following on my question at https://forums.swift.org/t/how-to-allow-process-to-receive-user-input-when-run-as-part-of-an-executable-e-g-to-enabled-sudo-commands/34357 I am trying to spawn an interactive process using a swift executable, specifically `sudo`.I've tried a few things but nothing is working so I think I'm missing something fundemental.I tried using `openpty` but I believe the issue is that I need to pass input to `amaster`, which I'm unsure how to do:public func runOpenpty(_ command: [String]) throws { var amaster: Int32 = 0 var aslave: Int32 = 0 if openpty(&amp;amaster, &amp;aslave, nil, nil, nil) == -1 { print("Failed to open pty") } let masterHandle = FileHandle(fileDescriptor: amaster, closeOnDealloc: true) let slaveHandle = FileHandle(fileDescriptor: aslave, closeOnDealloc: true) let process = Process() process.launchPath = "/usr/bin/env" process.arguments = command process.standardInput = FileHandle.standardInput process.standardOutput = FileHandle.standardOutput try process.run() process.waitUntilExit() }I also came across https://github.com/eonil/PseudoTeletypewriter.Swift, which uses `forkpty`, but I've been unable to get it working from a swift executable.How can I allow the user to provide input to a process that I spawn from my swift executable?
1
0
1.7k
Mar ’20