How do I monitor iOS simulator/Android emulator's HTTP traffic from Appium JUnit tests?

Viewed 2794

So I am writing JUnit tests for iOS/Android apps using Appium to drive the tests on an iOS simulator and Android emulator. The app sends and receives HTTP calls to a remote server. I would like to test that the app is sending the correct HTTP traffic from my JUnit tests. What are some ways that I can monitor the network traffic from within my code?

2 Answers

For javascript and python the command is:

driver.getLogs('logcat');
Related