Reputation: 6389
I am writing Espresso UI tests with okhttp3.mockwebserver.MockWebServer. I am facing an issue, that my MockWebServer is not accessible from the application running in AVD.
This works:
This doesn't work:
I ensured:
cleartextTrafficPermitted="true"
My best guess is, that the MockWebServer runs in a JVM machine and is not accessible from a different process, because it is not starting a real web server, but it just intercepts the HTTP traffic within one JVM process, could it be? Do you see any other possible root cause or is my wish to make it work a no-go?
Upvotes: 0
Views: 30
Reputation: 6389
The problem is solved, my mistake was the assumption, that the UI Tests are executed on my working machine in a separate JVM.
Instead, the tests are executed directly on the AVD, so there is no need to replace localhost
with 10.0.2.2
Upvotes: 0