There are two very detailed tutorials that you can refer to
Charles from Beginner to Mastery
Use Charles grab packet HTTPS request in MAC Environment
But when using the iphone to crawl HTTPS data, there are a lot of problems, always prompted to fail.
Note that you should be aware of:
1) iphone Installation certificate
Restricted to ensure that the iphone is connected to Charles, access Http://charlesproxy.com/getssl in the mobile browser so that the certificate can be installed successfully.
2) The IPhone iOS 10.3 later version needs to be set up as follows:
Settings, general-purpose certificate trust settings for this machine, and then click the button to select.
3) Charles's SSL proxying setting, select Enable SSL proxying, you can add host:*,port:443, so the default all https will be through the Charles Proxy, You can also select a specific domain name to set the specified domain name through the Charles Proxy.
Mac configures Charles to crawl mobile device data