Created
October 12, 2017 18:20
-
-
Save wbroek/a2caf1ace90eac0c5e25497548f41a6e to your computer and use it in GitHub Desktop.
Visual Studio Code task to start the Android Emulator (for React Native development)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"version": "2.0.0", | |
"reveal": "silent", | |
"tasks": [{ | |
"taskName": "Start Android Emulator", | |
"type": "shell", | |
"isBackground": true, | |
"command": "~/Library/Android/sdk/tools/emulator", | |
"args": [ | |
"-avd", | |
"[AVD_NAME]", | |
">", | |
"/dev/null", | |
"2>&1", | |
"&" | |
], | |
"problemMatcher": [], | |
"presentation": { | |
"reveal": "never" | |
} | |
}] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I am trying to avoid this error by removing
"isBackground": true
from the task. Then using a shell script which finishes after loading the emulator, but although detaching the process from the terminal using&
,nohup
ordisown
, the emulator closes when vscode finishes the prelaunch task.Running the script in a terminal works as expected, with
ctrl + c
oder closing the terminal the emulator stays open.Here is my script: