-
Notifications
You must be signed in to change notification settings - Fork 187
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Android device/emulator hardly connects #636
Comments
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. |
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 👍 |
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 🧐 |
@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 🤔 |
I am using only Android Device Xiaomi Redmi 9a android 10. This Saturday I will try to find how to reproduce the problem. |
@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. -- Eagerly looking forward to solving it, Would be happy to provide more info. |
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)
|
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 |
Certificate downloading was an issue but found you answered it another thread and done it in Android 30 emulator. |
Sure, I will update 👍 if you don’t mind, please help me test out with Android Studio HTTP Proxy setting in the previous comment. |
I tried with the above suggestions, had no luck!
Resulting behaviour: |
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 |
@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 👍 |
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. |
Hopefully, it works 🤣 |
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 👍 |
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. :) |
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 🙌 |
@yauheniprakapenka Curious! Is it solved on your side? |
On my physical device, the problem no longer happens from Monday to this Friday.
|
@NghiaTranUIT @yauheniprakapenka thanks for inputs. Updates based on trials: Certainly, Adding DNS to MacOS WiFi Setting helps. |
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 😄 |
Only DNS didn't solve my issue, Proxyman Certificate should be installed as VPN and apps. I was always installed as WiFi |
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 🙌 |
Hope this will improve consistency. Though Android/Emulator connects well, the connection loses after some time. |
@NghiaTranUIT Awesome 👍🏼 |
Glad to hear that it works for you 😄 |
@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: |
@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 |
@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 |
@NghiaTranUIT Xamarin Forms and I'm using Rider IDE. Network library is Refit. |
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: reactiveui/refit#123 (comment) |
@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 |
Glad to know it works 😄 🌮 |
Proxyman version? 2.7.0
macOS Version? Catalina 10.15.6
Steps to reproduce
Expected behavior
Connect the device all the time.
The text was updated successfully, but these errors were encountered: