Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to access private API in UIWindow: "ContextID" #17

Closed
pantaopt opened this issue Jul 22, 2021 · 8 comments · Fixed by #29
Closed

Unable to access private API in UIWindow: "ContextID" #17

pantaopt opened this issue Jul 22, 2021 · 8 comments · Fixed by #29
Labels
bug Something isn't working waiting Waiting for OP
Milestone

Comments

@pantaopt
Copy link

image

@gabriellanata
Copy link
Contributor

Could you share how you're creating the event generator? Is it from a view already added to a UIWindow?

@gabriellanata gabriellanata added bug Something isn't working waiting Waiting for OP labels Jul 22, 2021
@pantaopt
Copy link
Author

image
@gabriellanata Thanks for your prompt reply. I just copyed code from https://github.com/lyft/Hammer/blob/main/Tests/HammerTests/DemoTests.swift#L17

And following is ViewController.swift
image

@gabriellanata
Copy link
Contributor

Hmm that's weird. Did you setup your tests to run inside a TestHost app like the setup instructions?

A few additional questions:

  • What iOS version are you compiling for?
  • What device are you compiling for?
  • Are you running the tests on a simulator or physical device?

@pantaopt
Copy link
Author

@gabriellanata
image
As screenshot,

  1. Setup according to the setup instructions.
  2. Xcode's version is 12.5
  3. iOS Deployment Target
    image
  4. This issue occurs on simulator. Simulator info:
    image
  5. This issue occurs on physical device. My device is iPhoneX(iOS 14.6)

@pantaopt
Copy link
Author

My macos version is:
image

@gabriellanata
Copy link
Contributor

Sorry I'm not sure what could be causing it. I've ran the included hammer tests on device and they worked fine. Had to apply these changes (#21) but they should not be affecting the error you're having

@gabriellanata
Copy link
Contributor

Do you mind testing by removing the guard statement here? https://github.com/lyft/Hammer/blob/main/Sources/Hammer/EventGenerator/EventGenerator.swift#L155 I'm thinking maybe it's unnecessary and getting 0 is fine

@pantaopt
Copy link
Author

@gabriellanata
Sorry to reply now, I tried your suggestion and it works, thank you very much.

@gabriellanata gabriellanata linked a pull request Aug 2, 2021 that will close this issue
@gabriellanata gabriellanata added this to the v0.13.0 milestone Aug 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working waiting Waiting for OP
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants