mirror of
https://github.com/ProxymanApp/Proxyman.git
synced 2026-04-26 00:25:56 +03:00
[GH-ISSUE #636] Android device/emulator hardly connects #634
Labels
No labels
Discussion
Feature request
In Progress...
Plugins
Waiting response
Windows
Windows
bug
duplicate
enhancement
feature
good first issue
iOS
macOS 10.11
question
wontfix
✅ Done
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/Proxyman#634
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @faisalmohd83 on GitHub (Sep 24, 2020).
Original GitHub issue: https://github.com/ProxymanApp/Proxyman/issues/636
Originally assigned to: @NghiaTranUIT on GitHub.
Proxyman version? 2.7.0
macOS Version? Catalina 10.15.6
Steps to reproduce
Expected behavior
Connect the device all the time.
@yauheniprakapenka commented on GitHub (Sep 24, 2020):
I have a proxy configured on my android device and it works through proxyman 2.7.0. I am having problems where requests from my test applications are not showing up in the proxy. The browser requests is displayed, but my applications requests are not displayed. I have no idea how to reproduce this. I just use it, and at some point they stop being displayed. Only complete removal of the proxymal name can help. And then requests disappear again. Unfortunately, I do not know how to suggest the steps of the playback. Therefore, I am not creating an issue.
@NghiaTranUIT commented on GitHub (Sep 24, 2020):
I have received few reports about Android emulator connection too, but really hard to reproduce.
I suppose that it’s from the Android emulator itself, because I always work fine with iOS simulator.
Can you guys try to delete entire android and create again? And if it happens with Android real device?
Meanwhile I will spend today to try to reproduce it 👍
@NghiaTranUIT commented on GitHub (Sep 24, 2020):
If you guys don’t mind, please try to use Android Emulator on other proxy tools like Charles, to see if it still persists or not 🧐
@NghiaTranUIT commented on GitHub (Sep 25, 2020):
@faisalmohd83 @yauheniprakapenka just wondering: What is the Android Emulator you're using? I use Pixel 3 Android Emulator API 29 from Android Studio, but I'm not able to reproduce the bug 🤔
@yauheniprakapenka commented on GitHub (Sep 25, 2020):
I am using only Android Device Xiaomi Redmi 9a android 10. This Saturday I will try to find how to reproduce the problem.
@faisalmohd83 commented on GitHub (Sep 25, 2020):
@NghiaTranUIT I doubt it's an issue with device/emulator.
I and team use a combination of emulators and physical devices with different OS versions for development/testing. In Android, works well once connected but disconnects in a while and it'll start complaining as connection lost. The only way to reconnect would be forgetting the connected WiFi and redo all the configuration(though not guaranteed). Whereas in iOS, the Proxyman works super smooth and our dev/test team uses it extensively.
--
The combination of emulators(all are GooglePlay images) used are followed and tried with many of it. Regardless of the device/emulator configuration, the behaviour is the same.
Eagerly looking forward to solving it, Would be happy to provide more info.
@NghiaTranUIT commented on GitHub (Sep 25, 2020):
Thanks for the detailed report @faisalmohd83. I would summarize that we have two different problems:
Read more at https://docs.proxyman.io/troubleshooting/my-ios-devices-couldnt-connect-to-proxyman-via-proxy
To investigate, I might change some configuration when starting a Proxy Server (Powered by SwiftNIO)
Currently, I'm using:
@NghiaTranUIT commented on GitHub (Sep 25, 2020):
Hey @faisalmohd83 , please help me to ON/OFF the option Use Android Studio HTTP Proxy Setting.
I assume that the Android Emulator has a bug. Sometime it follow the Android Studio HTTP Proxy or HTTP Proxy in Setting app, which might cause the connection lost.
I tried to set manual Proxy in Android Studio HTTP Proxy to Proxyman, but it always show the IP instead of the domain. It happens on Charles and Fiddler too
@NghiaTranUIT commented on GitHub (Sep 25, 2020):
Meanwhile, I notices that from Android API 30, install Proxyman CA Certificate requires extra steps to install it properly.
For instance, I have manually install in Security Tab in Setting app
I will update the document 👍
@faisalmohd83 commented on GitHub (Sep 25, 2020):
@NghiaTranUIT
Certificate downloading was an issue but found you answered it another thread and done it in Android 30 emulator.
Can you please also share the Mac DNS/Proxy/Firewall settings apart from emulator settings?
@NghiaTranUIT commented on GitHub (Sep 25, 2020):
Sure, I will update 👍 if you don’t mind, please help me test out with Android Studio HTTP Proxy setting in the previous comment.
@faisalmohd83 commented on GitHub (Sep 26, 2020):
@NghiaTranUIT
I tried with the above suggestions, had no luck!
In fact, all configuration was already in place except the
Resulting behaviour:
The device connected but the internet connection lost after a while.
@NghiaTranUIT commented on GitHub (Sep 26, 2020):
Hey @faisalmohd83 if you don’t mind, please help me test the Android issue with Charles Proxy app (it has a free version). If it doesn’t happen on Charles, it means something wrong with Proxyman and Android
@NghiaTranUIT commented on GitHub (Sep 27, 2020):
@faisalmohd83 @yauheniprakapenka it seems that Android Emulator has a problem. I search for "Android Emulator lost connection after a while" and there are tons of StackOverflow about it.
They often suggest setting DNS as 8.8.8.8 as a solution.
Please help me to check it out 👍
@yauheniprakapenka commented on GitHub (Sep 27, 2020):
I will add a new address 8.8.8.8 to macbook`s Wi-Fi settings and watching for correct works for a few days.
@yauheniprakapenka commented on GitHub (Sep 29, 2020):
Good day! :)
At the moment, with such settings, it works fine for me on physical device. I continue to watch.
@NghiaTranUIT commented on GitHub (Sep 29, 2020):
Hopefully, it works 🤣
@NghiaTranUIT commented on GitHub (Sep 29, 2020):
I've updated the Troubleshooting Page for Android: https://docs.proxyman.io/troubleshooting/my-ios-devices-couldnt-connect-to-proxyman-via-proxy#android-devices-and-android-emulator 👍
@ghowardqa commented on GitHub (Sep 29, 2020):
Evening guys
Hope you're well.
@faisalmohd83 has asked me to weigh in on the issue.
Massive fan of proxyman, I was a user of Charles before finding out about proxyman and haven't looked back!
I've always had issues with Android and any HTTP Proxy tool ever since Android has tightened their network security. So following the usual setup of adding the network_security_config.xml to the project and referencing it in the Android Manifest.xml works fine. Next, linking up the device or emulator to proxyman and installing the Root certificate and device certificate again goes smoothly.
Now, this where things start to happen, firstly attempt SSL handshake and then obviously making sure the endpoint is enabled for SSL HTTPS Response.
Next, attempted to forget the network connection and rejoin it network and attempt again. Now this sometimes works or as @faisalmohd83 pointed out a system alert is displayed of 'No Internet Connection' or within the device/emulator it'll say its connected but no internet connection.
So the physical device I'm using is a Samsung S10 running 10.0 (OneUI 2.)1 and the emulator is the standard AVD Google Pixel running OS 10.0
I'll also attempt the DNS server solution and report back. :)
@NghiaTranUIT commented on GitHub (Sep 30, 2020):
Glad to know that Proxyman have many massive fans 😄
I just discover that we can automatically install the self-signed certificate to Android Emulator by using ADB 😲 https://ivrodriguez.com/installing-self-signed-certificates-on-android/
I will attempt to add this automatic flow to Proxyman to make it easier 🙌
@faisalmohd83 commented on GitHub (Oct 2, 2020):
@yauheniprakapenka Curious! Is it solved on your side?
@yauheniprakapenka commented on GitHub (Oct 2, 2020):
On my physical device, the problem no longer happens from Monday to this Friday.
@faisalmohd83 commented on GitHub (Oct 11, 2020):
@NghiaTranUIT @yauheniprakapenka thanks for inputs.
Updates based on trials:
Certainly, Adding DNS to MacOS WiFi Setting helps.
It seems I found the issue, The Proxman Certificate should be installed as VPN and apps not W-Fi. Would be worth mentioning in the documentation.
@NghiaTranUIT commented on GitHub (Oct 12, 2020):
It seems that adding DNS 8.8.8.8 to macOS could resolve this problem 👍
I will add this information to the Android Troubleshooting page. Thank all for testing it 😄
@faisalmohd83 commented on GitHub (Oct 12, 2020):
Only DNS didn't solve my issue, Proxyman Certificate should be installed as VPN and apps. I was always installed as WiFi
@NghiaTranUIT commented on GitHub (Oct 14, 2020):
I'm happy to show you guys that I'm working on the Script to automatically do:
One-click and work automatically with all Android Emulators (Include Android 11)
https://twitter.com/proxyman_app/status/1316370751612579841
I will send a Beta build here when it's out 🙌
@faisalmohd83 commented on GitHub (Oct 15, 2020):
Hope this will improve consistency. Though Android/Emulator connects well, the connection loses after some time.
@faisalmohd83 commented on GitHub (Oct 23, 2020):
@NghiaTranUIT Awesome 👍🏼
The new auto-provisioning for emulator works our of the box.
@NghiaTranUIT commented on GitHub (Oct 23, 2020):
Glad to hear that it works for you 😄
@castrojr913 commented on GitHub (Mar 2, 2021):
@yauheniprakapenka How did u resolve it? I keep trying through Android emulator and It doesn't work. I've followed steps, installed certificate and it's marked as Trusted one in User tab. The same thing that u faced, browser requests are caught by ProxyMan but It doesn't catch my mobile app requests. UPDATE: I've checked emulator version out and it's a Pixel one. When I try overriding its settings, it displays an ADB error on step 5:
adb: error: stat failed when trying to push to /data/misc/user/0/cacerts-added/e93dbc37.0: Permission denied@NghiaTranUIT commented on GitHub (Mar 2, 2021):
@castrojr913 Are you using Native Android or React Native for Android apps?
If you can see the traffic from the Browser on Android Emulator, but not your app. It means that your network library doesn't respect the HTTP/HTTPS Proxy
@NghiaTranUIT commented on GitHub (Mar 2, 2021):
@castrojr913 here is troubleshooting that I collect for Android Emulator: https://docs.proxyman.io/troubleshooting/my-ios-devices-couldnt-connect-to-proxyman-via-proxy#1-after-setting-http-proxy-in-wifi-setting-i-could-not-open-http-proxy-man-ssl
Or you can use Automatic Script for Android Emulator: https://docs.proxyman.io/debug-devices/android-device/automatic-script-for-android-emulator
@castrojr913 commented on GitHub (Mar 2, 2021):
@NghiaTranUIT Xamarin Forms and I'm using Rider IDE. Network library is Refit.
@NghiaTranUIT commented on GitHub (Mar 2, 2021):
Yay @castrojr913 , it's a third-party network library. We have to manually set the Proxy Server for Refit.
Proxyman is listening at 127.0.0.1 port 9090
You should try this solution: https://github.com/reactiveui/refit/issues/123#issuecomment-71534478
@castrojr913 commented on GitHub (Mar 3, 2021):
@NghiaTranUIT Good point sir. Thank u so much. Regarding that suggested implementation, I added ServerCertificateCustomValidationCallback property in order to ignore SSL errors.
ProxyUrl is http://proxyman_ip:proxyman_port
@NghiaTranUIT commented on GitHub (Mar 3, 2021):
Glad to know it works 😄 🌮