Skip to content

Instantly share code, notes, and snippets.

function copyMrtImage(src, dest){
var srcDir = path.dirname(src),
srcExt = path.extname(src),
srcFileName = path.basename(src, srcExt);
var destDir = path.dirname(dest),
destExt = path.extname(dest),
destFileName = path.basename(dest, destExt);
// all MRT images: logo.png, logo.scale-100.png, logo.scale-200.png, etc
@sgrebnov
sgrebnov / gist:e947712eb441b5084d49
Last active August 29, 2015 14:02
Visual Studio for MDA development - enable console output for Windows Phone 8

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.

  1. 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
  2. Fine function exec_verbose(command) command inside it
  // executes a commmand in the shell
  function exec_verbose(command) {
// The scope of 'this' is the event. In order to call the 'receivedEvent'
// function, we must explicity call 'app.receivedEvent(...);'
onDeviceReady: function() {
app.receivedEvent('deviceready');
function onSuccess(contacts) {
alert('Found ' + contacts.length + ' contacts.');
console.log(JSON.stringify(contacts));
<?xml version='1.0' encoding='utf-8'?>
<widget id="io.cordova.hellocordova" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<name>HelloCordova</name>
<description>
A sample Apache Cordova application that responds to the deviceready event.
</description>
<author email="dev@cordova.apache.org" href="http://cordova.io">
Apache Cordova Team
</author>
<content src="index.html" />