FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

feat(cli): add --device flag to pn logs by crux200 · Pull Request #67 · pythonnative/pythonnative · GitHub

feat(cli): add --device flag to pn logs - #67

Merged
owenthcarey merged 2 commits into
pythonnative:mainfrom
crux200:feat/logs-device-flag
Sep 3, 2026
Merged

owenthcarey merged 2 commits into
pythonnative:mainfrom
crux200:feat/logs-device-flag

Conversation

crux200 commented Sep 2, 2026

Copy link
Copy Markdown
Contributor
  • Add --device/-d to the logs subparser, resolving the same way pn run does via _resolve_device.
  • Android: set ANDROID_SERIAL from the resolved device so adb/logcat target it for the whole stream.
  • iOS: thread the resolved UDID into _start_ios_log_stream instead of always falling back to the booted simulator. Physical iOS devices print the existing Console.app guidance and exit, matching how pn logs already behaves without --device.
  • Add CLI tests covering the Android ANDROID_SERIAL path, the iOS UDID threading (both resolved and no-device/booted-fallback cases), the physical-device rejection, a bad --device query, and that --device is actually wired through argparse.
  • Document the new flag in docs/api/cli.md.

Fixes #38

crux200 and others added 2 commits September 2, 2026 09:41
- Add --device/-d to the logs subparser, resolving the same way
  pn run does via _resolve_device.
- Android: set ANDROID_SERIAL from the resolved device so adb/logcat
  target it for the whole stream.
- iOS: thread the resolved UDID into _start_ios_log_stream instead of
  always falling back to the booted simulator. Physical iOS devices
  print the existing Console.app guidance and exit, matching how
  pn logs already behaves without --device.
- Add CLI tests covering the Android ANDROID_SERIAL path, the iOS UDID
  threading (both resolved and no-device/booted-fallback cases), the
  physical-device rejection, a bad --device query, and that --device
  is actually wired through argparse.
- Document the new flag in docs/api/cli.md.

Fixes pythonnative#38
- Print the physical-device pointer again when no simulator is booted,
  not only when --device names a physical device, so the pre-existing
  behavior of plain `pn logs ios` is unchanged.
- Add a regression test for that path.
- Pop ANDROID_SERIAL in the Android --device test so the value exported
  by the command doesn't leak into the rest of the pytest session.
- Drop an unused tmp_path fixture parameter.
- Mention [--device D] in the module docstring and reword the CLI
  reference entry without an em dash.
owenthcarey merged commit 6d3a171 into pythonnative:main Sep 3, 2026
15 checks passed

Copy link
Copy Markdown
Contributor

Thank you so much!

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add a --device flag to pn logs

2 participants


Back | FazBrowse Home | New Git URL