Uncheck Combine request and response and press OK. However, you can split them into separate events.Ĭhoose Charles ▸ Preferences and select Viewers. You’ll likely spend most of your time on this screen when debugging your own apps.Ĭharles merges the request and response into a single screen by default. Select Sequence to see all events in a continuous list sorted by time. You can still see individual requests by expanding each individual site. With Structure selected, the top pane is replaced by a left-hand pane of the same data, grouped by site address. With Sequence selected, the top pane contains a summary of all the recorded network requests, while the main pane contains detailed information about the selected request. Under the toolbar is a toggle between Structure and Sequence. The last two buttons provide access to commonly used tools and settings.įor now, stop recording by clicking the red Record/Pause button.The middle buttons from the “Tortoise” to the “Checkmark” provide access to common actions, including throttling, breakpoints and request creation.“Record/Pause” is red when Charles is recording events and gray when stopped.“Broom” clears the current session and all recorded activity.Many goodies are hidden behind buttons and menus, and the toolbar has a few items you should know about: The user interface is easy to understand without much experience. See Charles’ FAQ page for troubleshooting help. Note: If you don’t see any events, you may have not granted permissions or may have another proxy already set up. Charles will only run for 30 minutes in trial mode, so you may need to restart it throughout this tutorial. Double-click the DMG file and drag the Charles icon to your Applications folder to install it.Ĭharles Proxy isn’t free, but there’s a free 30-day trial. Then, download the latest version of Charles Proxy for Mac (v4.6.1 at the time of writing). Simulating and troubleshooting slow networks.ĭownload the starter project by clicking the Download Materials button at the top or bottom of the tutorial.Proxies and how they work on macOS and iOS.In this tutorial, you’ll get hands-on experience with this. You configure your simulator or iOS device to pass all networking requests and responses through Charles Proxy, so you’ll be able to inspect and even change data midstream to test how your app responds. It’s even more difficult when you’re talking to other systems over a network.įortunately, Charles Proxy can make network debugging much easier.Ĭharles Proxy sits between your app and the internet. Let’s face it - we’ve all written code that doesn’t work correctly, and debugging can be hard. Update note: Irina Galata updated this tutorial for Xcode 12, Swift 5 and iOS 14.
0 Comments
Leave a Reply. |