Inspector crashes iOS app (on device) after loading

1,447 views
Skip to first unread message

isonic1

unread,
Jun 24, 2013, 6:04:04 PM6/24/13
to appium-...@googlegroups.com
I'm using appium v0.7.3. 

1. Tether phone to mac
2. Set UDID, BundleID, Force Device iPhone.
3. Launch Appium. Appium successfully launches app on the device, all is good.
4. Click the (i) Inspector button. The inspector starts to grab the page elements but after doing so the app on the device crashes. Below is the error I could find on my macs console app. Anyone have an idea of what might be going on?

6/24/13 5:56:37.013 PM Appium[2551]: Selenium Error: -1004 - Error Domain=NSURLErrorDomain Code=-1004 "Could not connect to the server." UserInfo=0x7fb14e0771a0 {NSUnderlyingError=0x7fb14c674c90 "Could not connect to the server.", NSErrorFailingURLStringKey=http://127.0.0.1:4700/wd/hub/session/9421d140-8a41-43cd-965e-478520c7213b/window_handles, NSErrorFailingURLKey=http://127.0.0.1:4700/wd/hub/session/9421d140-8a41-43cd-965e-478520c7213b/window_handles, NSLocalizedDescription=Could not connect to the server.}


Dan Cuellar

unread,
Jun 24, 2013, 6:27:19 PM6/24/13
to appium-...@googlegroups.com
Can you grab the error from the node console? (I know it's crashing, but here's how you can do it)

1.) Launch the server using the command line by cd'ing into Appium.app/Contents/Resources/node_modules/appium/ and running ../../node/bin/node server.js --app <path_to_your_app> --pre-launch etc.
2.) Go to preferences in the .app and select developer mode
3.) Choose use remote server checkbox next to the launch button
4.) Enter the IP and Port for the server then click the (i) button again

Justin Ison

unread,
Jun 25, 2013, 11:57:41 AM6/25/13
to Dan Cuellar, appium-...@googlegroups.com
Ah, here you go. Let me know if you need more info. 


debug: Appium request initiated at /wd/hub/session/3aff874a-5782-4427-8d35-23f0d73fac5c/screenshot
info: Pushing command to appium work queue: "au.capture('screenshot717ac72d-7b9d-48eb-b913-f028c2748f31')"
debug: Sending command to instruments: au.capture('screenshot717ac72d-7b9d-48eb-b913-f028c2748f31')
info: [INSTSERVER] Sending command to instruments: au.capture('screenshot717ac72d-7b9d-48eb-b913-f028c2748f31')
info: [INST] 2013-06-25 15:55:34 +0000 Default: Got new command 4 from instruments: au.capture('screenshot717ac72d-7b9d-48eb-b913-f028c2748f31')
info: [INSTSERVER] Socket data received (48 bytes)
info: [INSTSERVER] Socket data being routed for 'cmd' event
info: [INSTSERVER] Got result from instruments: {"status":0,"value":""}
info: [INST] 2013-06-25 15:55:34 +0000 Debug: target.captureRectWithName("{origin:{x:0.00,y:0.00}, size:{height:568.00,width:320.00}}", "screenshot717ac72d-7b9d-48eb-b913-f028c2748f31")
       2013-06-25 15:55:34 +0000 Screenshot captured.
2013-06-25 15:55:34 +0000 Default: Command executed without response
info: [INST] 2013-06-25 15:55:34 +0000 Default: Result is not protocol compliant, wrapping
info: Responding to client with success: {"status":0,"value":"iVBORw0KGgoAAAANSUhEUgAAAoAAAARwCAYAAAB6j+UAAABAAElEQVR4AezdBZg1SXU//l5BFncnQIK7u1twd3dZgv6Q4EtwDQR39+Du7rC4u5MgwR32v59++M6/pt/uO3dm7n1n3plznqdvlxyvqu7TVdV99+u67rDDj4LyQHmgPFAeKA+UB8oD5YFd4oH9d4mdZWZ5oDxQHigPlAfKA+WB8sA/PFABYHWF8kB5oDxQHigPlAfKA7vMAxUA7rIGL3PLA+WB8kB5oDxQHigPVABYfaA8UB4oD5QHygPlgfLALvNABYC7rMHL3PJAeaA8UB4oD5QHygMVAFYfKA+UB8oD5YHyQHmgPLDLPFAB4C5r8DK3PFAeKA+UB8oDQw8c6UhHGhZVfod74MAdbl+Zt0M8cMQjHrE73/nO1/3TP/1Td8ITnrA77WlPu8qyr33ta93//M//dN/73ve6j33sY92f//znVfWVKQ+UB8oD5YE9PbD//vt3V7jCFbqLXexi3T3ucY89Eapkx3qgAsAd27T7vmEuTOc5z3m6S17ykt1FLnKR7qCDDpo06nSnO91K3R/+8IfuAx/4QPfud7+7+8QnPtH9/e9/X6mrxPo98M///M/d1a9+9Z7wb3/7W/f4xz9+XUxueMMbdic60Yl6mg9+8IN9gL4uBv9AvuAFL9hd4AIXmIv0wx/+cPeRj3xkBXe//fbr7nKXu3T61Dzw2Mc+dh60SZzzn//83cMe9rBV9a9//evX9N3Rj3707nWve90qumTufe97r+m7l770pf0DUmhyfsYzntG97GUvS7bO5YHeA5e5zGW6m970pt1JT3rS7gEPeEB5ZZ0ecE3693//98643Q7wm9/8pnvEIx7Ruf7NAzsuAPy3f/u3VXY/5znP6X7/+9+vKmszV77ylbtTnOIUK0VmjwQNywaBjRmtwMtf/vLupz/9abK7+mwp4ipXuUp34xvfeEMDS6B42ctetj8MiBe+8IWdm++f...","sessionId":"3aff874a-5782-4427-8d35-23f0d73fac5c"}
GET /wd/hub/session/3aff874a-5782-4427-8d35-23f0d73fac5c/screenshot 200 1575ms - 583.93kb
debug: Appium request initiated at /wd/hub/session/3aff874a-5782-4427-8d35-23f0d73fac5c/window_handles
error: uncaughtException date=Tue Jun 25 2013 11:55:36 GMT-0400 (EDT), pid=4097, uid=501, gid=20, cwd=/Applications/Appium.app/Contents/Resources/node_modules/appium, execPath=/Applications/Appium.app/Contents/Resources/node/bin/node, version=v0.10.12, argv=[/Applications/Appium.app/Contents/Resources/node/bin/node, /Applications/Appium.app/Contents/Resources/node_modules/appium/server.js, -U, 569cfe862065302d936177a807f5874af90dbe61, --app, /var/mobile/Applications/A4D6A0CC-2DEB-4FF5-801F-7AFBF1A15067/Documents/Myapp.app], rss=45666304, heapTotal=35809624, heapUsed=20629328, loadavg=[0.9716796875, 1.568359375, 1.95361328125], uptime=66716, trace=[column=11, file=net.js, function=errnoException, line=901, method=null, native=false, column=19, file=[as oncomplete] (net.js, function=Object.afterConnect, line=892, method=afterConnect, native=false], stack=[Error: connect ECONNREFUSED,     at errnoException (net.js:901:11),     at Object.afterConnect [as oncomplete] (net.js:892:19)]



--
http://appium.io
---
You received this message because you are subscribed to a topic in the Google Groups "Appium-discuss" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/appium-discuss/I01yEQfIfv8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to appium-discus...@googlegroups.com.
Visit this group at http://groups.google.com/group/appium-discuss.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Dan Cuellar

unread,
Jun 25, 2013, 12:14:27 PM6/25/13
to appium-...@googlegroups.com, Dan Cuellar
Here's the problem. You are not prelaunching the application. Go to APpium > Prefrences and select the prelaunch application checkbox. Inspector will not work unless the application is pre-launched

Jonathan Lipps

unread,
Jun 25, 2013, 12:19:29 PM6/25/13
to Justin Ison, Dan Cuellar, appium-...@googlegroups.com
Looks to me like the issue could be that connecting to the webview is not working. Connection refused makes me wonder if you have enabled remote debugging for mobile safari. If you haven't it could produce this error.

You received this message because you are subscribed to the Google Groups "Appium-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to appium-discus...@googlegroups.com.

Justin Ison

unread,
Jun 25, 2013, 12:33:44 PM6/25/13
to Jonathan Lipps, Dan Cuellar, appium-...@googlegroups.com
Hmm, so I dont have the Use Mobile Safari checked. Below are the steps I'm doing to get this error.

Step 1: $ ../../node/bin/node server.js -U '569cfe862065302d936177a807f5874af90dbe61' --app '/var/mobile/Applications/A4D6A0CC-2DEB-4FF5-801F-7AFBF1A15067/Documents/MyApp.app' --pre-launch

info: Welcome to Appium v0.7.3 (REV 120bb6813272efc128276bd212202e2cda0dea14)
info: Appium REST http interface listener started on 0.0.0.0:4723
   info  - socket.io started
debug: Appium request initiated at /wd/hub/status
info: Responding to client with success: {"status":0,"value":{"build":{"version":"0.7.3","revision":"120bb6813272efc128276bd212202e2cda0dea14"}},"sessionId":"95b03811-ccda-4370-b7c3-f554eda9b953"}
GET /wd/hub/status 200 7ms - 198
debug: Appium request initiated at /wd/hub/sessions
info: Responding to client with success: {"status":0,"value":[{"id":"95b03811-ccda-4370-b7c3-f554eda9b953","capabilities":{"version":"6.0","webStorageEnabled":false,"locationContextEnabled":false,"browserName":"iOS","platform":"MAC","javascriptEnabled":true,"databaseEnabled":false,"takesScreenshot":true}}],"sessionId":"95b03811-ccda-4370-b7c3-f554eda9b953"}
GET /wd/hub/sessions 200 2ms - 447
debug: Appium request initiated at /wd/hub/session/95b03811-ccda-4370-b7c3-f554eda9b953/execute
debug: Request received with params: {"script":"mobile: setCommandTimeout","args":[{"timeout":900}]}
info: Pushing command to appium work queue: "waitForDataTimeout = 900"
debug: Sending command to instruments: waitForDataTimeout = 900
info: [INSTSERVER] Sending command to instruments: waitForDataTimeout = 900
info: [INST] 2013-06-25 16:27:32 +0000 Debug: target.setDeviceOrientation("1")
       2013-06-25 16:27:41 +0000 Default: Got new command 2 from instruments: waitForDataTimeout = 900
info: [INST] 2013-06-25 16:27:41 +0000 Default: Result is not protocol compliant, wrapping
info: [INSTSERVER] Socket data received (49 bytes)
info: [INSTSERVER] Socket data being routed for 'cmd' event
info: [INSTSERVER] Got result from instruments: {"status":0,"value":900}
info: Responding to client with success: {"status":0,"value":900,"sessionId":"95b03811-ccda-4370-b7c3-f554eda9b953"}
POST /wd/hub/session/95b03811-ccda-4370-b7c3-f554eda9b953/execute 200 785ms - 88

Application loads on the device.... Everything is good.


Step 2: Launch Appium.app. 
Step 3: Set Use Remote Sever
Step 4: Click the (i) button

debug: Appium request initiated at /wd/hub/session/95b03811-ccda-4370-b7c3-f554eda9b953/source
info: Pushing command to appium work queue: "wd_frame.getPageSource()"
debug: Sending command to instruments: wd_frame.getPageSource()
info: [INSTSERVER] Sending command to instruments: wd_frame.getPageSource()
info: [INST] 2013-06-25 16:27:42 +0000 Default: Got new command 3 from instruments: wd_frame.getPageSource()
info: [INST] 2013-06-25 16:27:42 +0000 Default: Result is not protocol compliant, wrapping
info: [INSTSERVER] Socket data received (8192 bytes)
info: [INSTSERVER] Socket data received (6278 bytes)
info: [INSTSERVER] Socket data being routed for 'cmd' event
info: [INSTSERVER] Got result from instruments: {"status":0,"value":"{\"name\":\"Taxi Magic\",\"type\":\"UIAApplication\",\"label\":\"Myapp\",\"value\":null,\"rect\":{\"origin\":{\"x\":0,\"y\":20},\"size\":{\"width\":320,\"height\":548}},\"dom\":null,\"enabled\":true,\"valid\":true,\"visible\":true,\"children\":[{\"name\":null,\"type\":\"UIAWindow\",\"label\":null,\"value\":null,\"rect\":{\"origin\":{\"x\":0,\"y\":0},\"size\":{\"wi........

Applications then stops/crashes after the element list is retrieved...

GET /wd/hub/session/95b03811-ccda-4370-b7c3-f554eda9b953/screenshot 200 1499ms - 583.61kb
debug: Appium request initiated at /wd/hub/session/95b03811-ccda-4370-b7c3-f554eda9b953/window_handles
error: uncaughtException date=Tue Jun 25 2013 12:27:45 GMT-0400 (EDT), pid=4481, uid=501, gid=20, cwd=/Applications/Appium.app/Contents/Resources/node_modules/appium, execPath=/Applications/Appium.app/Contents/Resources/node/bin/node, version=v0.10.12, argv=[/Applications/Appium.app/Contents/Resources/node/bin/node, /Applications/Appium.app/Contents/Resources/node_modules/appium/server.js, -U, 569cfe862065302d936177a807f5874af90dbe61, --app, /var/mobile/Applications/A4D6A0CC-2DEB-4FF5-801F-7AFBF1A15067/Documents/Myapp.app, --pre-launch], rss=45371392, heapTotal=35807656, heapUsed=20555104, loadavg=[0.93212890625, 1.00244140625, 1.06640625], uptime=68645, trace=[column=11, file=net.js, function=errnoException, line=901, method=null, native=false, column=19, file=[as oncomplete] (net.js, function=Object.afterConnect, line=892, method=afterConnect, native=false], stack=[Error: connect ECONNREFUSED,     at errnoException (net.js:901:11),     at Object.afterConnect [as oncomplete] (net.js:892:19)]



Jonathan Lipps

unread,
Jun 25, 2013, 12:43:30 PM6/25/13
to Justin Ison, Dan Cuellar, appium-...@googlegroups.com
This is the line I'm concerned about:

debug: Appium request initiated at /wd/hub/session/95b03811-ccda-4370-b7c3-f554eda9b953/window_handles

The appium inspector is making a call to window_handles, which I believe attempts to connect to the remote debug port.

Ah… yes, that's gotta be it. On a real device that port won't even be open. So appium is crashing.

Looks like we need to make sure calls to window_handles don't crash when the remote debug port isn't available.

Dan, would you concur this is what's happening?

Dan Cuellar

unread,
Jun 25, 2013, 12:45:47 PM6/25/13
to appium-...@googlegroups.com, Justin Ison, Dan Cuellar
yes

Jonathan Lipps

unread,
Jun 25, 2013, 1:02:39 PM6/25/13
to Dan Cuellar, appium-...@googlegroups.com, Justin Ison
OK, we're tracking this issue here now:


On Jun 25, 2013, at 9:45 AM, Dan Cuellar <dancu...@gmail.com> wrote:

yes

Justin Ison

unread,
Jun 25, 2013, 1:06:36 PM6/25/13
to Dan Cuellar, appium-...@googlegroups.com
Thanks, guys. Do you need me to enter a bug?


On Tue, Jun 25, 2013 at 12:45 PM, Dan Cuellar <dancu...@gmail.com> wrote:
yes

Dan Cuellar

unread,
Jun 25, 2013, 1:15:16 PM6/25/13
to appium-...@googlegroups.com, Dan Cuellar
No we can handle that.

BTW: If you upgrade to appium 0.7.2 or higher, disabled developer mode and check the pre-launch setting you should be able to get your stuff working,

Justin Ison

unread,
Jun 25, 2013, 1:44:50 PM6/25/13
to Dan Cuellar, appium-...@googlegroups.com
Ah, that did it. Disabling the developer mode fixed the crash. Thanks.


On Tue, Jun 25, 2013 at 1:15 PM, Dan Cuellar <dancu...@gmail.com> wrote:
No we can handle that.

BTW: If you upgrade to appium 0.7.2 or higher, disabled developer mode and check the pre-launch setting you should be able to get your stuff working,

--

Dan Cuellar

unread,
Jun 25, 2013, 2:00:58 PM6/25/13
to appium-...@googlegroups.com, Dan Cuellar
Because of this crash, I changed the window switcher in inspector to only show up when developer mode is enabled a few weeks ago.

Irmi Barak

unread,
Mar 9, 2014, 7:07:05 PM3/9/14
to appium-...@googlegroups.com, Dan Cuellar, jus...@taximagic.com
Hey guys,
just got exactly the same issue with iphone 5 ios 7.
what do you mean by disabling developer mode? where? in appium settings?

guo...@starmobileinc.com

unread,
May 6, 2014, 12:14:09 AM5/6/14
to appium-...@googlegroups.com, jus...@taximagic.com
Dear all, 

I have the same issue here when I update appium.app to version 1.0.0. 

Appium server crashed after launching inspector. Could anyone please help and have a look at the log? 

Here is the log: 

error: uncaughtException: connect ECONNREFUSED date=Mon May 05 2014 23:58:18 GMT-0400 (EDT), pid=20442, uid=501, gid=20, cwd=/usr/local/lib/node_modules/appium, execPath=/usr/local/bin/node, version=v0.10.26, argv=[node, /usr/local/bin/appium, -a, localhost, -p, 4720, --no-reset, --orientation=LANDSCAPE, --app path/to/.appfile, -U, auto, -l], rss=53161984, heapTotal=56160000, heapUsed=18321280, loadavg=[0.60107421875, 0.72412109375, 0.7001953125], uptime=199929, trace=[column=11, file=net.js, function=errnoException, line=904, method=null, native=false, column=19, file=net.js, function=Object.afterConnect [as oncomplete], line=895, method=afterConnect [as oncomplete], native=false], stack=[Error: connect ECONNREFUSED,     at errnoException (net.js:904:11),     at Object.afterConnect [as oncomplete] (net.js:895:19)]

Aristotelis Kanellos

unread,
May 8, 2014, 12:02:07 PM5/8/14
to appium-...@googlegroups.com, jus...@taximagic.com
On 1.0.0 version I also get the same error.



--platform-name ios --app com.sen.iEvo -U auto --no-reset

debug: Appium request initiated at /wd/hub/session/054390c9-db3e-4c1b-b42c-d8f0a61060fa/contexts

debug: Request received with params: {}

error: uncaughtException: connect ECONNREFUSED date=Thu May 08 2014 18:52:30 GMT+0300 (EEST), pid=2058, uid=501, gid=20, cwd=/Applications/Appium.app/Contents/Resources/node_modules/appium, execPath=/Applications/Appium.app/Contents/Resources/node/bin/node, version=v0.10.26, argv=[/Applications/Appium.app/Contents/Resources/node/bin/node, /Applications/Appium.app/Contents/Resources/node_modules/appium/lib/server/main.js, --address, 172.25.3.60, --port, 4723, --command-timeout, 7200, --session-override, --app, com.branch.appName, --udid, 03f13146997c2cab508350a12dcfc8adfac73734, --default-device, --native-instruments-lib], rss=57221120, heapTotal=56160000, heapUsed=29155696, loadavg=[0.98291015625, 1.0322265625, 1.10205078125], uptime=83156, trace=[column=11, file=net.js, function=errnoException, line=904, method=null, native=false, column=19, file=net.js, function=Object.afterConnect [as oncomplete], line=895, method=afterConnect [as oncomplete], native=false], stack=[Error: connect ECONNREFUSED,     at errnoException (net.js:904:11),     at Object.afterConnect [as oncomplete] (net.js:895:19)]


Any ideas of what is going wrong?

Regards,
Aristotelis

Jonathan Lipps

unread,
May 8, 2014, 12:12:34 PM5/8/14
to Aristotelis Kanellos, appium-...@googlegroups.com, jus...@taximagic.com
The crash should be fixed with this:


You received this message because you are subscribed to the Google Groups "Appium-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to appium-discus...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Katherine Yekhilevsky

unread,
May 8, 2014, 12:28:50 PM5/8/14
to appium-...@googlegroups.com, Aristotelis Kanellos, jus...@taximagic.com
And what I should do about your reply?
I have the same problem when my app is crashing when Inspector is launched.
Appium 1.0.0, Prelaunch is checked all the flags are inserted.

Aristotelis Kanellos

unread,
May 11, 2014, 2:37:27 PM5/11/14
to appium-...@googlegroups.com, Aristotelis Kanellos, jus...@taximagic.com
Thank you Jonathan for the reply. I will wait for the fix. 

Keegan Parker

unread,
May 20, 2014, 10:17:52 AM5/20/14
to appium-...@googlegroups.com, Aristotelis Kanellos, jus...@taximagic.com
Hi Jonathan,

Could you give me an ETA on when this fix will be deployed to the actual build (something like 1.0.1)? Thanks.

Nakshtra

unread,
Jun 5, 2014, 2:26:39 AM6/5/14
to appium-...@googlegroups.com, teli...@gmail.com, jus...@taximagic.com
Hi,
Is this fixed in version 1.1.0 as I am getting same error.

Evgeny Tkachenko

unread,
Jun 9, 2014, 9:56:42 AM6/9/14
to appium-...@googlegroups.com, jus...@taximagic.com
I got the same problem

вторник, 25 июня 2013 г., 2:04:04 UTC+4 пользователь isonic1 написал:
Reply all
Reply to author
Forward
0 new messages