Skip to main content
🚀 Self Healing AI Agent now live in App Automate! Auto-fix flaky tests instantly with zero code changes. Enable now!
No Result Found
Connect and get help from 7,000+ developers on our Discord community. Ask the CommunityAsk the Community

Set up Charles Proxy with App Automate

Capture network logs between BrowserStack devices and your app under test during Appium tests by routing traffic through a Charles Proxy server.

Charles Proxy is an HTTPS proxy that provides a plain text view of the communication between your app and the SSL web server. Use Charles Proxy to capture network logs for iOS and Android devices while you run your Appium tests on BrowserStack App Automate.

You can capture traffic between BrowserStack devices and the app under test with a Charles Proxy server, and debug using the captured logs.

We recommend this configuration if you decide to enable Charles Proxy in your test setup.

Set up Charles Proxy with BrowserStack

To get Charles Proxy working with App Automate:

Set up Charles Proxy

  1. Open the Charles Proxy app.
  2. Click Help > SSL Proxying, and then click Install Charles Root Certificate.
  3. In the Keychain Access dialog box, search for charles, and double-click the Charles Proxy CA certificate that appears.
  4. Expand the Trust section, ensure all options are set to Always Trust, and close the dialog box.

The Charles Proxy CA certificate with all Trust options set to Always Trust in the Keychain Access dialog box.

  1. Click Settings > Proxy Settings and note the port number that appears.
  2. In the Charles app, click Proxy > SSL Proxying Settings.
  3. Under the SSL Proxying tab, select the Enable SSL Proxying option.
  4. Under the SSL Proxying tab, add and select your app-specific location. Clear all other location entries.

The SSL Proxying tab with Enable SSL Proxying selected and an app-specific location added.

Add proxy details to Local

App Automate routes your app traffic through Charles Proxy over a BrowserStack Local connection. Configure the proxy details using the Local binary:

  1. Download the BrowserStackLocal binary.
  2. Open your command line and run the following command:
     <BrowserStackLocal binary path> --key <your access key> --local-proxy-host localhost --local-proxy-port <charles_proxy_port> --force-proxy --force-local
    

    Ensure that you replace charles_proxy_port with the port value that was set when you configured Charles.

Start an App Automate session

An App Automate session is an Appium test run on BrowserStack. If you haven’t set up your tests yet, see Get started with Appium to run a sample build or integrate your existing test suite, and Upload and manage apps to make your app available to your tests. Then enable Local and network logs so that your session routes traffic through Charles and captures the logs:

  1. Enable BrowserStack Local in your test configuration by setting browserstackLocal to true, or the browserstack.local capability to true for non-SDK setups, so that the session uses the Local connection you started in the previous step. For detailed setup instructions, see Test in local environments.
  2. Enable network logs by setting networkLogs to true, or the browserstack.networkLogs capability to true for non-SDK setups. For detailed setup instructions, see View network logs for Appium tests.
  3. Run your Appium test on App Automate.

After the test sends a request, check the Charles app for the captured logs.

We're sorry to hear that. Please share your feedback so we can do better

Contact our Support team for immediate help while we work on improving our docs.

We're continuously improving our docs. We'd love to know what you liked





Thank you for your valuable feedback

Is this page helping you?

Yes
No

We're sorry to hear that. Please share your feedback so we can do better

Contact our Support team for immediate help while we work on improving our docs.

We're continuously improving our docs. We'd love to know what you liked





Thank you for your valuable feedback!

Talk to an Expert
Download Copy Check Circle