mozilla / r2d2b2g

Firefox OS Simulator is a test environment for Firefox OS. Use it to test your apps in a Firefox OS-like environment that looks and feels like a mobile phone.
https://addons.mozilla.org/en-US/firefox/addon/firefox-os-simulator/
Other
392 stars 139 forks source link

More robust check to see if ADB is running #765

Closed bkase closed 11 years ago

bkase commented 11 years ago

Faster, more robust check to see if ADB is running on bootup. Opens a socket for port 5037 and asks for "host:version" (which is exactly what the ADB commandline client does). If only I knew about this earlier, I wouldn't have wasted a bunch of time getting that ps solution working.

@ochameau This is better than using ps or taskList.exe right?

ochameau commented 11 years ago

I'm wondering if we should do something report error, or try to launch adb, on promise rejection. The previous code wasn't using deferred.reject, but the new code does although the calling code from simulator.js doesn't do anything on promise rejection: https://github.com/mozilla/r2d2b2g/blob/master/addon/lib/simulator.js#L122-L128

bkase commented 11 years ago

I made the promise resolve false in any error rather than rejecting the promise. That way the simulator will just start ADB itself on any error.

ochameau commented 11 years ago

Looks good. Please merge if you think that's ready.