# Intercept and edit HTTP traffic from (almost) any Android app

DevFeed: [Intercept and edit HTTP traffic from (almost) any Android app](<https://devfeed.tech/articles/intercept-and-edit-http-traffic-from-almost-any-android-app-19076.md>)

Original publisher: [Read original article](<https://httptoolkit.com/blog/inspect-any-android-apps-http/>)

Author: HTTP Toolkit; Tim Perry

Published: 2021-03-24T17:00:00Z

Content type: tutorial

Language: en

Sources: [HTTP Toolkit](<https://devfeed.tech/sources/http-toolkit.md>)

Topics: [Android](<https://devfeed.tech/topics/android.md>), [Tool](<https://devfeed.tech/topics/tool.md>), [Developer Tools](<https://devfeed.tech/topics/developer-tools.md>), [Android Studio](<https://devfeed.tech/topics/android-studio.md>), [APK](<https://devfeed.tech/topics/apk.md>), [adb](<https://devfeed.tech/topics/adb.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [android-open-source-project](<https://devfeed.tech/tags/android-open-source-project.md>), [app](<https://devfeed.tech/tags/app.md>), [architecture](<https://devfeed.tech/tags/architecture.md>), [arm64](<https://devfeed.tech/tags/arm64.md>), [capture](<https://devfeed.tech/tags/capture.md>), [certificates](<https://devfeed.tech/tags/certificates.md>), [debug](<https://devfeed.tech/tags/debug.md>), [developer-tools](<https://devfeed.tech/tags/developer-tools.md>), [emulator](<https://devfeed.tech/tags/emulator.md>), [google-play](<https://devfeed.tech/tags/google-play.md>), [http](<https://devfeed.tech/tags/http.md>), [https](<https://devfeed.tech/tags/https.md>), [install](<https://devfeed.tech/tags/install.md>), [interception](<https://devfeed.tech/tags/interception.md>), [performance](<https://devfeed.tech/tags/performance.md>), [pixel](<https://devfeed.tech/tags/pixel.md>), [project](<https://devfeed.tech/tags/project.md>), [proxy](<https://devfeed.tech/tags/proxy.md>), [sdk](<https://devfeed.tech/tags/sdk.md>), [traffic](<https://devfeed.tech/tags/traffic.md>)

## AI overview

Android apps commonly use HTTPS and usually do not trust user-installed certificates, which blocks ordinary proxy inspection without rebuilding the app or using a rooted device. The excerpt describes an alternative: install an official app package in a standard Android emulator, then use a tool such as HTTP Toolkit to capture traffic for most apps and edit responses. It recommends an AVD with an architecture-matched image, a recent stable Android version (Android 7-13 is described as suitable), and a Google APIs or AOSP target; Google Play images have extra restrictions. Apps can be installed manually from APKs or XAPKs, but the excerpt cuts off during the installation instructions, so it does not provide the complete procedure.

## Source excerpt

HTTP is used by almost all Android apps to request data, load content, and send changes to backend servers. If you can see and edit these requests & responses then you can understand, debug, and change how any app works, but Android makes this hard to do. By default, almost all apps will use HTTPS but won't trust user-installed certificates. This means that you can't see their traffic with simple proxy tools, and you can't manually trust HTTPS debugging proxies without either editing and rebuilding the entire app, or setting up your own rooted device. Fortunately, there's a quick & easy way around this: you can manually install official APKs into a normal Android emulator, which provides enough access that tools like HTTP Toolkit can capture all traffic for most apps for you totally automatically, and allow you to edit responses in just a couple of clicks. Let's walk through how to do that, step-by-step: Setting up the emulator To get started, you'll need an emulator. It is possible to create and start one using the Android SDK directly (see this article) but it's easiest to just install Android Studio, create an empty project, and use the developer tools provided there (if you're not familiar with these developer tools at all, there's an detailed official guide). To create an interceptable Android emulator, you should create an AVD, that: Can be any device model, though things may be smoother with a popular device like a Pixel 4. Uses an image matching your computer's architecture (ARM64 on M1/M2 Macs, x86_64 on most other computers) since the performance will be far better. Uses a relatively recent stable Android version - Android 7 to 13 should be fine. Uses a 'Google APIs' or 'Android Open Source Project' target image. The 'Google Play' target includes extra restrictions and is not easily interceptable. Once you've created your emulator, start it, and then we need to install the target app. Since we don't have Google Play, you can't do that from the normal app s