{"action":"created","issue":{"url":"https://api.github.com/repos/appium/appium/issues/4198","labels_url":"https://api.github.com/repos/appium/appium/issues/4198/labels{/name}","comments_url":"https://api.github.com/repos/appium/appium/issues/4198/comments","events_url":"https://api.github.com/repos/appium/appium/issues/4198/events","html_url":"https://github.com/appium/appium/issues/4198","id":50499259,"number":4198,"title":"'iOS-webkit-debug-proxy' crash happens when test on real device","user":{"login":"scnymc","id":6904704,"avatar_url":"https://avatars.githubusercontent.com/u/6904704?v=3","gravatar_id":"","url":"https://api.github.com/users/scnymc","html_url":"https://github.com/scnymc","followers_url":"https://api.github.com/users/scnymc/followers","following_url":"https://api.github.com/users/scnymc/following{/other_user}","gists_url":"https://api.github.com/users/scnymc/gists{/gist_id}","starred_url":"https://api.github.com/users/scnymc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scnymc/subscriptions","organizations_url":"https://api.github.com/users/scnymc/orgs","repos_url":"https://api.github.com/users/scnymc/repos","events_url":"https://api.github.com/users/scnymc/events{/privacy}","received_events_url":"https://api.github.com/users/scnymc/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/appium/appium/labels/Bug","name":"Bug","color":"fc2929"},{"url":"https://api.github.com/repos/appium/appium/labels/iOS","name":"iOS","color":"444444"},{"url":"https://api.github.com/repos/appium/appium/labels/Real%20Devices","name":"Real Devices","color":"f77777"}],"state":"open","locked":false,"assignee":{"login":"0x1mason","id":4587515,"avatar_url":"https://avatars.githubusercontent.com/u/4587515?v=3","gravatar_id":"","url":"https://api.github.com/users/0x1mason","html_url":"https://github.com/0x1mason","followers_url":"https://api.github.com/users/0x1mason/followers","following_url":"https://api.github.com/users/0x1mason/following{/other_user}","gists_url":"https://api.github.com/users/0x1mason/gists{/gist_id}","starred_url":"https://api.github.com/users/0x1mason/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/0x1mason/subscriptions","organizations_url":"https://api.github.com/users/0x1mason/orgs","repos_url":"https://api.github.com/users/0x1mason/repos","events_url":"https://api.github.com/users/0x1mason/events{/privacy}","received_events_url":"https://api.github.com/users/0x1mason/received_events","type":"User","site_admin":false},"milestone":null,"comments":14,"created_at":"2014-12-01T08:36:23Z","updated_at":"2015-03-08T01:25:10Z","closed_at":null,"body":"Hi,\r\n\r\niOS-webkit-debug-proxy crashes when run the Appium for Safari on real device. is it a known bug? if yes, any solutions for it?\r\n\r\nHere is my test machine configurations:\r\n1. Mac os: 10.10; xCode: 6.1\r\n2. Appium 1.3.3 (install using npm)\r\n3. SafariLauncher, I got the source from github and sign it with my developer signature, the bundle ID is \"com.bytearc.SafariLauncher\", and has been installed to my iPad\r\n4. iOS-webkit-debug-proxy is started with the command \"Ios_webkit_debug_proxy -c 9273bc6013c7645d05addf2ae7733c7b616e8790:27753\"  (its version is 1.4)\r\n5. My capabilities:\r\ncapabilities.setCapability(\"platformName\", \"iOS\");\r\ncapabilities.setCapability(\"platformVersion\", \"8.1\");\r\ncapabilities.setCapability(\"deviceName\", \"iPad\");\r\ncapabilities.setCapability(\"udid\",\"xxxxx\");\r\ncapabilities.setCapability(MobileCapabilityType.BROWSER_NAME, \"safari\");\r\ndriver = new AppiumDriver(new URL(\"http://127.0.0.1:4723/wd/hub\"),capabilities);\r\n\r\nWhen I run the java code, the safariLauncher is launched on device, but the ios_webkit_debug_proxy is crashed! the log as below:\r\n=====================\r\nmacsbjlhl:~ yuemingchen$ ios_webkit_debug_proxy -c 9273bc6013cMYIPADID733c7b616e8790:27753\r\nConnected :27753 to BTG iPad (9273bc6013c7645d05addf2ae7733c7b616e8790)\r\nInvalid message _rpc_applicationUpdated: <dict>\r\n\t<key>WIRApplicationBundleIdentifierKey</key>\r\n\t<string>com.apple.mobilesafari</string>\r\n\t<key>WIRApplicationNameKey</key>\r\n\t<string>Safari</string>\r\n\t<key>WIRIsApplicationProxyKey</key>\r\n\t<false/>\r\n\t<key>WIRIsApplicationActiveKey</key>\r\n\t<integer>1</integer>\r\n\t<key>WIRApplicationIdentifierKey</key>\r\n\t<string>PID:2353</string>\r\n</dict>\r\nDisconnected :27753 from BTG iPad (9273bc6013c7MYIPADID7733c7b616e8790)\r\n===================\r\n\r\nAnd here is the Appium log:\r\n===================\r\nmacsbjlhl:~ yuemingchen$ appium -U 9273bc6013c76mypadeID7733c7b616e8790\r\ninfo: Welcome to Appium v1.3.3 (REV 34e21b01b87d4e3959e1c97c0a8d0b1a610bdc78)\r\ninfo: Appium REST http interface listener started on 0.0.0.0:4723\r\ninfo: [debug] Non-default server args: {\"udid\":\"9273bc6013c7645dMYPADae7733c7b616e8790\"}\r\ninfo: Console LogLevel: debug\r\ninfo: --> POST /wd/hub/session {\"desiredCapabilities\":{\"automationName\":null,\"orientation\":\"LANDSCAPE\",\"app\":null,\"platformVersion\":\"8.1\",\"deviceName\":\"iPad\",\"platformName\":\"iOS\",\"browserName\":\"safari\",\"appActivity\":null,\"unicodeKeyboard\":null,\"udid\":\"9273bc6013c7645d05aMYPADe7733c7b616e8790\",\"appPackage\":null}}\r\ninfo: Client User-Agent string: Apache-HttpClient/4.3.3 (java 1.5)\r\ninfo: [debug] Configuring Safari session\r\ninfo: [debug] Using local .zip from command line: /usr/local/lib/node_modules/appium/build/SafariLauncher/SafariLauncher.zip\r\ninfo: [debug] Copying local zip to tmp dir\r\ninfo: [debug] /usr/local/lib/node_modules/appium/build/SafariLauncher/SafariLauncher.zip copied to /var/folders/b1/z0t1mqjx63n58k54gq82sdnw0000gr/T/114111-5867-1dznbch/appium-app.zip\r\ninfo: [debug] Unzipping /var/folders/b1/z0t1mqjx63n58k54gq82sdnw0000gr/T/114111-5867-1dznbch/appium-app.zip\r\ninfo: [debug] Testing zip archive: /var/folders/b1/z0t1mqjx63n58k54gq82sdnw0000gr/T/114111-5867-1dznbch/appium-app.zip\r\ninfo: [debug] Zip archive tested clean\r\ninfo: [debug] Unzip successful\r\ninfo: [debug] Using locally extracted app: /var/folders/b1/z0t1mqjx63n58k54gq82sdnw0000gr/T/114111-5867-1dznbch/submodules/SafariLauncher/build/Release-iphoneos/SafariLauncher.app\r\ninfo: [debug] Creating new appium session d1710b2b-8475-4521-b70b-45504922b442\r\ninfo: [debug] Removing any remaining instruments sockets\r\ninfo: [debug] Cleaned up instruments socket /tmp/instruments_sock\r\ninfo: [debug] Setting Xcode folder\r\ninfo: [debug] Setting Xcode version\r\ninfo: [debug] Setting iOS SDK Version\r\ninfo: [debug] Getting sdk version from xcrun with a timeout\r\ninfo: [debug] iOS SDK Version set to 8.1\r\ninfo: [debug] Not checking whether simulator is available since we're on a real device\r\ninfo: [debug] Detecting automation tracetemplate\r\ninfo: [debug] Not auto-detecting udid, running on sim\r\ninfo: [debug] Could not parse plist file (as binary) at /var/folders/b1/z0t1mqjx63n58k54gq82sdnw0000gr/T/114111-5867-1dznbch/submodules/SafariLauncher/build/Release-iphoneos/SafariLauncher.app/en.lproj/Localizable.strings\r\ninfo: Will try to parse the plist file as XML\r\n`parseFileSync()` is deprecated. Use `parseStringSync()` instead.\r\ninfo: [debug] Could not parse plist file (as XML) at /var/folders/b1/z0t1mqjx63n58k54gq82sdnw0000gr/T/114111-5867-1dznbch/submodules/SafariLauncher/build/Release-iphoneos/SafariLauncher.app/en.lproj/Localizable.strings\r\nwarn: Could not parse app Localizable.strings; assuming it doesn't exist\r\ninfo: [debug] Getting bundle ID from app\r\ninfo: [debug] Parsed app Info.plist (as binary)\r\ninfo: [debug] Creating instruments\r\ninfo: On some xcode 6 platforms, instruments-without-delay does not work. If you experience this, you will need to re-run appium with the --native-instruments-lib flag\r\ninfo: [debug] Preparing uiauto bootstrap\r\ninfo: [debug] Dynamic bootstrap dir: /Users/yuemingchen/Library/Application Support/appium/bootstrap\r\ninfo: [debug] Dynamic env: {\"nodePath\":\"/usr/local/bin/node\",\"commandProxyClientPath\":\"/usr/local/lib/node_modules/appium/node_modules/appium-uiauto/bin/command-proxy-client.js\",\"instrumentsSock\":\"/tmp/instruments_sock\",\"interKeyDelay\":null,\"justLoopInfinitely\":false,\"autoAcceptAlerts\":false,\"sendKeyStrategy\":\"grouped\"}\r\ninfo: [debug] Dynamic bootstrap code: // This file is automatically generated. D...ot manually modify!\r\ninfo: [debug] Dynamic bootstrap path: /Users/yuemingchen/Library/Application Support/appium/bootstrap/bootstrap-d0f21a5b61bb08af.js\r\ninfo: [debug] Reusing dynamic bootstrap: /Users/yuemingchen/Library/Application Support/appium/bootstrap/bootstrap-d0f21a5b61bb08af.js\r\ninfo: [debug] Getting device string from opts: {\"forceIphone\":false,\"forceIpad\":false,\"xcodeVersion\":\"6.1\",\"iOSSDKVersion\":\"8.1\",\"deviceName\":\"iPad\",\"platformVersion\":\"8.1\"}\r\ninfo: [debug] fixDevice is on\r\ninfo: [debug] Final device string is: 'iPad (8.1 Simulator)'\r\ninfo: [debug] Not setting device type since we're on a real device\r\ninfo: [debug] Checking whether we need to set app preferences\r\ninfo: [debug] Not setting iOS and app preferences since we're on a real device\r\ninfo: [debug] Running ios sim reset flow\r\ninfo: [debug] Killing the simulator process\r\ninfo: [debug] Killall iOS Simulator\r\ninfo: [debug] Killing any other simulator daemons\r\ninfo: [debug] On a real device; cannot clean device state\r\ninfo: [debug] Not setting locale because we're using a real device\r\ninfo: [debug] No iOS / app preferences to set\r\ninfo: [debug] Starting iOS device log capture via deviceconsole\r\ninfo: [debug] Not pre-launching simulator\r\ninfo: [debug] Checking app install status using: /usr/local/lib/node_modules/appium/build/fruitstrap/fruitstrap isInstalled --id 9273bc6013c7645d05addMYPAD733c7b616e8790 --bundle com.bytearc.SafariLauncher\r\ninfo: [debug] Starting command proxy.\r\ninfo: [debug] Instruments socket server started at /tmp/instruments_sock\r\ninfo: [debug] Starting instruments\r\ninfo: [debug] Instruments is at: /Applications/Xcode.app/Contents/Developer/usr/bin/instruments\r\ninfo: Launching instruments\r\ninfo: [debug] Attempting to run app on real device with UDID 9273bc6013c7645dMYPADID3c7b616e8790\r\ninfo: [debug] Spawning instruments with command: /Applications/Xcode.app/Contents/Developer/usr/bin/instruments -t /Applications/Xcode.app/Contents/Applications/Instruments.app/Contents/PlugIns/AutomationInstrument.xrplugin/Contents/Resources/Automation.tracetemplate -D /tmp/appium-instruments/instrumentscli0.trace -w 9273bc6013c7645d05MYPADID2ae7733c7b616e8790 com.bytearc.SafariLauncher -e UIASCRIPT \"/Users/yuemingchen/Library/Application Support/appium/bootstrap/bootstrap-d0f21a5b61bb08af.js\" -e UIARESULTSPATH /tmp/appium-instruments\r\ninfo: [debug] And extra without-delay env: {}\r\ninfo: [debug] And launch timeouts (in ms): {\"global\":90000}\r\ninfo: [debug] [INST STDERR] 2014-12-01 15:47:09.177 instruments[5900:136619] WebKit Threading Violation - initial use of WebKit from a secondary thread.\r\ninfo: Instruments is ready to receive commands\r\ninfo: [debug] Instruments launched. Starting poll loop for new commands.\r\ninfo: [debug] Setting bootstrap config keys/values\r\ninfo: [debug] Pushing command to appium work queue: \"target = $.target();\\nau = $;\\n$.isVerbose = true;\\n\"\r\ninfo: [debug] Socket data received (2 bytes)\r\ninfo: [debug] Socket data being routed.\r\ninfo: [debug] Sending command to instruments: target = $.target();\r\nau = $;\r\n$.isVerbose = true;\r\n\r\ninfo: [debug] [INST] 2014-12-01 07:45:27 +0000 Debug: evaluation finished\r\ninfo: [debug] [INST] 2014-12-01 07:45:27 +0000 Debug: responding with:\r\ninfo: [debug] [INST] 2014-12-01 07:45:27 +0000 Debug: Running system command #1: /usr/local/bin/node /usr/local/lib/node_modules/appium/node_modules/appium-uiauto/bin/command-proxy-client.js /tmp/instruments_sock 2,{\"status\":0,\"value\":true}...\r\ninfo: [debug] Socket data received (27 bytes)\r\ninfo: [debug] Socket data being routed.\r\ninfo: [debug] Got result from instruments: {\"status\":0,\"value\":true}\r\ninfo: [debug] Setting initial orientation to LANDSCAPE\r\ninfo: [debug] Pushing command to appium work queue: \"au.setScreenOrientation('LANDSCAPE')\"\r\ninfo: [debug] Sending command to instruments: au.setScreenOrientation('LANDSCAPE')\r\ninfo: [debug] [INST] 2014-12-01 07:45:28 +0000 Debug: Got new command 1 from instruments: au.setScreenOrientation('LANDSCAPE')\r\ninfo: [debug] [INST] 2014-12-01 07:45:28 +0000 Debug: evaluating au.setScreenOrientation('LANDSCAPE')\r\ninfo: [debug] [INST] 2014-12-01 07:45:28 +0000 Debug: target.setDeviceOrientation(\"3\")\r\ninfo: [debug] [INST] 2014-12-01 07:45:29 +0000 Debug: evaluation finished\r\ninfo: [debug] Socket data received (34 bytes)\r\ninfo: [debug] Socket data being routed.\r\ninfo: [debug] Got result from instruments: {\"status\":0,\"value\":\"LANDSCAPE\"}\r\ninfo: [debug] Waiting for app source to contain elements\r\ninfo: [debug] Pushing command to appium work queue: \"au.mainApp().getTreeForXML()\"\r\ninfo: [debug] Sending command to instruments: au.mainApp().getTreeForXML()\r\ninfo: [debug] [INST] 2014-12-01 07:45:29 +0000 Debug: responding with:\r\ninfo: [debug] [INST] 2014-12-01 07:45:29 +0000 Debug: Running system command #2: /usr/local/bin/node /usr/local/lib/node_modules/appium/node_modules/appium-uiauto/bin/command-proxy-client.js /tmp/instruments_sock 2,{\"status\":0,\"value\":\"LANDSCAPE\"}...\r\ninfo: [debug] [INST] 2014-12-01 07:45:30 +0000 Debug: Got new command 2 from instruments: au.mainApp().getTreeForXML()\r\ninfo: [debug] [INST] 2014-12-01 07:45:30 +0000 Debug: evaluating au.mainApp().getTreeForXML()\r\ninfo: [debug] Socket data received (8100 bytes)\r\ninfo: [debug] Socket data received (8168 bytes)\r\ninfo: [debug] Socket data received (8056 bytes)\r\ninfo: [debug] Socket data received (7261 bytes)\r\ninfo: [debug] Socket data received (7609 bytes)\r\ninfo: [debug] Socket data received (7363 bytes)\r\ninfo: [debug] Socket data being routed.\r\ninfo: [debug] Got result from instruments: {\"status\":0,\"value\":{\"UIAApplication\":{\"@\":{\"name\":\"Safari\",\"label\":\"Safari\",\"value\":null,\"dom\":null,\"enabled\":true,\"valid\":true,\"visible\":true,\"hint\":null,\"path\":\"/0\",\"x\":20,\"y\":-256,\"width\":748,\"height\":1024},\">\":[{\"UIAWindow\":{\"@\":{\"name\":null,\"label\":null,\"value\":null,\"dom\":null,\"enabled\":true,\"\r\n\r\ninfo: [debug] [INST] 2014-12-01 07:45:41 +0000 Debug: evaluation finished\r\ninfo: [debug] [INST] 2014-12-01 07:45:41 +0000 Debug: responding info: [debug] [INST] 2014-12-01 07:45:41 +0000 Debug: Running system command #3: /usr/local/bin/node /usr/local/lib/node_modules/appium/node_modules/appium-uiauto/bin/command-proxy-client.js /tmp/instruments_sock 2,{\"status\":0,\"value\":{\"UIAApplication\":{\"@\":{\"name\":\"Safari\",\"label\":\"Safari\",\"value\":null,\"dom\":null,\"enabled\":true,\"valid\":true,\"visible\":true,\"hint\":null,\"path\":\"/0...\r\n…(here I delete some page info)\r\n\r\ninfo: [debug] Navigating to most recently opened webview\r\ninfo: [debug] [REMOTE] Getting WebKitRemoteDebugger pageArray\r\nerror: [REMOTE] Could not connect to WebKitRemoteDebugger server\r\ninfo: [debug] Cleaning up appium session\r\nerror: Failed to start an Appium session, err was: Error: Could not navigate to webview! Err: Error: connect ECONNREFUSED\r\ninfo: [debug] Error: Could not navigate to webview! Err: Error: connect ECONNREFUSED\r\n    at null.<anonymous> (/usr/local/lib/node_modules/appium/lib/devices/ios/ios.js:1556:12)\r\n    at null.<anonymous> (/usr/local/lib/node_modules/appium/lib/devices/ios/ios-controller.js:1532:14)\r\n    at null.<anonymous> (/usr/local/lib/node_modules/appium/lib/devices/ios/webkit-remote-debugger.js:73:14)\r\n    at ClientRequest.<anonymous> (/usr/local/lib/node_modules/appium/node_modules/underscore/underscore.js:754:19)\r\n    at ClientRequest.emit (events.js:95:17)\r\n    at Socket.socketErrorListener (http.js:1551:9)\r\n    at Socket.emit (events.js:95:17)\r\n    at net.js:440:14\r\n    at process._tickDomainCallback (node.js:463:13)\r\ninfo: [debug] Responding to client with error: {\"status\":33,\"value\":{\"message\":\"A new session could not be created. (Original error: Could not navigate to webview! Err: Error: connect ECONNREFUSED)\",\"origValue\":\"Could not navigate to webview! Err: Error: connect ECONNREFUSED\"},\"sessionId\":null}\r\ninfo: <-- POST /wd/hub/session 500 26107.103 ms - 248 \r\n\r\n"},"comment":{"url":"https://api.github.com/repos/appium/appium/issues/comments/77726815","html_url":"https://github.com/appium/appium/issues/4198#issuecomment-77726815","issue_url":"https://api.github.com/repos/appium/appium/issues/4198","id":77726815,"user":{"login":"0x1mason","id":4587515,"avatar_url":"https://avatars.githubusercontent.com/u/4587515?v=3","gravatar_id":"","url":"https://api.github.com/users/0x1mason","html_url":"https://github.com/0x1mason","followers_url":"https://api.github.com/users/0x1mason/followers","following_url":"https://api.github.com/users/0x1mason/following{/other_user}","gists_url":"https://api.github.com/users/0x1mason/gists{/gist_id}","starred_url":"https://api.github.com/users/0x1mason/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/0x1mason/subscriptions","organizations_url":"https://api.github.com/users/0x1mason/orgs","repos_url":"https://api.github.com/users/0x1mason/repos","events_url":"https://api.github.com/users/0x1mason/events{/privacy}","received_events_url":"https://api.github.com/users/0x1mason/received_events","type":"User","site_admin":false},"created_at":"2015-03-08T01:25:09Z","updated_at":"2015-03-08T01:25:09Z","body":"Need to replace ios_webkit_debug_proxy_launcher.js workaround with iwdp that includes @jchuong fix."}}