What is it?
Just like your desktop web browser has a Network Devtool panel that lets you have granular control over your Network requests. Requestly offers a similar debugging experience for Android Emulators.
The Android Emulator Network Debugger
in Requestly, you can simulate different network conditions, tweak requests on the fly, and share the results easily—essentially providing a powerful extension to your development toolkit.
Why Requestly?
-
All parts of network requests can be intercepted and modified using Requestly.
-
One Click Setup
-
Save and Share Network Sessions with others
Demo
.
How to Setup?
For more manual setup guide and troubleshooting, follow the steps here
0. Prerequisites
- Download the Requestly Desktop app, if you haven’t already.
- Start your Android App on the emulator.
1. Setup Proxy & Certificates
**Works only with Requestly Desktop App **
>v1.7.0
- Click
Connect Apps
- Go to
Mobile Apps & Browsers
tab.
- Click on
Connect
button of emulator you want to connect to.
2. [if-required] SSL Pinning
Only required on Android API level >= 23 (Android 7+).
Make sure to remove these in production builds
Add these configs to your app codebase for it to work
- Add res/xml/network_security_config.xml
<network-security-config>
<debug-overrides>
<trust-anchors>
<certificates src="user" />
<certificates src="system" />
</trust-anchors>
</debug-overrides>
<base-config cleartextTrafficPermitted="true">
<trust-anchors>
<certificates src="system" />
<certificates src="user" />
</trust-anchors>
</base-config>
</network-security-config>
- Add to AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest ... >
<application android:networkSecurityConfig="@xml/network_security_config" ... >
...
</application>
</manifest>
3. Deactivate Proxy (After done debugging)
Please make sure to revert the proxy after you are done debugging the emulator
OR
Run this command in Android Studio Terminal
adb shell settings put global http_proxy :0
What's Next?
-
Inspect the requests which are fired from your app.
-
Try different types of Modifications which Requestly Network Debugger can perform.
-
Share your Network Session with your teammates