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

Reimplemented SimulatorLogPlugin to use log stream #1428

Merged

Conversation

noomorph
Copy link
Collaborator

@noomorph noomorph commented Jun 4, 2019

Description:

The existing SimulatorLogPlugin implementation appears to be not informative (does not include various NSLog messages, etc) and hacky (relies on tailing two temporary files which contain piped output from a simulator launched in a special way).

The suggested reimplementation is based on two extra commands:

/usr/bin/xcrun simctl spawn ${udid} log stream --level debug --style compact --predicate '${predicate}

, where the predicate is built via:

/usr/bin/xcrun simctl get_app_container ${udid} ${bundleId}

and looks like:

processImagePath beginsWith "${appContainer}"

Ultimately, the plugin now is able to produce logs like these:

2019-06-04 14:01:49.918 E  example[59318:22c78e] [com.wix.Detox:DetoxManager] Web socket failed to connect with error: Error Domain=NSPOSIXErrorDomain Code=61 "Connection refused" UserInfo={_kCFStreamErrorCodeKey=61, _kCFStreamErrorDomainKey=1}
2019-06-04 14:01:49.917 Df example[59318:22c7d0] [com.apple.network:] [C2 localhost:51820 tcp, legacy-socket] cancel
2019-06-04 14:01:49.920 Df example[59318:22c7d0] [com.apple.network:] [C2 localhost:51820 tcp, legacy-socket] cancelled

That should be helpful in troubleshooting various issues, including the one that blocks us from merging dinstruments-demoapp branch to master.

@noomorph noomorph requested review from rotemmiz and LeoNatan June 4, 2019 11:11
@LeoNatan
Copy link
Contributor

LeoNatan commented Jun 4, 2019

Amazing!

@LeoNatan LeoNatan changed the title feat(artifacts): reimplemented SimulatorLogPlugin Reimplemented SimulatorLogPlugin to use log stream Jun 4, 2019
@LeoNatan LeoNatan merged commit f7d08f5 into master Jun 4, 2019
@LeoNatan LeoNatan deleted the noomorph/artifacts/alternative-simulator-log-plugin-2 branch June 4, 2019 13:15
@lock lock bot locked as resolved and limited conversation to collaborators Jun 7, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants