# Built-in ios-webkit-debug-proxy server?

**URL:** <https://discuss.appium.io/t/built-in-ios-webkit-debug-proxy-server/1324>\
**Category:** Feature\
**Created:** [November 6, 2014, 4:20am UTC](https://discuss.appium.io/t/built-in-ios-webkit-debug-proxy-server/1324 "2014-11-06T04:20:08Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![kirill](https://discuss.appium.io/user_avatar/discuss.appium.io/kirill/32/1205_2.png) [@kirill](https://discuss.appium.io/u/kirill)\
**Post date:** [November 6, 2014, 4:20am UTC](https://discuss.appium.io/t/built-in-ios-webkit-debug-proxy-server/1324/1 "2014-11-06T04:20:08Z")

</div>

That would be great having option for server like `--ios-webkit-debug-proxy -udid port`, etc…  
Are you planning to do something like that?  
Thank you.

---

<div class="post-metadata">

**Author:** ![Mayuresh\_Shirodkar](https://discuss.appium.io/letter_avatar_proxy/v4/letter/m/a3d4f5/32.png) [@Mayuresh\_Shirodkar](https://discuss.appium.io/u/Mayuresh_Shirodkar)\
**Post date:** [February 1, 2015, 2:47pm UTC](https://discuss.appium.io/t/built-in-ios-webkit-debug-proxy-server/1324/2 "2015-02-01T14:47:43Z")

</div>

Yes this would be a great add on to appium

---

<div class="post-metadata">

**Author:** ![kirill](https://discuss.appium.io/user_avatar/discuss.appium.io/kirill/32/1205_2.png) [@kirill](https://discuss.appium.io/u/kirill)\
**Post date:** [February 1, 2015, 6:14pm UTC](https://discuss.appium.io/t/built-in-ios-webkit-debug-proxy-server/1324/3 "2015-02-01T18:14:04Z")

</div>

Actually they created JavaScript file to run webkit.

> <https://github.com/appium/appium/blob/master/bin/ios-webkit-debug-proxy-launcher.js>

---

<div class="post-metadata">

**Author:** ![Mayuresh\_Shirodkar](https://discuss.appium.io/letter_avatar_proxy/v4/letter/m/a3d4f5/32.png) [@Mayuresh\_Shirodkar](https://discuss.appium.io/u/Mayuresh_Shirodkar)\
**Post date:** [February 1, 2015, 6:25pm UTC](https://discuss.appium.io/t/built-in-ios-webkit-debug-proxy-server/1324/4 "2015-02-01T18:25:22Z")

</div>

So ./bin/ios-webkit-debug-proxy-launcher.js -c :27753 -d is the command i will need to run it?  
Where is the .js file actualy located?

---

<div class="post-metadata">

**Author:** ![kirill](https://discuss.appium.io/user_avatar/discuss.appium.io/kirill/32/1205_2.png) [@kirill](https://discuss.appium.io/u/kirill)\
**Post date:** [February 1, 2015, 6:40pm UTC](https://discuss.appium.io/t/built-in-ios-webkit-debug-proxy-server/1324/5 "2015-02-01T18:40:39Z")

</div>

Yeah, just run like that, except don’t forget to put UDID before :27753. This script is located in Appium/bin folder, if you run from source code.

---

<div class="post-metadata">

**Author:** ![Mayuresh\_Shirodkar](https://discuss.appium.io/letter_avatar_proxy/v4/letter/m/a3d4f5/32.png) [@Mayuresh\_Shirodkar](https://discuss.appium.io/u/Mayuresh_Shirodkar)\
**Post date:** [March 9, 2015, 1:45pm UTC](https://discuss.appium.io/t/built-in-ios-webkit-debug-proxy-server/1324/6 "2015-03-09T13:45:30Z")

</div>

Hi kirill,  
Have you tried executing the above command programaticaly?

---

<div class="post-metadata">

**Author:** ![kirill](https://discuss.appium.io/user_avatar/discuss.appium.io/kirill/32/1205_2.png) [@kirill](https://discuss.appium.io/u/kirill)\
**Post date:** [March 9, 2015, 4:09pm UTC](https://discuss.appium.io/t/built-in-ios-webkit-debug-proxy-server/1324/7 "2015-03-09T16:09:53Z")

</div>

Yes. I am doing that on Ruby:

```
 `pkill -f ios-webkit-debug-proxy-launcher ios_webkit_debug_proxy`
 `nohup node ~/appium/bin/ios-webkit-debug-proxy-launcher.js -c #{$device_udid}:27753 > /dev/null 2>&1 &`

```

You can do the same thing on any language. I restart webkit server before creating driver, to make sure server is not down, even though server is quite stable, sometimes it crashes randomly, but very seldom.

---

<div class="post-metadata">

**Author:** ![Mayuresh\_Shirodkar](https://discuss.appium.io/letter_avatar_proxy/v4/letter/m/a3d4f5/32.png) [@Mayuresh\_Shirodkar](https://discuss.appium.io/u/Mayuresh_Shirodkar)\
**Post date:** [March 10, 2015, 7:01am UTC](https://discuss.appium.io/t/built-in-ios-webkit-debug-proxy-server/1324/8 "2015-03-10T07:01:00Z")

</div>

Looks good will try it with Java.  
Thanks Man 🙂

---

<div class="post-metadata">

**Author:** ![prasad](https://discuss.appium.io/letter_avatar_proxy/v4/letter/p/9de0a6/32.png) [@prasad](https://discuss.appium.io/u/prasad)\
**Post date:** [August 21, 2015, 10:30am UTC](https://discuss.appium.io/t/built-in-ios-webkit-debug-proxy-server/1324/9 "2015-08-21T10:30:27Z")

</div>

Hi Mayuresh\_Shirodkar,

I am unable to starting iOS webkit debug proxy server and get iPhone information. Could you please tell me, how to start iOS webkit debug proxy server from terminal using java code and how to get the iOS device information from terminal using java code. This is priority work for me.

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![kirill](https://discuss.appium.io/user_avatar/discuss.appium.io/kirill/32/1205_2.png) [@kirill](https://discuss.appium.io/u/kirill)\
**Post date:** [August 24, 2015, 1:49am UTC](https://discuss.appium.io/t/built-in-ios-webkit-debug-proxy-server/1324/10 "2015-08-24T01:49:00Z")

</div>

Why exactly you are not able to start proxy server? What kind of problem or error do you have? What iPhone information do you want to get?  
In Ruby it’s easy to execute shell commands using backsticks (```). Essentially that’s basic shell script which you can be executed from Java as well:

```
String deviceId = " ****";
Runtime.getRuntime().exec(new String[]{
        "pkill -f ios-webkit-debug-proxy-launcher ios_webkit_debug_proxy",
        ";",
        "nohup node ~/appium/bin/ios-webkit-debug-proxy-launcher.js -c " + deviceId + ":27753 > /dev/null 2>&1 &"
});
```

---

<div class="post-metadata">

**Author:** ![prasad](https://discuss.appium.io/letter_avatar_proxy/v4/letter/p/9de0a6/32.png) [@prasad](https://discuss.appium.io/u/prasad)\
**Post date:** [August 24, 2015, 7:43am UTC](https://discuss.appium.io/t/built-in-ios-webkit-debug-proxy-server/1324/11 "2015-08-24T07:43:59Z")

</div>

Hi kirill,

Thanks for reply. Actually I am able to run appium server and adb devices command on terminal using java code in mac , but I really don’t how to run command with spaces(Eg. ios-deploy -c) on terminal using java code.

Actually I am trying to get list of iPhone devices which are connected to mac machine using java code after that I am sending UDID, device name and device version of iPhone device to capabilities, but I am unable to get the iPhone data. please find the below java code.

Code 1: The below code is nothing displaying in console.

String[] str = {"/bin/bash", “-c”, “ios-deploy -c”};   
Process p = Runtime.getRuntime().exec(str);  
BufferedReader r = new BufferedReader(new InputStreamReader(p.getInputStream()));  
String line = “”;  
String allLine = “”;  
while((line=r.readLine()) != null)  
{  
System.out.println(line);

}

Code 2: The below code is displaying IPhone information + Unnecessary data.  
String[] str = {"/bin/bash", “-c”, “system\_profiler”, “SPHardwareDataType”,"| sed -n -E -e ‘/(iPhone|iPad)/,/Serial/s/ \*Serial Number: \*(.+)/\1/p’" };

Process p = Runtime.getRuntime().exec(str);  
BufferedReader r = new BufferedReader(new InputStreamReader(p.getInputStream()));  
String line = “”;  
String allLine = “”;  
while((line=r.readLine()) != null)  
{  
System.out.println(line);

}

ios-webkit-debug-proxy Server:

I am getting below Exception when I trying to run ios-webkit-debug-proxy Server using below java code:  
String deviceId = “xxxxxxxxxxxxxxxxxxxxxxxxxx”;  
Process p = Runtime.getRuntime().exec(new String[]{  
“pkill -f ios-webkit-debug-proxy-launcher ios\_webkit\_debug\_proxy”,  
“;”,  
"nohup node ~/appium/bin/ios-webkit-debug-proxy-launcher.js -c " + deviceId + “:27753 \> /dev/null 2\>&1 &”  
});  
java.io.IOException: Cannot run program “pkill -f ios-webkit-debug-proxy-launcher ios\_webkit\_debug\_proxy”: error=2, No such file or directory

---

<div class="post-metadata">

**Author:** ![prasad](https://discuss.appium.io/letter_avatar_proxy/v4/letter/p/9de0a6/32.png) [@prasad](https://discuss.appium.io/u/prasad)\
**Post date:** [August 26, 2015, 4:20am UTC](https://discuss.appium.io/t/built-in-ios-webkit-debug-proxy-server/1324/12 "2015-08-26T04:20:17Z")

</div>

Hi kirill,

Could you please tell me, how to start iOS webkit debug proxy server programmatically using java code. This is priority work for me.

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![prasad](https://discuss.appium.io/letter_avatar_proxy/v4/letter/p/9de0a6/32.png) [@prasad](https://discuss.appium.io/u/prasad)\
**Post date:** [September 10, 2015, 6:13am UTC](https://discuss.appium.io/t/built-in-ios-webkit-debug-proxy-server/1324/13 "2015-09-10T06:13:10Z")

</div>

Hi kirill,

Could you please tell me, how to start Appium Server and iOS webkit debug proxy server programmatically using java code. This is priority work for me. how to fire the below commands on mac Terminal using java code.

Appium Server:

Directory : cd /Users/caaminf/appium/lib/server  
Commande: node main.js -u

iOS webkit debug proxy:

Directory : cd /usr/local/bin/  
Command: ios\_webkit\_debug\_proxy -c :27753 -d

Currently I am trying the below ways, but not displaying any thing in java console.

Appium Server :

String[] cmd = { “/bin/sh”, “-c”, “cd /Users/caaminf/appium/lib/server; node main.js -U d2cd2a957b336b7a73cab93a1aefda6c5a1a” };  
Process p = Runtime.getRuntime().exec(cmd);

```
	BufferedReader r = new BufferedReader(new InputStreamReader(p.getInputStream()));
	String line = "";
	String allLine = ""; 
	int i = 1;
	while((line=r.readLine()) != null)
	{
		System.out.println(line);
		i++;
	}

```

iOS webkit debug proxy:

String[] cmd = { “/bin/sh”, “-c”, “cd cd /usr/local/bin; ios\_webkit\_debug\_proxy -c d2cd2a957b336b7a73cab93a1ae429efa1a:27753 -d” };  
Process p = Runtime.getRuntime().exec(cmd);  
BufferedReader r = new BufferedReader(new InputStreamReader(p.getInputStream()));  
String line = “”;  
String allLine = “”;  
int i = 1;  
while((line=r.readLine()) != null)  
{  
System.out.println(line);  
i++;  
}

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![Ank](https://discuss.appium.io/letter_avatar_proxy/v4/letter/a/0ea827/32.png) [@Ank](https://discuss.appium.io/u/Ank)\
**Post date:** [April 28, 2016, 9:05pm UTC](https://discuss.appium.io/t/built-in-ios-webkit-debug-proxy-server/1324/14 "2016-04-28T21:05:45Z")

</div>

Hi Mayuresh,

Can you please share java code to start ios webkit debug proxy ?? Thanks

---

<div class="post-metadata">

**Author:** ![Mayuresh\_Shirodkar](https://discuss.appium.io/letter_avatar_proxy/v4/letter/m/a3d4f5/32.png) [@Mayuresh\_Shirodkar](https://discuss.appium.io/u/Mayuresh_Shirodkar)\
**Post date:** [April 29, 2016, 6:38pm UTC](https://discuss.appium.io/t/built-in-ios-webkit-debug-proxy-server/1324/15 "2016-04-29T18:38:39Z")

</div>

Hi,  
At the moment i have added below commands in a shell script. and executing that shell script.  
killall -9 ios\_webkit\_debug\_proxy  
ios\_webkit\_debug\_proxy -c $UDID:27753

---

<div class="post-metadata">

**Author:** ![Ank](https://discuss.appium.io/letter_avatar_proxy/v4/letter/a/0ea827/32.png) [@Ank](https://discuss.appium.io/u/Ank)\
**Post date:** [May 5, 2016, 12:03am UTC](https://discuss.appium.io/t/built-in-ios-webkit-debug-proxy-server/1324/16 "2016-05-05T00:03:35Z")

</div>

Hi Thanks Mayuresh for your quick reply. Another question after creating this shell script? How are you running this shell script in eclipse; I mean did you set any environment variable for ios\_webkit\_debug\_proxy node ?? I am getting this error: **env: node: Not a directory**

Thank you in Advance!!

---

<div class="post-metadata">

**Author:** ![Mayuresh\_Shirodkar](https://discuss.appium.io/letter_avatar_proxy/v4/letter/m/a3d4f5/32.png) [@Mayuresh\_Shirodkar](https://discuss.appium.io/u/Mayuresh_Shirodkar)\
**Post date:** [May 7, 2016, 3:17pm UTC](https://discuss.appium.io/t/built-in-ios-webkit-debug-proxy-server/1324/17 "2016-05-07T15:17:56Z")

</div>

Hey if u r running it from eclipse… u need to set the PATH variable in the Run configurations… This will ensure u never get that error 🙂

---

<div class="post-metadata">

**Author:** ![nagarjuna.kappurapu](https://discuss.appium.io/letter_avatar_proxy/v4/letter/n/9e8a1a/32.png) [@nagarjuna.kappurapu](https://discuss.appium.io/u/nagarjuna.kappurapu)\
**Post date:** [June 28, 2016, 5:01pm UTC](https://discuss.appium.io/t/built-in-ios-webkit-debug-proxy-server/1324/18 "2016-06-28T17:01:11Z")

</div>

What path i need to set in eclipse for running ios\_webkit\_debug\_proxy from eclipse?

---

<div class="post-metadata">

**Author:** ![Mayuresh\_Shirodkar](https://discuss.appium.io/letter_avatar_proxy/v4/letter/m/a3d4f5/32.png) [@Mayuresh\_Shirodkar](https://discuss.appium.io/u/Mayuresh_Shirodkar)\
**Post date:** [June 28, 2016, 5:28pm UTC](https://discuss.appium.io/t/built-in-ios-webkit-debug-proxy-server/1324/19 "2016-06-28T17:28:31Z")

</div>

PATH environment variable

---

<div class="post-metadata">

**Author:** ![nagarjuna.kappurapu](https://discuss.appium.io/letter_avatar_proxy/v4/letter/n/9e8a1a/32.png) [@nagarjuna.kappurapu](https://discuss.appium.io/u/nagarjuna.kappurapu)\
**Post date:** [July 3, 2016, 2:54pm UTC](https://discuss.appium.io/t/built-in-ios-webkit-debug-proxy-server/1324/20 "2016-07-03T14:54:35Z")

</div>

How to run ios\_webkit\_debug\_proxy with different port other than default port for appium 1.4.13 ?
