Charles is a proxy server that enables us to view the networking traffic between the app and the internet.
In Quick guide on Charles Proxy for iOS development, we already looked at the features Charles has to offer and how to use them.
In this article, we are going to dive more deeper and look at the Charles breakpoints tool. It lets us intercept and manipulate requests and responses before they are passed through Charles.
Being able to manipulate response data is a great way to test how the app handles unexpected values. Let’s get started.
Setting up a breakpoint
Each breakpoint in Charles matches a URL using location matching patterns and is also assigned to either the request, the response or both.
The simplest way to enable a breakpoint is by selecting the URL and then clicking the breakpoint button in the top toolbar.
For more control, open Proxy -> Breakpoint Settings in the menu. Here, we see an overview of all the breakpoints that are set, can edit, remove them or add new ones.
When editing or adding a breakpoint, we are able to configure details like protocol, host, port, path patterns or wildcards. Here, we can also select whether the breakpoint should be assigned to the request, the response or both.
Editing request and response data
When a request hits a breakpoint, the breakpoints window automatically opens in Charles we can view and edit the data.
The same happens when a response hits a breakpoint.
After editing, we can use different action buttons on how Charles should proceed with the request or response. The following actions are available:
- Execute: Applies any changes we made and lets the request or response proceed.
- Abort: Blocks the request or response and sends an error message to the client.
- Cancel: Discards any changes we made and lets the request or response proceed as originally received.
Charles breakpoint tool is an easy to use and powerful way to debug our applications.
Charles offers even more advanced tools like repeating, automatic rewrites, map local, map remote, cache, cookies control and more. Check out their official tools documentation to check those out.
Mobile App Development Trends – 20.02
From Fragile to Agile, Same App 15 Times, How to be a -10x Engineer and more!
Google is testing the use of AI in Play Store
Most of the information posted in the App Highlights section is about the app's features.
Figma Preview – Add Figma design to your Xcode Preview
Figma Preview is a Swift library designed to streamline the integration of Figma designs into your Xcode Preview. It allows...
Mobile App Development Trends – 19.02
Rock Paper Scissor, Android 15 Developer Preview, Event-Driven Architecture and more!
Apple is preparing AI tools for Xcode
Apple's goal is to release new AI features in Xcode as early as the end of this year.
Google has released the first developer preview of Android 15
The Developer Preview has everything you need to try the Android 15 features, test your apps, and give us feedback.