Currently Windows Phone 8 deploy command (deploy.js) is blocking + it uses ReadAll insteadof while loop and ReadLine. Due to this there is no way to see real time output from the app in Visual Studio output window.
Instructions below could be used to fix this.
- Find the following file (should be created after you build Windows Phone platform at least once) YouCordovaApp\bld\Debug\platforms\wp8\cordova\lib\deploy.js
- Fine function exec_verbose(command) command inside it
// executes a commmand in the shell
function exec_verbose(command) {
//Log("Command: " + command);
var oShell=wscript_shell.Exec(command);
while (oShell.Status == 0) {
//Wait a little bit so we're not super looping
WScript.sleep(100);
//Print any stdout output from the script
if (!oShell.StdOut.AtEndOfStream) {
var line = oShell.StdOut.ReadAll();
Log(line);
}
}
//Check to make sure our scripts did not encounter an error
if (!oShell.StdErr.AtEndOfStream) {
var line = oShell.StdErr.ReadAll();
Log("ERROR: command failed in deploy.js : " + command);
Log(line, true);
WScript.Quit(2);
}
}
- Replace original version with the following one. It replaces ReadAll with while loop and ReadLine
// executes a commmand in the shell
function exec_verbose(command) {
//Log("Command: " + command);
var oShell=wscript_shell.Exec(command);
while (oShell.Status == 0) {
//Wait a little bit so we're not super looping
WScript.sleep(100);
//Print any stdout output from the script
while (!oShell.StdOut.AtEndOfStream) {
var line = oShell.StdOut.ReadLine();
Log(line);
}
}
//Check to make sure our scripts did not encounter an error
if (!oShell.StdErr.AtEndOfStream) {
var line = oShell.StdErr.ReadAll();
Log("ERROR: command failed in deploy.js : " + command);
Log(line, true);
WScript.Quit(2);
}
}
You are done, you should now see console.log messages in your Visual Studio output window