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

WatchKit remote logging #200

Closed
ptxmac opened this issue Jun 13, 2023 · 8 comments
Closed

WatchKit remote logging #200

ptxmac opened this issue Jun 13, 2023 · 8 comments
Labels
bug Something isn't working

Comments

@ptxmac
Copy link
Contributor

ptxmac commented Jun 13, 2023

The configuration for remote logging currently exists in the UI for Apple Watch but doesn't work.

From what I could gather Pulse is using low-level networking to stream logs. Unfortunately, Apple Watch doesn't support this (with a few very specific exceptions). See TN3135

There doesn't seem to be any easy workaround, the only supported ways of doing networking on the watch is through HTTP or Watch Connectivity (i.e. communicating with a companion iOS app)

Since there's already a "Send to iPhone" feature, maybe some of that logic could be reused to make a logger that would stream to the iPhone and the iOS receiver could re-emit the logs on its store.

(Note: it does work in the simulator, but that's a bug)

@kean
Copy link
Owner

kean commented Jun 13, 2023

Unfortunately, Apple Watch doesn't support this (with a few very specific exceptions). See TN3135

That's a shame. I never tested it on a physical device, and, as you pointed out, it works in a simulator, so I left it there. It's worth keeping it only on a simulator and showing an error when running on a device.

Since there's already a "Send to iPhone" feature, maybe some of that logic could be reused to make a logger that would stream to the iPhone and the iOS receiver could re-emit the logs on its store.

That would be nice. I thought about making an iPhone your primary way to interact with the watchOS console. Still, it would've required significant time investment, and, as it looks like, barely anyone uses it on the watch – nobody raised this issue before.

There is a new "Open on Mac" feature in Pulse 14.0.0-beta.2 that allows you to quickly view individual messages or tasks on a Mac. I think it could be implemented relatively easily, and unlike streaming won't affect battery life, which is important to take into account.

@kean kean added the bug Something isn't working label Jun 13, 2023
@ptxmac
Copy link
Contributor Author

ptxmac commented Jun 13, 2023

The "Open on Mac" sounds interesting, but that still require the messages from the watch to somehow end up on the mac - there's no support for WCSession on MacOS, so the data needs to go through iOS first

@kean
Copy link
Owner

kean commented Jun 13, 2023

I was thinking "Open on iPhone" as a middle-ground solution. But I'm not sure what's the best API to implement it.

@ptxmac
Copy link
Contributor Author

ptxmac commented Jun 13, 2023

I guess that's very close to how the current "Send to iPhone" buttons work now? (minus #201)

Regarding API there are not a lot of options 😄 Basically WCSession is all there is

@kean
Copy link
Owner

kean commented Jun 13, 2023

By "Open on iPhone", I was referring to a feature where you to open individual tasks (quickly). But now that I'm thinking about it, it's probably not going to be as useful on watchOS. You kind of just want to get the logs off the device quickly.

I'm not sure I want to tackle streaming using WCSession 😅 But fixing WCSession support and adding ShareLink support (for sharing to Mac directly) is a must.

@ptxmac
Copy link
Contributor Author

ptxmac commented Jun 14, 2023

I'm not sure I want to tackle streaming using WCSession

Yeah, don't blame you, WCSession is frustrating to work with 😄
I might look into it if I end up using Pulse in my project (still evaluating it)

@kean
Copy link
Owner

kean commented Jun 15, 2023

That would be nice. I've built most of the infra needed for the watchOS version, but it is clearly in need of some contributors who use it on a daily basis.

@kean
Copy link
Owner

kean commented Jun 18, 2023

Fixed in 4.0.0-beta.3.

@kean kean closed this as completed Jun 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants