title: Bash: enumerate all the attached devices
body: <p>I plugged several android devices to my laptop. And I can list their SN by</p>
  
  <p><code>adb devices</code></p>
  
  <p>output:</p>
  
  <pre><code>List of devices attached 
  015d4a826e0ffb0f    device
  015d4a826e43fb16    device
  015d41d830240b11    device
  015d2578a7280b02    device
  </code></pre>
  
  <p>I want to perform some operations on every device, like</p>
  
  <p><code>adb -s $device install foo.apk</code></p>
  
  <p>But I don't know how to let variable <code>device</code> iterate all the devices obtained by <code>adb devices</code>.</p>