Skip to content
This repository has been archived by the owner on Dec 5, 2022. It is now read-only.

Xcode 10 removes internal class used for event generation and causes crash #73

Open
codyd51 opened this issue Feb 18, 2019 · 6 comments

Comments

@codyd51
Copy link

codyd51 commented Feb 18, 2019

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!

@wojciechczerski
Copy link
Member

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?

@codyd51
Copy link
Author

codyd51 commented Feb 18, 2019

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.

@wojciechczerski
Copy link
Member

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.

@wojciechczerski
Copy link
Member

@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?

@kaustubhkabra
Copy link

This still exists on public Xcode 10.2. Any further help here?

@sky-weihao
Copy link

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?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants