Skip to content

Instantly share code, notes, and snippets.

@rockbot
Last active December 21, 2015 09:28
Show Gist options
  • Save rockbot/6284980 to your computer and use it in GitHub Desktop.
Save rockbot/6284980 to your computer and use it in GitHub Desktop.

Revisions

  1. rockbot revised this gist Aug 20, 2013. 2 changed files with 20 additions and 24 deletions.
    24 changes: 4 additions & 20 deletions gistfile1.sh
    Original file line number Diff line number Diff line change
    @@ -5,7 +5,7 @@ info: Appium REST http interface listener started on 0.0.0.0:4730
    debug: Appium request initiated at /wd/hub/session
    debug: Request received with params: {"desiredCapabilities":{"browserName":"Android","device":"Android","platform":"Mac","version":"6.0","app":"/Users/rockbot/dev/appium/sample-code/apps/ApiDemos/bin/ApiDemos-debug.apk","app-package":"com.example.android.apis","app-activity":".ApiDemos","javascriptEnabled":true}}
    info: Using local app from desiredCaps: /Users/rockbot/dev/appium/sample-code/apps/ApiDemos/bin/ApiDemos-debug.apk
    info: Creating new appium session 9d55e94a-9454-4c0a-b1f3-965450338254
    info: Creating new appium session 6be986a3-703d-49dc-b703-9f29a9a45abc
    info: Starting android appium
    debug: Using fast reset? true
    info: Preparing device for session
    @@ -43,25 +43,9 @@ info: [ADB STDOUT] io.appium.android.bootstrap.Bootstrap:
    info: [ADB STDOUT] INSTRUMENTATION_STATUS: numtests=1
    info: [ADB STDOUT] INSTRUMENTATION_STATUS: test=testRunServer
    info: [ADB STDOUT] INSTRUMENTATION_STATUS_CODE: 1
    info: [ADB] Connecting to server on device...
    info: [ANDROID] [info] Socket opened on port 4726
    info: [ADB] Connecting to server on device...
    info: [ANDROID] [info] Appium Socket Server Ready
    info: [ANDROID] [info] Loading json...
    info: [ADB] Connected!
    info: [ADB] Waking up device if it's not alive
    info: Pushing command to appium work queue: ["wake",{}]
    info: [ADB] Sending command to android: {"cmd":"action","action":"wake","params":{}}
    info: [ANDROID] [info] json loading complete.
    info: Didn't get a new command in 60 secs, shutting down...
    info: [ADB] Pressing the HOME button
    warn: Trying to run a command when one is already in progress. Will spin a bit and try again
    info: Stopping logcat capture
    warn: Android did not shut down fast enough, calling it gone
    error: ADB quit before it successfully launched
    error: Failed to start an Appium session, err was: ADB quit unexpectedly before successfully launching
    info: Responding to client with error: {"status":6,"value":{"message":"A session is either terminated or not started","origValue":"ADB quit unexpectedly before successfully launching"},"sessionId":"9d55e94a-9454-4c0a-b1f3-965450338254"}
    POST /wd/hub/session 500 70226ms - 225
    info: Clearing out appium devices
    info: [ADB] Not uninstalling app since server started with --full-reset or --no-reset
    info: Clearing out appium devices
    info: Sent shutdown command, waiting for ADB to stop...
    error: uncaughtException date=Tue Aug 20 2013 11:08:07 GMT-0700 (PDT), pid=7614, uid=501, gid=20, cwd=/Users/rockbot/dev/appium, execPath=/usr/local/Cellar/node/0.10.13/bin/node, version=v0.10.13, argv=[node, /Users/rockbot/dev/appium/server.js, --udid, 015d3fbace3c0813, -p, 4730, -dp, 4726], rss=39514112, heapTotal=32171264, heapUsed=17271688, loadavg=[0.6494140625, 0.64013671875, 0.5048828125], uptime=348339, 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)]
    rockbot@rocksauce:appium$
    20 changes: 16 additions & 4 deletions gistfile2.sh
    Original file line number Diff line number Diff line change
    @@ -2,11 +2,23 @@ rockbot@rocksauce:apidemos$ APPIUM_PORT=4730 mocha -t 60000 basic.js


    0 passing (1 minutes)
    0 passing (4 seconds)
    1 failing

    1) basic "before each" hook:
    Error: timeout of 60000ms exceeded
    at null.<anonymous> (/usr/local/share/npm/lib/node_modules/mocha/lib/runnable.js:165:14)
    at Timer.listOnTimeout [as ontimeout] (timers.js:110:15)
    Uncaught AssertionError: expected { [Error: socket hang up] code: 'ECONNRESET' } to not exist
    at /Users/rockbot/dev/appium/test/helpers/driverblock.js:42:18
    at Request._callback (/Users/rockbot/dev/appium/node_modules/wd/lib/webdriver.js:262:22)
    at self.callback (/Users/rockbot/dev/appium/node_modules/wd/node_modules/request/index.js:148:22)
    at Request.EventEmitter.emit (events.js:95:17)
    at ClientRequest.self.clientErrorHandler (/Users/rockbot/dev/appium/node_modules/wd/node_modules/request/index.js:257:10)
    at ClientRequest.EventEmitter.emit (events.js:95:17)
    at Socket.socketOnEnd [as onend] (http.js:1549:9)
    at Socket.g (events.js:175:14)
    at Socket.EventEmitter.emit (events.js:117:20)
    at _stream_readable.js:910:16
    at process._tickCallback (node.js:415:13)



    rockbot@rocksauce:apidemos$
  2. rockbot created this gist Aug 20, 2013.
    67 changes: 67 additions & 0 deletions gistfile1.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,67 @@
    rockbot@rocksauce:appium$ node server.js --udid 015d3fbace3c0813 -p 4730 -dp 4726
    info: Welcome to Appium v0.8.5 (REV ec3895f283e7b1702fd6a2f4d1310a4d851eafdd)
    info: Appium REST http interface listener started on 0.0.0.0:4730
    info - socket.io started
    debug: Appium request initiated at /wd/hub/session
    debug: Request received with params: {"desiredCapabilities":{"browserName":"Android","device":"Android","platform":"Mac","version":"6.0","app":"/Users/rockbot/dev/appium/sample-code/apps/ApiDemos/bin/ApiDemos-debug.apk","app-package":"com.example.android.apis","app-activity":".ApiDemos","javascriptEnabled":true}}
    info: Using local app from desiredCaps: /Users/rockbot/dev/appium/sample-code/apps/ApiDemos/bin/ApiDemos-debug.apk
    info: Creating new appium session 9d55e94a-9454-4c0a-b1f3-965450338254
    info: Starting android appium
    debug: Using fast reset? true
    info: Preparing device for session
    info: Checking whether app is actually present
    info: Checking whether adb is present
    info: [ADB] Using adb from /usr/local/adt/sdk/tools/adb
    info: Trying to find a connected android device
    info: [ADB] Getting connected devices...
    info: [ADB] 1 device(s) connected
    info: [ADB] Setting device id to 015d3fbace3c0813
    info: Found device, no need to retry
    info: [ADB] Waiting for device 015d3fbace3c0813 to be ready and to respond to shell commands (timeout = 5)
    info: Starting logcat capture
    info: Checking whether we need to run fast reset
    debug: Checking app cert for /tmp/com.example.android.apis.clean.apk: java -jar "/Users/rockbot/dev/appium/app/android/verify.jar" "/tmp/com.example.android.apis.clean.apk"
    debug: App already signed.
    debug: Checking app cert for /Users/rockbot/dev/appium/sample-code/apps/ApiDemos/bin/ApiDemos-debug.apk: java -jar "/Users/rockbot/dev/appium/app/android/verify.jar" "/Users/rockbot/dev/appium/sample-code/apps/ApiDemos/bin/ApiDemos-debug.apk"
    debug: App already signed.
    debug: App signed? true /Users/rockbot/dev/appium/sample-code/apps/ApiDemos/bin/ApiDemos-debug.apk
    debug: java -jar "/Users/rockbot/dev/appium/app/android/strings_from_apk.jar" "/Users/rockbot/dev/appium/sample-code/apps/ApiDemos/bin/ApiDemos-debug.apk" "/tmp/com.example.android.apis"
    info: [ADB] Not uninstalling app since server started with --full-reset or --no-reset
    info: Determining app install/clean status
    debug: Getting install/clean status for com.example.android.apis
    debug: Running fast reset clean: "/usr/local/adt/sdk/tools/adb" -s 015d3fbace3c0813 shell am instrument com.example.android.apis.clean/clean.apk.Clean
    info: [ADB] Forwarding system:4726 to device:4726
    boom success
    info: [ADB] Pushing appium bootstrap to device...
    info: Running bootstrap
    info: "/usr/local/adt/sdk/tools/adb" -s 015d3fbace3c0813 shell uiautomator runtest AppiumBootstrap.jar -c io.appium.android.bootstrap.Bootstrap -e devicePort 4726
    info: [ADB STDOUT] INSTRUMENTATION_STATUS: current=1
    info: [ADB STDOUT] INSTRUMENTATION_STATUS: id=UiAutomatorTestRunner
    info: [ADB STDOUT] INSTRUMENTATION_STATUS: class=io.appium.android.bootstrap.Bootstrap
    info: [ADB STDOUT] INSTRUMENTATION_STATUS: stream=
    info: [ADB STDOUT] io.appium.android.bootstrap.Bootstrap:
    info: [ADB STDOUT] INSTRUMENTATION_STATUS: numtests=1
    info: [ADB STDOUT] INSTRUMENTATION_STATUS: test=testRunServer
    info: [ADB STDOUT] INSTRUMENTATION_STATUS_CODE: 1
    info: [ADB] Connecting to server on device...
    info: [ANDROID] [info] Socket opened on port 4726
    info: [ANDROID] [info] Appium Socket Server Ready
    info: [ANDROID] [info] Loading json...
    info: [ADB] Connected!
    info: [ADB] Waking up device if it's not alive
    info: Pushing command to appium work queue: ["wake",{}]
    info: [ADB] Sending command to android: {"cmd":"action","action":"wake","params":{}}
    info: [ANDROID] [info] json loading complete.
    info: Didn't get a new command in 60 secs, shutting down...
    info: [ADB] Pressing the HOME button
    warn: Trying to run a command when one is already in progress. Will spin a bit and try again
    info: Stopping logcat capture
    warn: Android did not shut down fast enough, calling it gone
    error: ADB quit before it successfully launched
    error: Failed to start an Appium session, err was: ADB quit unexpectedly before successfully launching
    info: Responding to client with error: {"status":6,"value":{"message":"A session is either terminated or not started","origValue":"ADB quit unexpectedly before successfully launching"},"sessionId":"9d55e94a-9454-4c0a-b1f3-965450338254"}
    POST /wd/hub/session 500 70226ms - 225
    info: Clearing out appium devices
    info: [ADB] Not uninstalling app since server started with --full-reset or --no-reset
    info: Clearing out appium devices
    info: Sent shutdown command, waiting for ADB to stop...
    12 changes: 12 additions & 0 deletions gistfile2.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,12 @@
    rockbot@rocksauce:apidemos$ APPIUM_PORT=4730 mocha -t 60000 basic.js


    0 passing (1 minutes)
    1 failing

    1) basic "before each" hook:
    Error: timeout of 60000ms exceeded
    at null.<anonymous> (/usr/local/share/npm/lib/node_modules/mocha/lib/runnable.js:165:14)
    at Timer.listOnTimeout [as ontimeout] (timers.js:110:15)