AvdLee / RocketSimApp

Enhancing the iOS simulator for productivity
611 stars 20 forks source link

Display HTTP traffic (API requests) #179

Closed grennis closed 3 months ago

grennis commented 2 years ago

Is your feature request related to a problem? Please describe. It's helpful to monitor network traffic of an app in development.

Describe the solution you'd like A lightweight HTTP monitor for just the app I'm debugging with json request/response would be great. If it just magically worked like other features, that would be awesome.

Describe alternatives you've considered There is proxyman to display network traffic (API requests) but it's a pretty heavyweight general purpose tool that does too much and shows me too much. I've also used other tools like flipper but those require modifying the app.

Additional context None

AvdLee commented 2 years ago

Yeah, the question is whether we can build this in w/o the need for an in-app dependency. I'm expecting this to be to far off from what RocketSim is doing today, so I don't expect to implement this soon. Yet, I do like the idea, so I'll keep it open for future reference to revisit if possible.

AvdLee commented 1 year ago

We could learn from this: https://stackoverflow.com/questions/64490125/ios-packet-tunnel-provider-with-local-on-device-server/64570110#64570110

Otherwise, we should look into injecting binaries into the Simulator:

sslash commented 4 months ago

I would love this as well! šŸ™Œ

AvdLee commented 3 months ago

This is now available in 12.11.0: https://docs.rocketsim.app/features/hzQMSrSga7BGWvxdNVdwYs/network-monitoring/guS2qEK2RWWc3coihRQXZT

image

AvdLee commented 3 months ago

@sslash @grennis I'd love to get your feedback on this feature and whether it fulfills your needs!

grennis commented 3 months ago

@sslash @grennis I'd love to get your feedback on this feature and whether it fulfills your needs!

Very cool, will try it out this weekend. Thanks!

grennis commented 3 months ago

@AvdLee The first time I hooked it up, it worked nicely. Then I tried later and it was consistently crashing with exception below. I doubt the error message is correct, I'm just running iOS 17.5. I sent details to your email:

"Thread 10: Fatal error: Could not get data from _swizzleURLSessionDataTaskDidReceiveData. It might causes due to the latest iOS changes. Please contact the author!"

UnknownCoder807 commented 3 months ago

@AvdLee The first time I hooked it up, it worked nicely. Then I tried later and it was consistently crashing with exception below. I doubt the error message is correct, I'm just running iOS 17.5. I sent details to your email:

"Thread 10: Fatal error: Could not get data from _swizzleURLSessionDataTaskDidReceiveData. It might causes due to the latest iOS changes. Please contact the author!"

Getting the same.

AvdLee commented 3 months ago

@grennis @UnknownCoder807 did you change anything in terms of target device to get this crash? E.g. build on a device or a different Simulator?

UnknownCoder807 commented 3 months ago

@grennis @UnknownCoder807 did you change anything in terms of target device to get this crash? E.g. build on a device or a different Simulator?

For me, I just installed the upgrade to rocketsim. Added the code as told in the instructions and it gave me this error when I tried to run in the simulator. Iā€™m using Xcode 15.3 and iPhone 15 pro max 17.4 simulator.

grennis commented 3 months ago

For me, I just installed the upgrade to rocketsim. Added the code as told in the instructions and it gave me this error when I tried to run in the simulator. Iā€™m using Xcode 15.3 and iPhone 15 pro max 17.4 simulator.

Yeah, same here. I am actually not able to get it to work anymore, it always throws that exception. Not sure what changed but I didn't switch simulators or try on a real device.

qeude commented 3 months ago

Same here with Xcode 15.4, iPhone 15 Pro 17.5 I don't know if it can help but here are some more information:

I hope it can help šŸ™

AvdLee commented 3 months ago

Thanks a lot for reporting in all. 12.11.1 at least no longer throws an assertion, but logs a warning in the console instead. I've opened https://github.com/AvdLee/RocketSimApp/issues/538 to dive deeper into this!