SwiftMonkey
SwiftMonkey copied to clipboard
Xcode 10 removes internal class used for event generation and causes crash
When Xcode 10 packages the <App Name>UITests-Runner.app
, it includes a different XCTest.framework
from the one it packaged with Xcode 9. This new version does not contain the XCEventGenerator
class that SwiftMonkey expects, and causes a crash when the library user uses addDefaultXCTestPrivateActions
.
The crash occurs when Monkey tries to force-unwrap +[XCEventGenerator sharedGenerator
, which is nil
because the class doesn't exist.
Are there any plans to update this library to use components present in the Xcode 10 XCTest framework?
Additionally, I was unable to send events when using addDefaultUIAutomationActions
(UIAutomation.framework). Is this also known to be a broken approach on iOS 12?
Thanks!
Hey there @codyd51 ! Which version of Xcode are you using exactly? I just tested SwiftMonkey with addDefaultXCTestPrivateActions()
and addDefaultUIAutomationActions()
and both work fine (Xcode 10.1 and iOS 12.1 simulator). Also, are you testing on a device or simulator?
Thanks for the prompt response! I'm using Xcode 10.2 beta 2 (10P91b).
I'm testing on an iOS 12 device. I can upload the new XCTest.framework if you'd like.
I will install Xcode Beta and try it myself. When I can see the error you described, I'll try finding a workaround for it. Thanks for reporting the issue! I'll keep you informed about any progress.
@codyd51 I've checked 10.2 beta 3 (10P99q) on a Simulator, and here's what I observed:
- using
addDefaultUIAutomationActions()
works fine - using
addDefaultXCTestPrivateActions()
does not crash, but it looks like it "freezes" the test runner and the tests are not executed
I'll try to investigate why is this happening, however it might just be a "beta" thing. Have you tried reproducing the crash on the latest beta?
This still exists on public Xcode 10.2. Any further help here?
I meet the same problem as kaustubhkabra described, I tested the demo at Xcode 10.2 but it seems frezzed when run into addDefaultXCTestPrivateActions(), any idea about it?