This article describes how use Fiddler Everywhere to capture and inspect traffic that comes from Android devices and emulators.
To capture and inspect traffic on Android devices, perform the following steps:
- Provide the prerequisites.
- Configure Fiddler Everywhere.
- Configure the Android device.
- Inspect the browser traffic.
- Inspect the Android application traffic.
- Install Fiddler Everywhere v. 1.0.0 and above.
- Install Android.
- Make sure that the machine on which Fiddler Everywhere and the Android device run is discoverable on the same network—for example, 192.168.0.0.
Enable the remote connections in Fiddler Everywhere through Settings > Connections > Allow remote computers to connect.
Check the IP address of the machine where Fiddler Everywhere is running. To obtain the IP address, for example, ipconfig on Windows or ifconfig on Linux, you can use the built-in OS tools or the Fiddler Everywhere connection status icon on the lower right-hand side of the client. For demonstration purposes, let's assume that the local IP of the Fiddler Everywhere machine is 192.168.0.101.
Depending on the environment, an Android emulator might not support ICMP, which is used for "ping".
The following steps are applicable for real devices and emulators (also known as AVDs) with some minor differences as described below.
Check the IP address of the Android device.
Open the connected Wi-Fi and tap Settings.
Expand Advanced Settings.
(Real devices only) Check the IP address of the actual Android device. For demonstration purposes, let's assume the device IP is 192.168.0.222.
(Android emulators only) Check the IP address of the emulator. In most cases, the IP of the Android emulator is of the 10.0.2.XXX type. For the GenyMotion emulator, the default IP is of the 10.0.3.XXX type.
Modify the proxy of the Android device.
Open the connected Wi-Fi and tap Settings.
Select Edit and expand Advanced Settings. For previous Android versions you might have to touch and hold the name of the connected network, then tap Modify, and expand Advanced Settings.
On Proxy, select Manual proxy.
(Real devices only) Enter the IP address of the computer on which Fiddler Everywhere runs—for example, 192.168.0.101.
(Android emulators only) Enter the IP address of the emulator gateway. In most cases, the IP of the Android emulator gateway is 10.0.2.
- For the GenyMotion emulator, the default gateway IP is 10.0.3.2.
Enter the proxy port. Use the port configured in the Fiddler Everywhere client. The default port is 8866. To change it, go to the Fiddler Everywhere connections settings).
Install the root certificate of Fiddler Everywhere on the Android device.
Open a browser on the Android device and type the http://ipv4.fiddler:8866 echo service address of Fiddler Everywhere.
Tap the option to download the certificate.
In the prompt window, enter a certificate name and tap Save.
Install the downloaded Fiddler certificate in the device certificate storage. The settings location depends on the Android version but is usually located under Settings_ > Security > Encryption and Credentials > Install a certificate.
Now you can immediately monitor HTTP/HTTPS traffic from mobile browsers. For example, open a Chrome browser on your Android device, type an address of your choice, and observe the captured traffic in the Live Traffic section of Fiddler Everywhere.
Once you’re done debugging, remove the Wi-Fi proxy from your Android device.
You can monitor traffic from applications that are in active development, which means that you have access to the codebase of that application.
For Android API 24 and above, add the following code to the
<?xml version="1.0" encoding="utf-8"?> <network-security-config> <base-config> <trust-anchors> <!-- Trust preinstalled CAs --> <certificates src="system" /> <!-- HERE: Additionaly trus user added CAs --> <certificates src="user"/> </trust-anchors> </base-config> </network-security-config>
AndroidManifest.xml_file, reference the
network-security-configfrom the previous step through a parameter in the
<application android:name="com.tns.NativeScriptApplication" android:allowBackup="true" android:icon="@drawable/icon" android:networkSecurityConfig="@xml/network_security_config"> ...
Rebuild the application. Now you can start monitoring its HTTP/HTTPS traffic.
For more information on debugging mobile applications with Fiddler Everywhere, check out the webinar on mobile app debugging.