title: Determine if emulator device is in use
body: <p>Does anyone know what the method <code>hasClients</code> does in the android sdk?</p>
  
  <p><code>boolean com.android.ddmlib.IDevice.hasClients()</code></p>
  
  <p>It doesn't look like its documented.</p>
  
  <p>I am trying to find a way to see if an emulator is being used. Any good way to do this?</p>
  
  <pre><code>for(int i =0; i &lt; devices.length; i++){
  
      if(!devices[i].hasClients()){
  
          monkeyDevice = devices[i];
  
      }
  
  }
  </code></pre>
  
  <p>When I say is being used, I mean if there is currently an application running on the device or if its receiving commands from anything.</p>
  
  <h2>Update</h2>
  
  <p>I should of mentioned that I want to test for these conditions <strong>outside</strong> from my application. I have a seperate class running outside the application that starts the application within an available emulator. I want this monkey class to know if an existing emulator is already being used for testing.</p>