Post

Replies

Boosts

Views

Activity

"Unable to find module dependency" with custom PRODUCT_MODULE_NAME
Hi! Here is a brief introduction at first. I am developing a framework and our project has following structure: All frameworks are static ones. PublicAPI framework contains the only declarations that are visible to users, while ModuleX frameworks are internal modules. During build process we archive all targets and libtool all internal module binaries into PublicAPI one. This way we distribute our framework as a single xcframework package and hide all internal modules from users. Here is the problem part. All these frameworks exist in separate projects that have single static library target. I want to add new targets with different settings, say SWIFT_ACTIVE_COMPILATION_CONDITIONS or else. So project would look like this Also I would like both regular and extended targets to build frameworks with same module name, so that neither users (that use PublicAPI framework) nor I would have to change imports in my code. My idea was to set PRODUCT_MODULE_NAME in extended targets to the same value as in regular ones. But when I build PublicAPIExtended target I get an error Unable to find module dependency 'Module1' although derived data contains Module1Extended.framework with Module1 module inside. What did I do wrong? Is it possible to build project like this at all? And another thing - I also tried to build a scheme containing both PublicAPI and PublicAPIExtended targets and got different error even prior to build: error: Multiple commands produce '<ExtractAppIntentsMetadata Path(_str: "/Users/antonprotko/Library/Developer/Xcode/DerivedData/test-acncglphufkosyhjzbwrbzalsnlh/Build/Products/Debug") bar/Metadata.appintents>' note: Target 'bar copy' (project 'bar'): ExtractAppIntentsMetadata note: Target 'bar' (project 'bar'): ExtractAppIntentsMetadata Can I fix it somehow? Here is example project with similar targets - foo/foo_copy and bar/bar_copy share the same sources with different compilation conditions. bar targets depend on foo targets and building bar_copy fails with Unable to find module dependency: 'foo' https://drive.google.com/file/d/1Cj5cIw8U0LJ5Xt9ZnhbKIo240kbrizLE/view?usp=sharing
0
1
283
May ’26
xcodebuild does not retry UI tests with xcode 26.2
I have ios UI tests that are build with command xcodebuild -workspace ... -scheme ... -configuration ... -derivedDataPath ... -destination ... -testPlan ... build-for-testing Then I run them with xcodebuild -destination ... -resultBundlePath ... -parallel-testing-worker-count ... -xctestrun ... test-without-building I also have following settings in testplan "maximumTestRepetitions" : 3, "testRepetitionMode" : "retryOnFailure", With xcode 16.4 tests were retried on failure up to 3 times, but migrating to xcode 26.2 seems to change this behavior and tests are no longer retried. Is it expected behaviour and I should manually add params like -test-iterations 3 -retry-tests-on-failure into xcodebuild test-without-building command? Here is xcresult - https://drive.google.com/file/d/1xHgiZnIK_lptDSUf-fCyEnT9zYubZlCf/view?usp=sharing And testrun file -https://drive.google.com/file/d/1aBi2sTjy8zFYtgYn1KA60T8gwD_OnBCF/view?usp=sharing
1
0
295
Jan ’26
Avoid repeated authorization dialogs when changing network settings
I have an swift command line tool that changes proxy settings in system preferences via SystemConfiguration framework, does some stuff, and in the end reverts proxy settings back to original. Here is simplified code: var authorization: AuthorizationRef? let status = AuthorizationCreate(nil, nil, [], &authorization) let prefs = SCPreferencesCreateWithAuthorization(nil, "myapp" as CFString, nil, authorization) // change proxy setttings // do some stuff let prefs2 = SCPreferencesCreateWithAuthorization(nil, "myapp" as CFString, nil, authorization) // change proxy settings back to original When I try to change settings for the first time, the system dialog appears requesting permission to change network settings. If I try to change settings again within а short period of time, the dialog does not appear again. However, if it takes more than several minutes after first change, the dialog does appear again. Is there a way to create authorization, so that the dialog appears only once per app launch, no matter how much time passed since the first dialog?
1
0
409
Oct ’25
SwitUI preview loads indefinitely
Hi! I develop an iOS library and I met an issue with SwiftUI previews in iOS app project with my library integrated. After I open preview, build for preview finishes successfully, but preview itself never appears. I failed to find any error messages or any other indicators of what went wrong or how to fix it. Switching to legacy preview execution seems to fix problem, but I think that is not ideal. Could you help fixing this? Xcode 16.2, Simulator iPhone 16, iOS 18.2 Project to reproduce - https://drive.google.com/file/d/1cU6JKwshK_wQfe9YIqcMg3UGWq45OYlx/view?usp=sharing Preview diagnostics - https://drive.google.com/file/d/1kPcgVSSqreiepGuqhdIoCW2rLSicgsWr/view?usp=sharing
7
0
382
May ’25
Preboot simulators in parallel testing
We run our UI tests in parallel on 3 simulators, and I noticed, that the first one starts executing tests way faster then the rest (because others are still booting, I guess). Also we have our backend server running locally which is used in UI tests. And here comes the problem - I noticed that tests on first simulator are often failing because of the problems with local backend(requests take much more time than usual) exactly in period when other simulators are still booting(tests stop failing when all 3 simulators started running tests). When I tried running tests without parallel simulators problems with backend disappear. So my guess is that simulators booting they take some resources(CPU, memory) which interferes with backend. So my question is there some way to start executing tests only when all parallel simulators are booted?
0
1
637
Sep ’23
UI test: Unable to access view in table view
I have some view which contents I want to interact with in UI test. In the first case, when view is added to view controller everything is fine - I can access all its contents. However, when the same view is added to table view cell, some of its content become unaccessible. Here is view example class SomeView: UIView { required init?(coder: NSCoder) { fatalError() } override init(frame: CGRect) { super.init(frame: frame) let label = UILabel(frame: .init(x: 5, y: 5, width: 100, height: 20)) label.text = "Label" label.accessibilityIdentifier = "label" addSubview(label) let button = UIButton(frame: .init(x: 5, y: 35, width: 100, height: 20)) button.setTitle("Button", for: .normal) button.accessibilityIdentifier = "button" button.setTitleColor(.black, for: .normal) addSubview(button) let view = UIView(frame: .init(x: 5, y: 65, width: 100, height: 20)) view.backgroundColor = .red view.accessibilityIdentifier = "container" addSubview(view) let view2 = UIView(frame: .init(x: 0, y: 0, width: 100, height: 20)) view2.backgroundColor = .red view2.accessibilityIdentifier = "inner_view" view.addSubview(view2) let label2 = UILabel(frame: .init(x: 0, y: 0, width: 100, height: 20)) label2.text = "Label2" label2.accessibilityIdentifier = "inner_label" view2.addSubview(label2) accessibilityIdentifier = "some_view" } } And output from UI test Attributes: Application, 0x7fb4b9d0e680, pid: 71041, label: 'UITest' Element subtree: →Application, 0x7fb4b9d0e680, pid: 71041, label: 'UITest' Window (Main), 0x7fb4b9d0ae20, {{0.0, 0.0}, {390.0, 844.0}} Other, 0x7fb4b9b08bc0, {{0.0, 0.0}, {390.0, 844.0}} Other, 0x7fb4b9b0b040, {{0.0, 0.0}, {390.0, 844.0}} Other, 0x7fb4b9b0ac80, {{0.0, 0.0}, {390.0, 844.0}} Other, 0x7fb4b9b09960, {{0.0, 50.0}, {200.0, 100.0}}, identifier: 'some_view' StaticText, 0x7fb4b9b0ec80, {{5.0, 55.0}, {100.0, 20.0}}, identifier: 'label', label: 'Label' Button, 0x7fb4b9b10770, {{5.0, 85.0}, {100.0, 20.0}}, identifier: 'button', label: 'Button' StaticText, 0x7fb4b9b0bbf0, {{28.0, 84.0}, {54.0, 22.0}}, label: 'Button' Other, 0x7fb4b981b1d0, {{5.0, 115.0}, {100.0, 20.0}}, identifier: 'container' Other, 0x7fb4b981b2e0, {{5.0, 115.0}, {100.0, 20.0}}, identifier: 'inner_view' StaticText, 0x7fb4b981c0d0, {{5.0, 115.0}, {100.0, 20.0}}, identifier: 'inner_label', label: 'Label2' Table, 0x7fb4b981c1e0, {{16.0, 343.0}, {361.0, 244.0}} Cell, 0x7fb4b981c2f0, {{16.0, 343.0}, {361.0, 100.0}} StaticText, 0x7fb4b981c420, {{21.0, 348.0}, {100.0, 20.0}}, identifier: 'label', label: 'Label' StaticText, 0x7fb4b981c530, {{21.0, 408.0}, {100.0, 20.0}}, identifier: 'inner_label', label: 'Label2' Button, 0x7fb4b981c640, {{21.0, 378.0}, {100.0, 20.0}}, identifier: 'button', label: 'Button' StaticText, 0x7fb4b981c750, {{44.0, 377.0}, {54.0, 22.0}}, label: 'Button' Other, 0x7fb4b981c860, {{16.0, 343.0}, {361.0, 100.0}} Other, 0x7fb4b981c970, {{16.0, 343.0}, {361.0, 100.0}} Other, 0x7fb4b9b05400, {{36.0, 442.7}, {341.0, 0.3}} Path to element: →Application, 0x7fb4b9d0e680, pid: 71041, label: 'UITest' Query chain: →Find: Target Application 'com.temp.temp.UITest' Output: { Application, 0x7fb4b981ce80, pid: 71041, label: 'UITest' } As you can see, in table view I am missing some_view, container and inner_view views. Is there a way to access these elements in table view?
0
0
840
Jul ’23
"Unable to find module dependency" with custom PRODUCT_MODULE_NAME
Hi! Here is a brief introduction at first. I am developing a framework and our project has following structure: All frameworks are static ones. PublicAPI framework contains the only declarations that are visible to users, while ModuleX frameworks are internal modules. During build process we archive all targets and libtool all internal module binaries into PublicAPI one. This way we distribute our framework as a single xcframework package and hide all internal modules from users. Here is the problem part. All these frameworks exist in separate projects that have single static library target. I want to add new targets with different settings, say SWIFT_ACTIVE_COMPILATION_CONDITIONS or else. So project would look like this Also I would like both regular and extended targets to build frameworks with same module name, so that neither users (that use PublicAPI framework) nor I would have to change imports in my code. My idea was to set PRODUCT_MODULE_NAME in extended targets to the same value as in regular ones. But when I build PublicAPIExtended target I get an error Unable to find module dependency 'Module1' although derived data contains Module1Extended.framework with Module1 module inside. What did I do wrong? Is it possible to build project like this at all? And another thing - I also tried to build a scheme containing both PublicAPI and PublicAPIExtended targets and got different error even prior to build: error: Multiple commands produce '<ExtractAppIntentsMetadata Path(_str: "/Users/antonprotko/Library/Developer/Xcode/DerivedData/test-acncglphufkosyhjzbwrbzalsnlh/Build/Products/Debug") bar/Metadata.appintents>' note: Target 'bar copy' (project 'bar'): ExtractAppIntentsMetadata note: Target 'bar' (project 'bar'): ExtractAppIntentsMetadata Can I fix it somehow? Here is example project with similar targets - foo/foo_copy and bar/bar_copy share the same sources with different compilation conditions. bar targets depend on foo targets and building bar_copy fails with Unable to find module dependency: 'foo' https://drive.google.com/file/d/1Cj5cIw8U0LJ5Xt9ZnhbKIo240kbrizLE/view?usp=sharing
Replies
0
Boosts
1
Views
283
Activity
May ’26
xcodebuild does not retry UI tests with xcode 26.2
I have ios UI tests that are build with command xcodebuild -workspace ... -scheme ... -configuration ... -derivedDataPath ... -destination ... -testPlan ... build-for-testing Then I run them with xcodebuild -destination ... -resultBundlePath ... -parallel-testing-worker-count ... -xctestrun ... test-without-building I also have following settings in testplan "maximumTestRepetitions" : 3, "testRepetitionMode" : "retryOnFailure", With xcode 16.4 tests were retried on failure up to 3 times, but migrating to xcode 26.2 seems to change this behavior and tests are no longer retried. Is it expected behaviour and I should manually add params like -test-iterations 3 -retry-tests-on-failure into xcodebuild test-without-building command? Here is xcresult - https://drive.google.com/file/d/1xHgiZnIK_lptDSUf-fCyEnT9zYubZlCf/view?usp=sharing And testrun file -https://drive.google.com/file/d/1aBi2sTjy8zFYtgYn1KA60T8gwD_OnBCF/view?usp=sharing
Replies
1
Boosts
0
Views
295
Activity
Jan ’26
Avoid repeated authorization dialogs when changing network settings
I have an swift command line tool that changes proxy settings in system preferences via SystemConfiguration framework, does some stuff, and in the end reverts proxy settings back to original. Here is simplified code: var authorization: AuthorizationRef? let status = AuthorizationCreate(nil, nil, [], &authorization) let prefs = SCPreferencesCreateWithAuthorization(nil, "myapp" as CFString, nil, authorization) // change proxy setttings // do some stuff let prefs2 = SCPreferencesCreateWithAuthorization(nil, "myapp" as CFString, nil, authorization) // change proxy settings back to original When I try to change settings for the first time, the system dialog appears requesting permission to change network settings. If I try to change settings again within а short period of time, the dialog does not appear again. However, if it takes more than several minutes after first change, the dialog does appear again. Is there a way to create authorization, so that the dialog appears only once per app launch, no matter how much time passed since the first dialog?
Replies
1
Boosts
0
Views
409
Activity
Oct ’25
SwitUI preview loads indefinitely
Hi! I develop an iOS library and I met an issue with SwiftUI previews in iOS app project with my library integrated. After I open preview, build for preview finishes successfully, but preview itself never appears. I failed to find any error messages or any other indicators of what went wrong or how to fix it. Switching to legacy preview execution seems to fix problem, but I think that is not ideal. Could you help fixing this? Xcode 16.2, Simulator iPhone 16, iOS 18.2 Project to reproduce - https://drive.google.com/file/d/1cU6JKwshK_wQfe9YIqcMg3UGWq45OYlx/view?usp=sharing Preview diagnostics - https://drive.google.com/file/d/1kPcgVSSqreiepGuqhdIoCW2rLSicgsWr/view?usp=sharing
Replies
7
Boosts
0
Views
382
Activity
May ’25
Assertion Failure: Test crashed with signal ill.
I get this error from time to time in UI tests when they are run on CI. Any ideas what might be causing this error?
Replies
6
Boosts
0
Views
5.0k
Activity
Oct ’24
Preboot simulators in parallel testing
We run our UI tests in parallel on 3 simulators, and I noticed, that the first one starts executing tests way faster then the rest (because others are still booting, I guess). Also we have our backend server running locally which is used in UI tests. And here comes the problem - I noticed that tests on first simulator are often failing because of the problems with local backend(requests take much more time than usual) exactly in period when other simulators are still booting(tests stop failing when all 3 simulators started running tests). When I tried running tests without parallel simulators problems with backend disappear. So my guess is that simulators booting they take some resources(CPU, memory) which interferes with backend. So my question is there some way to start executing tests only when all parallel simulators are booted?
Replies
0
Boosts
1
Views
637
Activity
Sep ’23
UI test: Unable to access view in table view
I have some view which contents I want to interact with in UI test. In the first case, when view is added to view controller everything is fine - I can access all its contents. However, when the same view is added to table view cell, some of its content become unaccessible. Here is view example class SomeView: UIView { required init?(coder: NSCoder) { fatalError() } override init(frame: CGRect) { super.init(frame: frame) let label = UILabel(frame: .init(x: 5, y: 5, width: 100, height: 20)) label.text = "Label" label.accessibilityIdentifier = "label" addSubview(label) let button = UIButton(frame: .init(x: 5, y: 35, width: 100, height: 20)) button.setTitle("Button", for: .normal) button.accessibilityIdentifier = "button" button.setTitleColor(.black, for: .normal) addSubview(button) let view = UIView(frame: .init(x: 5, y: 65, width: 100, height: 20)) view.backgroundColor = .red view.accessibilityIdentifier = "container" addSubview(view) let view2 = UIView(frame: .init(x: 0, y: 0, width: 100, height: 20)) view2.backgroundColor = .red view2.accessibilityIdentifier = "inner_view" view.addSubview(view2) let label2 = UILabel(frame: .init(x: 0, y: 0, width: 100, height: 20)) label2.text = "Label2" label2.accessibilityIdentifier = "inner_label" view2.addSubview(label2) accessibilityIdentifier = "some_view" } } And output from UI test Attributes: Application, 0x7fb4b9d0e680, pid: 71041, label: 'UITest' Element subtree: →Application, 0x7fb4b9d0e680, pid: 71041, label: 'UITest' Window (Main), 0x7fb4b9d0ae20, {{0.0, 0.0}, {390.0, 844.0}} Other, 0x7fb4b9b08bc0, {{0.0, 0.0}, {390.0, 844.0}} Other, 0x7fb4b9b0b040, {{0.0, 0.0}, {390.0, 844.0}} Other, 0x7fb4b9b0ac80, {{0.0, 0.0}, {390.0, 844.0}} Other, 0x7fb4b9b09960, {{0.0, 50.0}, {200.0, 100.0}}, identifier: 'some_view' StaticText, 0x7fb4b9b0ec80, {{5.0, 55.0}, {100.0, 20.0}}, identifier: 'label', label: 'Label' Button, 0x7fb4b9b10770, {{5.0, 85.0}, {100.0, 20.0}}, identifier: 'button', label: 'Button' StaticText, 0x7fb4b9b0bbf0, {{28.0, 84.0}, {54.0, 22.0}}, label: 'Button' Other, 0x7fb4b981b1d0, {{5.0, 115.0}, {100.0, 20.0}}, identifier: 'container' Other, 0x7fb4b981b2e0, {{5.0, 115.0}, {100.0, 20.0}}, identifier: 'inner_view' StaticText, 0x7fb4b981c0d0, {{5.0, 115.0}, {100.0, 20.0}}, identifier: 'inner_label', label: 'Label2' Table, 0x7fb4b981c1e0, {{16.0, 343.0}, {361.0, 244.0}} Cell, 0x7fb4b981c2f0, {{16.0, 343.0}, {361.0, 100.0}} StaticText, 0x7fb4b981c420, {{21.0, 348.0}, {100.0, 20.0}}, identifier: 'label', label: 'Label' StaticText, 0x7fb4b981c530, {{21.0, 408.0}, {100.0, 20.0}}, identifier: 'inner_label', label: 'Label2' Button, 0x7fb4b981c640, {{21.0, 378.0}, {100.0, 20.0}}, identifier: 'button', label: 'Button' StaticText, 0x7fb4b981c750, {{44.0, 377.0}, {54.0, 22.0}}, label: 'Button' Other, 0x7fb4b981c860, {{16.0, 343.0}, {361.0, 100.0}} Other, 0x7fb4b981c970, {{16.0, 343.0}, {361.0, 100.0}} Other, 0x7fb4b9b05400, {{36.0, 442.7}, {341.0, 0.3}} Path to element: →Application, 0x7fb4b9d0e680, pid: 71041, label: 'UITest' Query chain: →Find: Target Application 'com.temp.temp.UITest' Output: { Application, 0x7fb4b981ce80, pid: 71041, label: 'UITest' } As you can see, in table view I am missing some_view, container and inner_view views. Is there a way to access these elements in table view?
Replies
0
Boosts
0
Views
840
Activity
Jul ’23