apache/cordova-android — pull request #77 by Kami (2013-08-03 01:00:23+00:00)
Title: start-emulator script doesn't fail (exit) early on fatal emulator errors

## Problem

Currently `start-emulator` script doesn't exist early on Linux if a fatal error happens.

This means you need to wait 300 seconds (default timeout) before you receive first feedback from the tool that something is wrong. An even then (after a timeout) it's hard to debug the problem because `adb` stdout and stderr are redirected `/dev/null`.

For example:

```bash
....
Waiting for emulator.....
```

If I run the emulator manually I see it produces a fatal error:

```bash
emulator: ERROR: unknown skin name 'WVGA800'
```

## Proposed Solution

This branch does the following:

1. Modify the emulator start script to redirect log to a temporary file. This way it's easier to debug actual issues.
2. Modify `wait_for_emulator` function to exit immediately and print an error if a fatal error is detected

Example output with my change:

```bash
Saving emulator log to: /tmp/tmp.VTOblrPktV

Emulator failed to start, fatal error detected
Error: emulator: ERROR: unknown skin name 'WVGA800'
Full log available at: /tmp/tmp.VTOblrPktV
Exiting...
```

(I'll also open appropriate JIRA ticket later on)