I read all the threads about this topic and the instructions for setting up charles with genymotion are all the same:
http://rexstjohn.com/using-genymotion-charles-proxy/
In your Genymotion Android emulator…
Settings -> Wifi -> Press and hold your active network
Select “Modify Network”
Select “Show Advanced Options”
Select “Proxy Settings -> Manual”
Set your Proxy to: 10.0.3.2 (Genymotion’s special code for the local workstation)
Set your Port to: 8888
Press Save
My set up is:
A localhost development Spring server running on my Mac OS
An android app installed on my genymotion emulator. The genymotion emulator communicates with my local dev server through ip 10.0.3.2 (How to access localhost from a Genymotion android emulator?)
I'm not sure if the instructions are old but the issue I'm having is that traffic that flows from my genymotion emulator is recorded within Charles Proxy but it is just not reaching my localhost server. I'm not using any SSL encryption between my server and my app.
This is my settings inside genymotion wifi screen:
This is what my Charles Proxy looks like - you can see that it is "Connecting to remote host". It connects forever and then eventually ends up giving me a 503 error on my android app side with nothing being returned:
If I switch off Charles Proxy, the app connects with my localhost server with no problems and all calls are returned successfully. I think it is something to do with Charles that is stopping my app from communicating with my localhost server.
In Postman, if I try to query the same url that my android app was trying to query, it works successfully and the results are also successfully logged within Charles:
http://localhost:8443/ + my api endpoint **OR** http://localhost.charlesproxy.com:8443/ + my api endpoint
The only difference between querying in Postman and querying in my android app is that my app hits this url 10.0.3.2 instead because I'm working off an emulator:
http://10.0.3.2:8443/ + my api endpoint
I have also added 10.0.3.2 into my Access Control Settings:
I can go into my android genymotion emulator internet browser and search for websites like www.msn.com and it will return successfully plus log the results within Charles but I'm not looking for or are prepared to pay 50 USD for a tool to record my android browser traffic. I need it to work with my android app so that I can debug my app. I'm not sure how to fix this, does anyone here know if I'm missing something?
EDIT:
In case someone is wondering, I have read this post on Charles' FAQ about Localhost traffic doesn't appear in Charles:
https://www.charlesproxy.com/documentation/faqs/
But it is not like I can change the 10.0.3.2 used by Genymotion to http://localhost.charlesproxy.com/ instead so I don't think that would solve my issue.
So I was playing around with the Genymotion emulator and Charles now and I actually managed to get Charles to record localhost traffic.
Similar to the way I queried through Postman with:
http://localhost.charlesproxy.com:8443/ + my api endpoint
I just changed the host portion of all my api endpoints to: http://localhost.charlesproxy.com:8443/ and it worked.
Related
Having a hard time debugging from mobile device my local development web app which connects to a GraphQL node server and another service using web sockets. All three services running on HTTPS to the below ports.
Web Reactjs app: https://localhost:3335
Node server: https://localhost:3334
Web socket server: wss://localhost:4443
From my macOS machine, everything works as expected but when trying to access the reactjs from Chrome Android and using the inspect desktop devtools and USB cable navigating to https://localhost:3335 works but I get the error POST https://localhost:3334/dev/graphql net::ERR_CERT_DATE_INVALID.
My iOS device doesn't even connect to localhost:3335 or 192.168.2.3:3335.
I am open to any tips, tricks, services, and ideas to debug using my local development machine and mobile devices.
I was able to make it work by navigating to all addresses in the mobile browser and accept the risk of a self-signed certificate.
https://localhost:3334/dev/grapqhl -> accept
https://localhost:4443 -> accept
Now https://localhost:3335 will work fine.
Struggling with iPhone debugging due to localhost not binding to the machine IP address (Pending solution, might create another SO question for reference).
I'm building an app (android + iOS) that needs to be able to reach an API Endpoint through a https proxy.
The development environment is Android Studio + Xcode + macOS.
My development path is:
Reach the endponit using android emulator settings.
Reach the endpoint using real andorid device settings.
Reach the endpoint using inapp solution implenting the https proxy connection management inside the app.
Since I'm at the first point, my problem is that I'm not able to setup the Android emulator with the https proxy.
(For iOS app, just setting up the mac network preferences is enought)
In Android, I successly set up the http, but not the https.
I have tried setting up the apn at the vitrual device, and running the emulator with -http-proxy.
According to the documentation it includes https proxy, but it still not working.
The debugger saids that the server response is null when calling https. Http redirects to https.
All of those solutions just works for the http, not for the https.
I have also tried whit genymotion with no success.
I have tested the API from my computer (via postman) and it is all ok.
Has anyone been able to successfully access an https proxy from the Android emulator? It's possible? What settings am I omitting?
Thank you so much in advance.
PS: My problem is related with HTTPS, I am able to use HTTP proxy
I am trying to hit web services in native android application and the IP address which I am trying to hit should bypass corporate proxy.
But to connect my emulator to internet I have to set proxy in emulator.
Is there anyway I can bypass proxy for this specific IP address in emulator?
My emulator is connected to internet presently and can open sites through browser.
You need to set an intermediate proxy as Android emulator doesn't have options to set internal server URLs which don't need proxies. Try the approach suggested here. It works!
I am trying to access a web role integrated with ACS from the Android emulator , the issue is that
during web role debug configuration , the ACS redirects back to "localhost" and not to a real URL.
Android emulator local computer localhost address is defined as 10.0.0.2 so when ACS redirects to localhost the emulator web browser fails to redirect.
I tried to let ACS redirect to 10.0.0.2 - but for some unknown reason it doesnt work.
SO! .... after few hours (50) I tried to use IIS 7 as a reverse proxy using Application Request Routing and to make the Android calls directly to my computers LAN ip address and let IIS to redirect the calls to the Azure local host web role :
So , the emulator calls 10.0.0.3:8081 and IIS7 will redirect it to localhost:8082 (which is the web role).
AND! .... after another few hours (280) , I am still investing so much IT time and cant check my web role.
So , now I am here , and hope that someone with expirence in those subjects can help me out .
Azure btw for those of you who do not know , can not be configured locally to publish itself on the local network and can only operate in localhost mode.
Thank you very much .
Ishai
Problem solved , instead of IIS 7 Application Requet Routing I have used Fiddler 2 Reverse proxy option to forward requests to my localhost web role.
Fiddler 2 is configured to publish itself in the LAN at localComputerIp:8888 - e.g. 10.0.0.3:8888 , so then from Android instead of trying to access 10.0.0.2 (localhost) : 8087 - my Azure web role direct address , I set it to connect to Fiddler direct LAN ip at 10.0.0.3:8888 and Fiddler forwarded the requests to localhost:8087.
This took me alot of time to accomplish and even though it might be simple if you have the right knowledge I hope other users will find this post helpful .
I'm at complete odds over configuring a proxy to inspect the HTTP(S) traffic for the app I'm developing. I've tried running Fiddler2 and Charles Web Proxy, both run on 127.0.0.1:888, and starting up the Android emulator with the parameter:
-http-proxy http://127.0.0.1:8888
To test it out I open the Android browser. I see in Fiddler2 that the request is routed through the proxy. However, only RARELY does the request receive a successful response. In most, and when I say most I mean 99% of the time, the request is retried and fails again with the Android browser telling me "The server failed to communicate".
Has anyone found a way to configure Fiddler2 or Charles for debugging HTTP(S) traffic through the Android emulator?
The -http-proxy emulator option works for me (with a real HTTP proxy behind it), so not sure what the problem with Charles would be.
An alternative is to capture the network traffic directly, then analyse it afterwards using Wireshark — which can do SSL decryption, if you have the private key.
I was able to view the traffic with an HTTP sniffer instead of a proxy. I used HTTPScoop, which is a nice little app.
Also the nice thing about using HTTPScoop is that I can also see traffic on my actual device when I turn on internet sharing and have my phone use the wifi from my mac. So this is a good deal for debugging what happens on the phone itself AND the emulator.
This way it doesn't matter what emulator you use, because the sniffer sees the traffic independent of the emulator, device, compiler settings etc.
I had the same problem with Charles using the Emulator from the Android development tools r12. It should be working when you download r11 and replace the emulator in r12 with the one from r11. The bug is tracked here.
To get r11 copy the download link from the download page and change r12 to r11.