<br />

On Android N or higher, ad calls are visible in Charles proxy only when the
following steps are performed:

1. Update Google Play services on the mobile device.
2. Enable network tracing on the mobile device.
3. Install Charles SSL certificate on your device, and set up proxy.
4. Enable SSL Proxy for your mobile app.

## Update Google Play services on the mobile device

For an emulator, if you don't see the Google Play section in the side menu,
you might need to update Android Studio. Download the latest system images in
**Virtual Device Configuration**, and use a system image with Google Play
in its target.

![](https://developers.google.com/static/admob/images/charles/Copy-of0.png)

Use the side menu to check and update Google Play services to the latest
version.

![](https://developers.google.com/static/admob/images/charles/Copy-of1.png)

For a physical mobile device (phone or tablet), you can search for Google
Play or follow this
[link](https://play.google.com/store/apps/details?id=com.google.android.gms)
to open Google Play directly.

## Enable network tracing on the mobile device

To turn on network tracing, enable
developer options on your device. For details, see
[Configure on-device developer options](https://developer.android.com/studio/debug/dev-options).

Open the Google Settings app and select **Google \> Ads \> Enable debug
logging for ads** . For details, see
[Network tracing](https://developers.google.com/ad-manager/mobile-ads-sdk/android/network-tracing.md.txt).

![](https://developers.google.com/static/admob/images/charles/Copy-of2.png)

## Install Charles SSL certificate on your device, and set up proxy

To use Charles as a proxy for your app, download and
[install Charles](https://www.charlesproxy.com/documentation/installation/) on your
computer.

To save the certificate as a `.pem` or `.cer` file, select
**Help \> SSL Proxying \> Save Charles Root Certificate** . To install the
certificate on your device, follow the prompts in **Help \> SSL Proxying**.

![](https://developers.google.com/static/admob/images/charles/Copy-of3.png)

If you use an
[Android emulator with a proxy](https://developer.android.com/studio/run/emulator-networking#proxy),
set the proxy address to `http://127.0.0.1`. Set the port to the value shown in
Charles from **Proxy \> Proxy Settings**.

If you use a physical device, connect the device to the same Wi-Fi network as
your computer. To set up the proxy, open your device's advanced network
settings. For details, see
[Connect to Wi-Fi networks on your Pixel phone](https://support.google.com/pixelphone/answer/2819519).
In Charles, select **Help \> Local IP Address** to find your IP address. On your
device, enter the IP address from Charles and the Charles port as the proxy.

## Enable SSL proxy for your mobile app

For Charles to intercept your mobile app's SSL traffic, declare
that your app can trust an SSL certificate. You can trust a user-installed
certificate or embed the Charles certificate as a raw resource in your app. For
example, you can save the certificate in your `res/raw/charles_cert.pem` file.

First, add a new XML resource file for
[Network Security Configuration](https://developer.android.com/training/articles/security-config)
in your `res/xml/network_security_config.xml` file:

```xml
<network-security-config>
   <debug-overrides>
       <trust-anchors>
           <!-- Trust Charles SSL certificate stored in res/raw -->
           <certificates src="@raw/charles_cert" />
           <!-- Trust user added CAs while debuggable only -->
           <certificates src="user" />
       </trust-anchors>
   </debug-overrides>
</network-security-config>
```

![](https://developers.google.com/static/admob/images/charles/Copy-of4.png)

Next, update the `AndroidManifest.xml` file to use the network security
configuration.

```xml
<?xml version="1.0" encoding="utf-8"?>
<manifest ... >
    <application ...
                 android:networkSecurityConfig="@xml/network_security_config"
                 ... >
        ...
    </application>
</manifest>
```

![](https://developers.google.com/static/admob/images/charles/Copy-of5.png)

After that, you can launch the mobile app and look for ad requests in the
Charles log.