Setting up BrowserMob proxy to work with iOS Safari

Has anyone tried using browser mob proxy with iOS Safari?
Below is my code , but it doesn’t generate any HAR File. So I doubt if traffic is being routed through proxy.

If I manuall set the browserMob proxy on device, it works

   //Create new proxy server
    mobProxyServer = new ProxyServer(9901);

    //Create Selenium Proxy Object
    Proxy proxy = mobProxyServer.seleniumProxy();

    //Set Capabilities
    DesiredCapabilities desiredCapabilities = new DesiredCapabilities();
    desiredCapabilities.setCapability("platformName", "iOS");
    desiredCapabilities.setCapability("platform-version", "7.0");
    desiredCapabilities.setCapability("deviceName","iPhone 5s");

    //Create Driver
    //AppiumDriver driver = new AppiumDriver(new URL(""),desiredCapabilities);
     driver = new RemoteWebDriver(new URL(""),desiredCapabilities);

    //Create HAR File

    //Open website

    //get and save HAR
    Har har = mobProxyServer.getHar();
    FileOutputStream fHarFile = new FileOutputStream("test.har");

Hi Aniket,

I am looking for the same … any luck on this ?
-Amarnath Rayudu

I do automation using iOS Simulators on VMs. (VMWare Fusion) You need to set the OS X System Proxy in order for the emulator to use a proxy.

If you’re using a physical device, I’m not sure I can help.

When setting the system proxy, make sure to add the IP of your Selenium Grid and of the host running BMProxy to the proxy bypass settings, or Appium will try to connect to the grid via the proxy.

We haven’t looked into it in a while, but we have to use a set of static proxy port mappings (instead of on-the-fly) because the proxy Capability doesn’t seem to work in the scenario we use.

Granted, the initial research and implementation was done about a year ago using Appium 1.0, so if this has changed, that would be awesome.

I am able to get the HAR entries for Firefox but no luck with simulator or device(getting HAR with no entries in the file).
Is there anyway to setup browsermob proxy on my device ? Please help.


I was able to do it with both Android Emulators/Real device and also with iOS simulators/real device. We did it with Appium 1.0. I will try again doing this with latest Appium version 1.3.7 and share my findings soon.

Hi Amit,

Were you able to test browsermob proxy with iOS real device and simulators?


Hi Gulshan,

I am trying to accomplish the same but i am also getting empty HAR file. Were you able to find the resolve to this problem.



Hi Folks …

It works on real device, need to change the proxy settings in the device.


1 Like

I am able to finally make it work on simulator as well. Please see this.

Hi Amit,

I referred :

but they just suggest to restart the simulator which did not work for me… can you suggest what exactly you did to make your simulator to use proxy?

Hi Amarnath,

What settings do i need to change in device for browsermob proxy to work on a real device. I am using Appium 1.5.3 and trying to run my tests on iPhone 10.x version.

Below is my code.

    BrowserMobProxy proxy = new BrowserMobProxyServer();
	Proxy seleniumProxy = ClientUtil.createSeleniumProxy(proxy);
	capabilities.setCapability(CapabilityType.PROXY, seleniumProxy);

Any help would be appreciated.


Hi Amarnath,

What proxy setting need to do in device. Can you elaborate.?