We recently shipped a module in the addon SDK, that allows doing real process execution,
where you can control stdin and read stdout/stderr.
Also, it is supposed to have the same API than than nodejs module called child_process!
  http://nodejs.org/api/child_process.html
  http://mxr.mozilla.org/mozilla-central/source/addon-sdk/source/lib/sdk/system/child_process.js
  http://mxr.mozilla.org/mozilla-central/source/addon-sdk/source/test/test-child_process.js
I'm not suggesting you to start replacing sh.run/Commander in this patch,
but it may be helpful right here, as you wouldn't need any temporary file.
```
  let { exec } = require('sdk/system/child_process');
  exec(adb + " shell cat /data/local/webapps.webapps.json", {
     cwd: PROFILE_DIR
   }, function (err, stdout, stderr) {
     if (err) {...is adb around?}
     let content;
     try {
       content = JSON.parse(stdout);
     } catch(e) {...}
     ...
   });
```