ADB Not Getting Window?

I keep running into this issue across Android devices and recent Appium versions (1.4.10 - 1.5-beta7) and with sporadically. Once in a while it will work, but most of the time I get stuck in a loop with this output:

info: [debug] [ADB] Running /Users/aarongrider/android-sdk/platform-tools/adb with args: ["-s","0317d28b08e48b79","shell","dumpsys","window","windows"]
info: [debug] [ADB] Getting focused package and activity
info: [debug] [ADB] Getting connected devices...
info: [debug] [ADB] 1 device(s) connected

Please advise as to what might be causing this. This appears to be a bug recently introduced in Appium.

Here is a full log:

info: [Appium] Welcome to Appium v1.5.0-beta7 (REV 9f3649bcd34db3f327c5e7d81952c3ebed8a1c49)
info: [Appium] Appium REST http interface listener started on 0.0.0.0:4840
info: [debug] [Appium] Non-default server args: {"port":4840}
found 0 associations
found 1 connections:
     1:	flags=82<CONNECTED,PREFERRED>
	outif lo0
	src 127.0.0.1 port 56129
	dst 127.0.0.1 port 4840
	rank info not available
	TCP aux info available

Connection to 0.0.0.0 port 4840 [tcp/opcua-tcp] succeeded!
[['', u'default'], [u'http://dashboard.thechurchapp.org/platform/feeds/sermon.php?appid=3508&tabinstanceid=&handlerid=5&sermonid=249469', u'detail'], [u'http://dashboard.thechurchapp.org/platform/feeds/sermon.php?appid=3508&tabinstanceid=&handlerid=5&sermonid=635401', u'detail']]
Screenshot Count: 3
info: [HTTP] --> POST /wd/hub/session 
info: [MJSONWP] Calling AppiumDriver.createSession() with args: [{"deviceName":"aDevice","optionalIntentArguments":"sapbmzcqt://sap/eyJoYW5kbGVyIiA6ICJkZWZhdWx0IiwgInVybCIgOiAiIn0=","udid":"0317d28b08e48b79","ap...
info: [Appium] Creating new AndroidDriver session
info: [BaseDriver] Session created with session id: 9b4a5627-81ae-4903-b883-4963a4a5bb09
info: [debug] [AndroidDriver] Getting Java version
info: [AndroidDriver] Java version is: 1.7.0_79
info: [ADB] Checking whether adb is present
info: [ADB] Using adb from /Users/aarongrider/android-sdk/platform-tools/adb
info: [BaseDriver] Using local app /Users/aarongrider/ssa-jobs/24614/BMZCQT.apk
info: [debug] [AndroidDriver] Checking whether app is actually present
info: [AndroidDriver] Starting Android session
info: [AndroidDriver] Retrieving device list
info: [debug] [ADB] Trying to find a connected android device
info: [debug] [ADB] Getting connected devices...
info: [debug] [ADB] 1 device(s) connected
info: [AndroidDriver] Found device: 0317d28b08e48b79
info: [debug] [ADB] Setting device id to 0317d28b08e48b79
info: [debug] [ADB] Running /Users/aarongrider/android-sdk/platform-tools/adb with args: ["-s","0317d28b08e48b79","wait-for-device"]
info: [debug] [ADB] Getting connected devices...
info: [debug] [ADB] 1 device(s) connected
info: [debug] [ADB] Running /Users/aarongrider/android-sdk/platform-tools/adb with args: ["-s","0317d28b08e48b79","shell","echo","ping"]
info: [debug] [Logcat] Starting logcat capture
info: [debug] [AndroidDriver] Pushing settings apk to device...
info: [debug] [ADB] Running /Users/aarongrider/android-sdk/platform-tools/adb with args: ["-s","0317d28b08e48b79","install","/usr/local/lib/node_modules/appium/node_modules/appium-android-driver/node_modules/io.appium.settings/bin/settings_apk-debug.apk"]
info: [debug] [AndroidDriver] Pushing unlock helper app to device...
info: [debug] [ADB] Running /Users/aarongrider/android-sdk/platform-tools/adb with args: ["-s","0317d28b08e48b79","install","/usr/local/lib/node_modules/appium/node_modules/appium-android-driver/node_modules/appium-unlock/bin/unlock_apk-debug.apk"]
info: [debug] [AndroidDriver] Parsing package and activity from app manifest
info: [ADB] Checking whether aapt is present
info: [ADB] Using aapt from /Users/aarongrider/android-sdk/build-tools/23.0.0/aapt
info: [ADB] Extracting package and launch activity from manifest
info: [debug] [ADB] badging package: com.subsplash.thechurchapp.s_BMZCQT
info: [debug] [ADB] badging act: com.subsplash.thechurchapp.SplashActivity
info: [debug] [AndroidDriver] Parsed package and activity are: com.subsplash.thechurchapp.s_BMZCQT/com.subsplash.thechurchapp.SplashActivity
info: [debug] [ADB] Uninstalling com.subsplash.thechurchapp.s_BMZCQT
info: [debug] [ADB] Getting connected devices...
info: [debug] [ADB] 1 device(s) connected
info: [debug] [ADB] Running /Users/aarongrider/android-sdk/platform-tools/adb with args: ["-s","0317d28b08e48b79","shell","am","force-stop","com.subsplash.thechurchapp.s_BMZCQT"]
info: [debug] [ADB] Running /Users/aarongrider/android-sdk/platform-tools/adb with args: ["-s","0317d28b08e48b79","uninstall","com.subsplash.thechurchapp.s_BMZCQT"]
info: [ADB] App was not uninstalled, maybe it wasn't on device?
info: [AndroidDriver] Remote apk path is /data/local/tmp/dc1560ebb45a647c93b6400bc63bef89.apk
info: [debug] [ADB] Getting connected devices...
info: [debug] [ADB] 1 device(s) connected
info: [debug] [ADB] Running /Users/aarongrider/android-sdk/platform-tools/adb with args: ["-s","0317d28b08e48b79","shell","ls","/data/local/tmp/dc1560ebb45a647c93b6400bc63bef89.apk"]
info: [debug] [AndroidDriver] Checking if app is installed
info: [debug] [ADB] Getting install status for com.subsplash.thechurchapp.s_BMZCQT
info: [ADB] Getting device API level
info: [debug] [ADB] Getting connected devices...
info: [debug] [ADB] 1 device(s) connected
info: [debug] [ADB] Running /Users/aarongrider/android-sdk/platform-tools/adb with args: ["-s","0317d28b08e48b79","shell","getprop","ro.build.version.sdk"]
info: [debug] [ADB] Getting connected devices...
info: [debug] [ADB] 1 device(s) connected
info: [debug] [ADB] Running /Users/aarongrider/android-sdk/platform-tools/adb with args: ["-s","0317d28b08e48b79","shell","pm","list","packages","-3","com.subsplash.thechurchapp.s_BMZCQT"]
info: [debug] [ADB] App is  not installed
info: [AndroidDriver] Apk is not yet installed
info: [AndroidDriver] installing apk from remote
info: [debug] [ADB] Getting connected devices...
info: [debug] [ADB] 1 device(s) connected
info: [debug] [ADB] Running /Users/aarongrider/android-sdk/platform-tools/adb with args: ["-s","0317d28b08e48b79","shell","mkdir","-p","/data/local/tmp"]
info: [AndroidDriver] Clearing out any existing remote apks with the same hash
info: [debug] [AndroidDriver] Removing any old apks
info: [debug] [AndroidDriver] Except ["dc1560ebb45a647c93b6400bc63bef89"]
info: [debug] [ADB] Getting connected devices...
info: [debug] [ADB] 1 device(s) connected
info: [debug] [ADB] Running /Users/aarongrider/android-sdk/platform-tools/adb with args: ["-s","0317d28b08e48b79","shell","ls","/data/local/tmp/*.apk"]
info: [AndroidDriver] Will remove /data/local/tmp/59db9c3fb83b233aab012aa1b3e3951c.apk
info: [debug] [ADB] Getting connected devices...
info: [debug] [ADB] 1 device(s) connected
info: [debug] [ADB] Running /Users/aarongrider/android-sdk/platform-tools/adb with args: ["-s","0317d28b08e48b79","shell","rm","/data/local/tmp/59db9c3fb83b233aab012aa1b3e3951c.apk"]
info: [AndroidDriver] Pushing com.subsplash.thechurchapp.s_BMZCQT to device. Will wait up to 90000 milliseconds before aborting
info: [debug] [ADB] Running /Users/aarongrider/android-sdk/platform-tools/adb with args: ["-s","0317d28b08e48b79","push","/Users/aarongrider/ssa-jobs/24614/BMZCQT.apk","/data/local/tmp/dc1560ebb45a647c93b6400bc63bef89.apk"]
info: [debug] [ADB] Uninstalling com.subsplash.thechurchapp.s_BMZCQT
info: [debug] [ADB] Getting connected devices...
info: [debug] [ADB] 1 device(s) connected
info: [debug] [ADB] Running /Users/aarongrider/android-sdk/platform-tools/adb with args: ["-s","0317d28b08e48b79","shell","am","force-stop","com.subsplash.thechurchapp.s_BMZCQT"]
info: [debug] [ADB] Running /Users/aarongrider/android-sdk/platform-tools/adb with args: ["-s","0317d28b08e48b79","uninstall","com.subsplash.thechurchapp.s_BMZCQT"]
info: [ADB] App was not uninstalled, maybe it wasn't on device?
info: [debug] [ADB] Getting connected devices...
info: [debug] [ADB] 1 device(s) connected
info: [debug] [ADB] Running /Users/aarongrider/android-sdk/platform-tools/adb with args: ["-s","0317d28b08e48b79","shell","pm","install","-r","/data/local/tmp/dc1560ebb45a647c93b6400bc63bef89.apk"]
info: [debug] [AndroidDriver] Extracting strings from apk /Users/aarongrider/ssa-jobs/24614/BMZCQT.apk null /var/folders/68/hzky2v1s2zl1896n9ly7rp480000gn/T/com.subsplash.thechurchapp.s_BMZCQT
info: [debug] [ADB] Extracting strings for language: default
info: [debug] [ADB] Getting connected devices...
info: [debug] [ADB] 1 device(s) connected
info: [debug] [ADB] Running /Users/aarongrider/android-sdk/platform-tools/adb with args: ["-s","0317d28b08e48b79","shell","getprop","persist.sys.language"]
info: [debug] [ADB] Current device property 'persist.sys.language': 
info: [debug] [ADB] No strings.xml for language '', getting default strings.xml
info: [debug] [ADB] Reading strings from converted strings.json
warn: [AndroidDriver] Could not get strings, continuing anyway
info: [debug] [ADB] Getting connected devices...
info: [debug] [ADB] 1 device(s) connected
info: [debug] [ADB] Running /Users/aarongrider/android-sdk/platform-tools/adb with args: ["-s","0317d28b08e48b79","shell","echo"]
info: [ADB] Checking whether adb is present
info: [ADB] Using adb from /Users/aarongrider/android-sdk/platform-tools/adb
info: [debug] [ADB] Forwarding system: 4724 to device: 4724
info: [debug] [UiAutomator] Starting UiAutomator
info: [debug] [UiAutomator] Parsing uiautomator jar
info: [debug] [ADB] Attempting to kill all uiautomator processes
info: [debug] [ADB] Getting all processes with uiautomator
info: [debug] [ADB] Getting connected devices...
info: [debug] [ADB] 1 device(s) connected
info: [ADB] No uiautomator process found to kill, continuing...
info: [debug] [UiAutomator] Executing command /Users/aarongrider/android-sdk/platform-tools/adb shell,uiautomator,runtest,AppiumBootstrap.jar,-c,io.appium.android.bootstrap.Bootstrap,-e,pkg,com.subsplash.thechurchapp.s_BMZCQT,-e,disableAndroidWatchers,false
info: [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Registered crash watchers.
info: [AndroidBootstrap] Android bootstrap socket is now connected
info: [debug] [ADB] Getting connected devices...
info: [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Client connected
info: [debug] [ADB] 1 device(s) connected
info: [debug] [ADB] Running /Users/aarongrider/android-sdk/platform-tools/adb with args: ["-s","0317d28b08e48b79","shell","dumpsys","window"]
info: [AndroidDriver] Screen already unlocked, doing nothing
info: [ADB] Getting device API level
info: [debug] [ADB] Getting connected devices...
info: [debug] [ADB] 1 device(s) connected
info: [debug] [ADB] Running /Users/aarongrider/android-sdk/platform-tools/adb with args: ["-s","0317d28b08e48b79","shell","getprop","ro.build.version.sdk"]
info: [debug] [ADB] Getting connected devices...
info: [debug] [ADB] 1 device(s) connected
info: [debug] [ADB] Running /Users/aarongrider/android-sdk/platform-tools/adb with args: ["-s","0317d28b08e48b79","shell","am","start","-n","com.subsplash.thechurchapp.s_BMZCQT/com.subsplash.thechurchapp.SplashActivity","-S","-a","android.intent.action.MAIN","-c","android.intent.category.LAUNCHER","-f","0x10200000","sapbmzcqt://sap/eyJoYW5kbGVyIiA6ICJkZWZhdWx0IiwgInVybCIgOiAiIn0="]
info: [debug] [ADB] Waiting for pkg: com.subsplash.thechurchapp.s_BMZCQT and activity: com.subsplash.thechurchapp.SplashActivity to be focused
info: [debug] [ADB] Getting focused package and activity
info: [debug] [ADB] Getting connected devices...
info: [debug] [ADB] 1 device(s) connected
info: [debug] [ADB] Running /Users/aarongrider/android-sdk/platform-tools/adb with args: ["-s","0317d28b08e48b79","shell","dumpsys","window","windows"]
info: [debug] [ADB] Getting focused package and activity
info: [debug] [ADB] Getting connected devices...
info: [debug] [ADB] 1 device(s) connected
info: [debug] [ADB] Running /Users/aarongrider/android-sdk/platform-tools/adb with args: ["-s","0317d28b08e48b79","shell","dumpsys","window","windows"]
info: [debug] [ADB] Getting focused package and activity
info: [debug] [ADB] Getting connected devices...
info: [debug] [ADB] 1 device(s) connected
info: [debug] [ADB] Running /Users/aarongrider/android-sdk/platform-tools/adb with args: ["-s","0317d28b08e48b79","shell","dumpsys","window","windows"]
info: [debug] [ADB] Getting focused package and activity
info: [debug] [ADB] Getting connected devices...
info: [debug] [ADB] 1 device(s) connected
info: [debug] [ADB] Running /Users/aarongrider/android-sdk/platform-tools/adb with args: ["-s","0317d28b08e48b79","shell","dumpsys","window","windows"]
info: [debug] [ADB] Getting focused package and activity
info: [debug] [ADB] Getting connected devices...
info: [debug] [ADB] 1 device(s) connected
info: [debug] [ADB] Running /Users/aarongrider/android-sdk/platform-tools/adb with args: ["-s","0317d28b08e48b79","shell","dumpsys","window","windows"]
info: [debug] [ADB] Getting focused package and activity
info: [debug] [ADB] Getting connected devices...
info: [debug] [ADB] 1 device(s) connected
info: [debug] [ADB] Running /Users/aarongrider/android-sdk/platform-tools/adb with args: ["-s","0317d28b08e48b79","shell","dumpsys","window","windows"]
info: [debug] [ADB] Getting focused package and activity
info: [debug] [ADB] Getting connected devices...
info: [debug] [ADB] 1 device(s) connected
info: [debug] [ADB] Running /Users/aarongrider/android-sdk/platform-tools/adb with args: ["-s","0317d28b08e48b79","shell","dumpsys","window","windows"]
info: [debug] [ADB] Getting focused package and activity
info: [debug] [ADB] Getting connected devices...
info: [debug] [ADB] 1 device(s) connected
info: [debug] [ADB] Running /Users/aarongrider/android-sdk/platform-tools/adb with args: ["-s","0317d28b08e48b79","shell","dumpsys","window","windows"]
info: [debug] [ADB] Getting focused package and activity
info: [debug] [ADB] Getting connected devices...
info: [debug] [ADB] 1 device(s) connected
info: [debug] [ADB] Running /Users/aarongrider/android-sdk/platform-tools/adb with args: ["-s","0317d28b08e48b79","shell","dumpsys","window","windows"]
info: [debug] [ADB] Getting focused package and activity
info: [debug] [ADB] Getting connected devices...
info: [debug] [ADB] 1 device(s) connected
info: [debug] [ADB] Running /Users/aarongrider/android-sdk/platform-tools/adb with args: ["-s","0317d28b08e48b79","shell","dumpsys","window","windows"]
info: [debug] [ADB] Getting focused package and activity
info: [debug] [ADB] Getting connected devices...
info: [debug] [ADB] 1 device(s) connected
info: [debug] [ADB] Running /Users/aarongrider/android-sdk/platform-tools/adb with args: ["-s","0317d28b08e48b79","shell","dumpsys","window","windows"]
info: [debug] [ADB] Getting focused package and activity
info: [debug] [ADB] Getting connected devices...
info: [debug] [ADB] 1 device(s) connected
info: [debug] [ADB] Running /Users/aarongrider/android-sdk/platform-tools/adb with args: ["-s","0317d28b08e48b79","shell","dumpsys","window","windows"]
info: [debug] [ADB] Getting focused package and activity
info: [debug] [ADB] Getting connected devices...
info: [debug] [ADB] 1 device(s) connected
info: [debug] [ADB] Running /Users/aarongrider/android-sdk/platform-tools/adb with args: ["-s","0317d28b08e48b79","shell","dumpsys","window","windows"]
info: [debug] [ADB] Getting focused package and activity
info: [debug] [ADB] Getting connected devices...
info: [debug] [ADB] 1 device(s) connected
info: [debug] [ADB] Running /Users/aarongrider/android-sdk/platform-tools/adb with args: ["-s","0317d28b08e48b79","shell","dumpsys","window","windows"]
info: [debug] [ADB] Getting focused package and activity
info: [debug] [ADB] Getting connected devices...
info: [debug] [ADB] 1 device(s) connected
info: [debug] [ADB] Running /Users/aarongrider/android-sdk/platform-tools/adb with args: ["-s","0317d28b08e48b79","shell","dumpsys","window","windows"]
info: [debug] [ADB] Getting focused package and activity
info: [debug] [ADB] Getting connected devices...
info: [debug] [ADB] 1 device(s) connected
info: [debug] [ADB] Running /Users/aarongrider/android-sdk/platform-tools/adb with args: ["-s","0317d28b08e48b79","shell","dumpsys","window","windows"]
info: [debug] [ADB] Getting focused package and activity
info: [debug] [ADB] Getting connected devices...
info: [debug] [ADB] 1 device(s) connected
info: [debug] [ADB] Running /Users/aarongrider/android-sdk/platform-tools/adb with args: ["-s","0317d28b08e48b79","shell","dumpsys","window","windows"]
info: [debug] [ADB] Getting focused package and activity
info: [debug] [ADB] Getting connected devices...
info: [debug] [ADB] 1 device(s) connected
info: [debug] [ADB] Running /Users/aarongrider/android-sdk/platform-tools/adb with args: ["-s","0317d28b08e48b79","shell","dumpsys","window","windows"]
info: [debug] [ADB] Getting focused package and activity
info: [debug] [ADB] Getting connected devices...
info: [debug] [ADB] 1 device(s) connected
info: [debug] [ADB] Running /Users/aarongrider/android-sdk/platform-tools/adb with args: ["-s","0317d28b08e48b79","shell","dumpsys","window","windows"]
info: [debug] [ADB] Getting focused package and activity
info: [debug] [ADB] Getting connected devices...
info: [debug] [ADB] 1 device(s) connected
info: [debug] [ADB] Running /Users/aarongrider/android-sdk/platform-tools/adb with args: ["-s","0317d28b08e48b79","shell","dumpsys","window","windows"]
info: [debug] [ADB] Getting focused package and activity
info: [debug] [ADB] Getting connected devices...
info: [debug] [ADB] 1 device(s) connected
info: [debug] [ADB] Running /Users/aarongrider/android-sdk/platform-tools/adb with args: ["-s","0317d28b08e48b79","shell","dumpsys","window","windows"]
info: [debug] [ADB] Getting focused package and activity
info: [debug] [ADB] Getting connected devices...
info: [debug] [ADB] 1 device(s) connected

Yes looks like a bug… You can raise this in github appium repo… Appium team will help… What java client version ur using ??? Latest ?

Latest (8u60). Is there a different version I should try?

It looks like issue from appium server end and not at java client end.