We got development entitlement for our Driver that we requested here: https://developer.apple.com/contact/request/system-extension/
Next we tested our Driver on test devices and now want to upload build into TestFlight.
But it looks like we need distribution version of same entitlements.
Where we can request them?
BTW, Apple Docs: Requesting Entitlements for DriverKit Development describe only development approach. It would be good to add instructions for Distribution as well.
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
In following code example:
struct ContentView: View {
@State var text: String = "sample text"
var body: some View {
VStack {
TextField("", text: $text)
Button(action: { print("action performed!") }) {
Text("Click me")
}
.keyboardShortcut(.defaultAction)
}
.padding(40)
}
}
.keyboardShortcut(.defaultAction) that is attached to Button perfectly works on macOs Big Sur(11.6) and I see "action performed!" in Xcode console when tap Enter key on keyboard.
Unfortunately, same example doesn't work on macOs Monterey(12.0.1) and Xcode 13.1. So nothing happens(I don't see any logs) when I tap Enter key on keyboard. Also I noticed that it happens only when focus is set in TextField.
I checked that onSubmit can solve this issue.
Unfortunately, I can't use since it's available in macOs 12 or newer but my App has deployment target is macOs 11.
So any workarounds are welcomed.
We are experiencing missing coverage for private variables in SwiftUI views after update from Xcode 14.3 to Xcode 14.2.
Steps to reproduce:
Create new SwiftUI project in Xcode
Enable code coverage
Modify ContentView to
struct ContentView: View {
private let title = "Hello, world!"
let text: String
var body: some View {
VStack {
Text(title)
Text(text)
}
.padding()
}
}
Run UITest - CoverageTestTests::testExample
Check coverage in Xcode for ContentView
Actual result: Line private let title = "Hello, world!" is not covered.
Expected result: Line should be covered
Workaround: Generate initialiser for ContentView
init(text: String) {
self.text = text
}
Coverage is correct when initialiser is added explicitly
Test project: https://github.com/yuri-qualtie/CoverageTest
Code block below produces different results depending on if print is commented or not:
import Combine
var cancellables = SetAnyCancellable()
enum FruitError: Error {
case bad
}
var fruit = "apple"
func getFruit() - String {
fruit
}
Just(getFruit)
//.print()
.map{$0()}
.flatMap { value - AnyPublisherString, FruitError in
print("in flat map \(value)")
if value == "apple" {
fruit = "pineapple"
return Fail(error: FruitError.bad).eraseToAnyPublisher()
}
return Just("banana").setFailureType(to: FruitError.self).eraseToAnyPublisher()
}
.retry(1)
.sink(receiveCompletion: { print($0) }, receiveValue: {print($0)})
.store(in: &cancellables)
Without print:
in flat map apple
in flat map apple
failure
With print:
in flat map apple
in flat map pineapple
banana
receive finished
finished
receive finished
Why does print or any other debug operator(breakpoint or handleEvent) change behaviour of sequence?
Playground without print - https://developer.apple.com/forums/content/attachment/d8a1d043-191b-41f3-8f0e-72dafa621374
Playground with print - https://developer.apple.com/forums/content/attachment/7c0de4c2-37fb-4136-ae8e-5ed0e77287c5
We were encourage by Frameworks Engineer reply and Apple's Official Docs and started to use this approach in our App. But next we detected that App has leaked objects when we do Memory Graph Check in UITests.
Removing of .accessibilityElement(children: .contain) solves the issue but we still want to use container identifiers in our UITests.
Here is a sample project to illustrated and reproduce the issue: https://github.com/yuri-qualtie/MemoryLeaks. All the details and steps are described in Readme
We need help with fix for .accessibilityElement(children: .contain) but any workaround is welcomed
We are developing driver for our USB device. We've implemented commutation using IOUSBHostPipe::IO and it perfectly works for data packets that less than 256 bytes. However it hangs when reply from USB device is about 512 bytes. We see 0x2ed // device not responding error when we unplug our device and driver is stopped.
Here is our code for setup:
constexpr uint32_t kOutEndpointAddress = 1;
constexpr uint32_t kInEndpointAddress = 129;
constexpr uint16_t kBufferSize = 256;
.....
struct ForcePlateDriver_IVars {
....
IOUSBHostPipe *inPipe;
IOBufferMemoryDescriptor *inData;
uint16_t maxPacketSize;
};
.....
ret = ivars->interface->CopyPipe(kInEndpointAddress, &ivars->inPipe);
ret = ivars->interface->CreateIOBuffer(kIOMemoryDirectionIn,
ivars->maxPacketSize,
&ivars->inData);
We use following code for reading data from USB device:
uint32_t bytesTransferred = 0;
ret = ivars->inPipe->IO(
ivars->inData,
ivars->maxPacketSize,
&bytesTransferred,
0);
What we tried:
Increase kBufferSize to 512 but drive still hangs
Change 0 to 2000 (timeout) for inPipe->IO method.
Result method returns - 0x2d6(// I/O Timeout)
We used Locale::usesMetricSystem to distinguish between metric and Imperial(US) measurement systems. We set "-AppleLocale en_US" as launch argument for App in UITests but usesMetricSystem still returns true in case user's locale are not equal to "US" in System Preferences - Language and Region - Region.
Here is a demo project to illustrate the issue: https://github.com/yuri-qualtie/UseMetricSystemDemo
Precondition: Change user region to not US(for example Australia) in System Preferences - Language and Region - Region
We expect that code:
print(Locale.current.usesMetricSystem)
prints false when -AppleLocale en_US is set but actual result is true
Probably there is alternative way how to change measurement system via launch arguments or App's settings in Xcode?
We updated our CI machine to:
macOS Monterey Version 12.0.1
Xcode Version 13.1 (13A1030d)
We started to receive UITest failures with following error:
Testing failed:
MemoryLeaksUITests:
MemoryLeaksUITests-Runner (3507) encountered an error (The test runner failed to initialize for UI testing. If you believe this error represents a bug, please attach the result bundle at /Users/dev/Library/Developer/Xcode/DerivedData/MemoryLeaks-dduvihbyiuzwdnawggthtfwdgwks/Logs/Test/Test-MemoryLeaks-2021.11.05_13-43-58-+0300.xcresult. (Underlying Error: Timed out while enabling automation mode.))
The failure disappears if we enable UIAutomation for testmanagerd by providing password
However it's not one time action. This permission dialog still appears after some time during a day. We noticed it constantly appears after machine reboot.
Unfortunately it blocks us from using our CI machine as test runner.
There is no option(checkbox) to permanently enable(provide password) automation in this dialog. Also it's not possible to add it in Settings -> Security & Privacy -> Privacy - Automation.
Here is a sample project on GitHub to reproduce the issue.
Steps:
Reboot machine
Run in terminal
xcodebuild -target MemoryLeaksUITests -scheme MemoryLeaks test
We use .xcresult files on our CI and recently noticed that size of file significantly increased. So previously we had files ~ 50 MB but now they are ~ 300 MB.
After investigation of .xcresult contents we found that it contains macOS Logs - test-session-systemlogs-2022.01.05_13-13-07-+0000
In testmanagerd .log we see in a last line:
Moved logarchive from /var/tmp/test-session-systemlogs-2022.01.05_13-13-07-+0000.logarchive to ../Staging/1_Test/Diagnostics/My Mac_4203018E-580F-C1B5-9525-B745CECA79EB/test-session-systemlogs-2022.01.05_13-13-07-+0000.logarchive
Issue is reproducible on a new project.
Steps:
File -> New -> Project
Select macOS -> App
Enable include test
For simplicity disable(comment) all the UITests except ResultSampleUITests::testExample
Add XCTAssertTrue(false) after app.launch()
Run tests from console and specify path to resultBundlePath
xcodebuild -project ResultSample.xcodeproj -scheme ResultSample -resultBundlePath ~/Downloads/2/all-tests -test-timeouts-enabled YES test
7. When tests are finished navigate to resultBundlePath and check size of all-tests.xcresult.
It has size 51.6 MB for me.
If change XCTAssertTrue(false) to XCTAssertTrue(true) then size of all-tests.xcresult is decreased to 31 KB.
Any idea how to disable/delete macOS diagnostic logs or decrease a size of .xcresult