title: ADB commandline Hanging during install (PhoneGap)
body: <p>My Phonegap app refuses to load onto my Android device (even the HellowWorld default app is refusing to load)</p>
  
  <p>Everything was running just great until today.
  Here's my console log:</p>
  
  <pre><code>***\&gt;adb devices
  List of devices attached
  4c05609b        device
  
  ***\&gt;phonegap run --device -V android
  [phonegap] detecting Android SDK environment...
  [phonegap] using the local environment
  [phonegap] compiling Android...
  [phonegap] Generating config.xml from defaults for platform "android"
  [phonegap] Compiling app on platform "android" via command "cmd" /c ***\platforms\android\cordova\build
  [phonegap] Platform "android" compiled successfully.
  [phonegap] successfully compiled Android app
  [phonegap] installing app onto device
  [phonegap] Generating config.xml from defaults for platform "android"
  [phonegap] Running app on platform "android" via command "cmd" /c ***\platforms\android\cordova\run --device
  </code></pre>
  
  <p>It just sits there saying running... forever.</p>
  
  <p>I have another terminal window open with <code>adb logcat</code> running and at some point (maybe 10-15 seconds into that last line getting printed) it stops logging. Termination of the process and subsequent calls to <code>adb logcat</code> result in more hanging (no logging at all)</p>
  
  <p>So then I have to do a kill-server, start-server to break out of this endless hanging at which point the phonegap process terminates with:</p>
  
  <pre><code>       [error] An error occurred while running the android project.
  ***\platforms\android\cordova\node_modules\q\q.js:126
                      throw e;
                            ^
  ERROR: Failed to launch application on device: ERROR: Failed to install apk to d
  evice: Error executing "adb -s 4c05609b install -r "***\platforms\android\bin\Po
  ached-debug-unaligned.apk"": protocol failure
  </code></pre>
  
  <p><strong>I have tried::</strong></p>
  
  <ul>
  <li>deleting my .cordova folder in C:\Users\Name</li>
  <li>running the adb install directly (without phonegap)</li>
  <li>deploying to an emulator (same problem)</li>
  <li>unplugging / replugging the device</li>
  <li>rebooting all devices</li>
  <li>toggling "developer mode" on the device and revoking USB debugging privileges</li>
  </ul>
  
  <p>I am all out of ideas!</p>
  
  <p>Would greatly appreciate any tips or leads.</p>
  
  <p><em>ADB version 1.0.31</em></p>
  
  <p><em>Galaxy S3 running Android v4.3</em></p>
  
  <hr>
  
  <p><strong>EDIT:</strong></p>
  
  <p>Deploying to an emulator claims to complete successfully, but the app never opens and does not appear in the app list inside the emulator. So I have no way of actually testing it on the emulator either.</p>
  
  <p>Would really appreciate some assistance.</p>
  
  <hr>
  
  <p><strong>EDIT 2:</strong></p>
  
  <p>After some further tinkering I've discovered my issue can be more specifically described as <em>ADB hangs (freezes) when I attempt to talk to my device.</em> I've determined this because <em>adb shell</em>, <em>adb install</em>, and <em>adb push</em> all fail the same way as described above. No error, just finite waiting.</p>
  
  <p><em>adb logcat</em>, <em>adb devices</em>, and other read functions work perfectly fine until one of the aforementioned write functions hangs in which case I need to do a <em>adb kill-server</em> or <em>TASKKILL</em> to get <em>adb logcat</em> working again.</p>
  
  <p>Not sure if this added information helps, but there you go. The last thing I haven't yet tried is to do a factory reset on my phone as suggested by <a href="http://androidforums.com/epic-4g-all-things-root/197424-cant-get-adb-shell-command.html">this fellow</a>. If I can't find a solution soon I will back up my data as best I can and attempt this...</p>
  
  <p>Please save me before this becomes my last option!</p>