Proxyman icon indicating copy to clipboard operation
Proxyman copied to clipboard

Traffic from Android Emulator not showing

Open wabiloo opened this issue 6 months ago • 6 comments

Description

I've used the automatic script to install the Proxyman certificate on my Android Emulator (Android Studio). It seemed to work, and when I start testing my app (Android TV app), I do see the call coming through.

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📱 Install Proxyman Certificate to Android Emulator/Device Script
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

⚠️  Important Notes:
   • Only supports Android Emulators with Google APIs
   • DO NOT support Google Play Store version

📚 Documentation:
   https://docs.proxyman.com/debug-devices/android-device/automatic-script-for-android-emulator
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

⚙️  Settings:
   Mode                : all
   IP Address          : 192.168.1.253
   Port                : 9090
   Certificate Path    : /Users/fabrelambeau/Library/Application Support/com.proxyman.NSProxy/app-data/proxyman-ca.pem
   Include Physical Dev: false

Checking adb command...
✅ ADB found at: /Users/fabrelambeau/Library/Android/sdk/platform-tools/adb
1. Checking Android Emulators Status...
✅ Status: Device Ready
2. Configuring HTTP Proxy...
   Target: Proxyman (192.168.1.253:9090)

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🤖 Processing Emulator Device: emulator-5554
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✅ Proxy configured successfully for Emulator Device emulator-5554

3. Installing Proxyman Certificate to System-Level CA...

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🤖 Processing Emulator Device: emulator-5554
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
/Users/fabrelambeau/Library/Applicatio...ipped. 9.4 MB/s (1980 bytes in 0.000s)
/system/bin/sh: su: inaccessible or not found
/system/bin/sh: su: inaccessible or not found
/system/bin/sh: su: inaccessible or not found
✅ Certificate injection completed for Emulator Device emulator-5554

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✅ Installation Complete!
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

📝 Next Steps:
   1. Restart your app from Android Studio
   2. Enjoy Proxyman!

However Proxyman is showing error code 999.

Image

I'm not sure whether the issue with su above is important?...

Part of the issue is that Android TV does not seem to expose System settings so that I can see whether the certificate was correctly installed.

Environment

  • App version: 5.19.0
  • macOS version: macOS Sequoia

wabiloo avatar May 12 '25 10:05 wabiloo

I'm not sure whether the issue with su above is important?...

No, it's not. It just tried a few command lines, and the last one was successful

Part of the issue is that Android TV does not seem to expose System settings so that I can see whether the certificate was correctly installed.

I haven't tested with any Android TV Emulator.

What TV Android Emulator version are you using? Is it a non-Play Store version?

NghiaTranUIT avatar May 12 '25 12:05 NghiaTranUIT

Not entirely sure (I'm not super-familiar with this). I don't know if the following screenshot helps?

Image

wabiloo avatar May 12 '25 14:05 wabiloo

Having the same issue on Android TV simulators. I do see all calls coming through, but can't manage to make the certificate work.. always getting SSL handshake errors.

alarochelle avatar May 22 '25 14:05 alarochelle

@alarochelle may I ask if Proxyman can intercept your Android app on Android Emulator? but it doesn't work with TV Emulators, right?

and what TV Emulator version you're using on Android Sutdio?

NghiaTranUIT avatar May 23 '25 01:05 NghiaTranUIT

@alarochelle may I ask if Proxyman can intercept your Android app on Android Emulator? but it doesn't work with TV Emulators, right?

and what TV Emulator version you're using on Android Sutdio?

Yes, it does work properly on an Android app on Android emulator, tried on a Pixel 6 API 34 (Android 14.0 | arm64).

TV Emulator I'm using is these, I tried both (API 34 Android TV and Google TV, Google APIs):

Image

alarochelle avatar May 23 '25 10:05 alarochelle

Tried, but I can't make it works. It seems Proxyman scripts don't work on Emulator TV because it has a different certificate store path.

NghiaTranUIT avatar May 23 '25 14:05 NghiaTranUIT

Unable to make it work on Emulator Pixel_9_Pro_XL using Android version 16

SAGARSURI avatar Jun 25 '25 08:06 SAGARSURI

@SAGARSURI, what error did you get from your Android 16?

NghiaTranUIT avatar Jun 25 '25 09:06 NghiaTranUIT

No API request happening.

SAGARSURI avatar Jun 25 '25 09:06 SAGARSURI

Image

Android Emulator Pixel 9 Pro XL is a Google Play store version. Proxyman Automatic Script for Android Emulator can't work with this device.

You should create new Emulator that isn't a Google Play Store. It will work

NghiaTranUIT avatar Jun 25 '25 09:06 NghiaTranUIT

Ops! My bad. Let me try it again.

SAGARSURI avatar Jun 25 '25 09:06 SAGARSURI

@SAGARSURI Did it work? I tried both Google APIs and Google Play Store. It doesn't work for me. Pixel 9 API 36

JustKhit avatar Sep 19 '25 19:09 JustKhit

@JustKhit is your app a native Android (Kotlin or Java), or React Native or Flutter?

NghiaTranUIT avatar Sep 19 '25 19:09 NghiaTranUIT

FYI, this beta build https://github.com/ProxymanApp/Proxyman/issues/2479#issuecomment-3313336595 will make it clear that it's a Google Play Store Android Emulator version.

NghiaTranUIT avatar Sep 19 '25 19:09 NghiaTranUIT

@JustKhit is your app a native Android (Kotlin or Java), or React Native or Flutter?

Hi, it's a native app running on android emulator.

JustKhit avatar Sep 19 '25 19:09 JustKhit

no, I mean the Android app that you need to capture HTTPS traffic on your Emulators.

Here is the demo that we've made today: https://www.youtube.com/watch?v=CWInB7gZj6g

NghiaTranUIT avatar Sep 19 '25 19:09 NghiaTranUIT

no, I mean the Android app that you need to capture HTTPS traffic on your Emulators.

Here is the demo that we've made today: https://www.youtube.com/watch?v=CWInB7gZj6g

Sorry. Updated. It's a native app.

JustKhit avatar Sep 19 '25 19:09 JustKhit

ok, Pixel 9 Google Store Emulator it's a problem. It's Google Play version.

Please create Pixel 6 with Google APIs, it will work. Google Play Store/Play version is locked, and it's not possible to run the script

Image

NghiaTranUIT avatar Sep 19 '25 19:09 NghiaTranUIT

I re-installed Proxyman and create a new emulator, Pixel 9 Pro API 36.1 Google APIs. I couldn't make a network request in the app.

Everything seems setting up properly Image

Screenshot from terminal script installation. Image

Making a request in the app, simple login request. Image

JustKhit avatar Sep 19 '25 19:09 JustKhit

ok, Pixel 9 Google Store Emulator it's a problem. It's Google Play version.

Please create Pixel 6 with Google APIs, it will work. Google Play Store/Play version is locked, and it's not possible to run the script

Image

Does it have to be Pixel 6? I think I've been using Pixel 9 and it was working fine.

JustKhit avatar Sep 19 '25 19:09 JustKhit

Pixel 9 with Google APIs 36 is fine too. I tested it.

if the script is successful, can you open this Emulators -> Settings -> Security & Privacy -> More Security -> Encryption & Credential -> Trust Cridential -> System Tab -> Verify if you can see Proxyman LLC is ON here?

Image


Your error mean the app rejects Proxyman certificate.

NghiaTranUIT avatar Sep 19 '25 19:09 NghiaTranUIT

Image

@NghiaTranUIT Yes. It does.

JustKhit avatar Sep 19 '25 20:09 JustKhit

okay, so everything is set up correctly. The last issue is your app. For some reason, your app rejects the Proxyman certificate, so you get an SSL Error.

You can test it by opening Google Chrome on your emulator -> Visit www.google.com

and you will see this HTTPS data on Proxyman.

Image

Maybe your app has some logic to reject self-signed certificate. Please find it and disable it.

Or you can share with me what network library you're using? is it okhttp?

NghiaTranUIT avatar Sep 19 '25 20:09 NghiaTranUIT

That's right. Accessing google.com is fine. It's probably some configurations on my app.

The app is using Retrofit and Okhttp for networking, and it does have network security config setup. Image

The network request was working again after I Revert All Changes in Proxyman -> Certificate -> Install Certificate on Android -> Emulators... then stopped working again after I Override All Emulators.

For more info

  • Android Studio Narwhal 3 Feature Drop | 2025.1.3 built on Augugest 27, 2025
  • macOS Tahoe 26.0

Thanks for looking in to the issue.

JustKhit avatar Sep 19 '25 20:09 JustKhit

@JustKhit can you follow the 5th step to set up your xml file like this screenshot? https://docs.proxyman.com/debug-devices/android-device

Image

NghiaTranUIT avatar Sep 20 '25 05:09 NghiaTranUIT

@NghiaTranUIT Sure. I'll try that early next week and will let you know.

JustKhit avatar Sep 21 '25 00:09 JustKhit

@JustKhit I found your issue: You have turst-anchor settings, so it only accepts these certificates. Otherwise, you will get SSL Errors.

Image

To fix it, just remove these settings

NghiaTranUIT avatar Sep 22 '25 13:09 NghiaTranUIT

@JustKhit I found your issue: You have turst-anchor settings, so it only accepts these certificates. Otherwise, you will get SSL Errors.

Image To fix it, just remove these settings

You're right. It works after removing them out. Thinking about removing them from my app production too. Thanks @NghiaTranUIT !

JustKhit avatar Sep 22 '25 15:09 JustKhit

Glad to know it works for you ❤️

NghiaTranUIT avatar Sep 22 '25 17:09 NghiaTranUIT