You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by db...@apache.org on 2016/05/19 09:54:37 UTC

[1/9] cordova-ubuntu git commit: Improve debugging behavior; Add ip option

Repository: cordova-ubuntu
Updated Branches:
  refs/heads/master 7c96ab3d5 -> 2e2083f60


Improve debugging behavior; Add ip option


Project: http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/commit/e64d5582
Tree: http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/tree/e64d5582
Diff: http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/diff/e64d5582

Branch: refs/heads/master
Commit: e64d55827b35f462b381a8a9eedd9b146534b138
Parents: 9509e62
Author: Alexandre Abreu <al...@canonical.com>
Authored: Mon May 9 16:45:46 2016 -0400
Committer: Alexandre Abreu <al...@canonical.com>
Committed: Mon May 9 16:45:46 2016 -0400

----------------------------------------------------------------------
 CordovaUbuntu/CordovaViewInternal.qml | 18 ++++++++++++++-
 main.cpp                              | 36 ++++++++++++++++++++++++++++--
 2 files changed, 51 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/blob/e64d5582/CordovaUbuntu/CordovaViewInternal.qml
----------------------------------------------------------------------
diff --git a/CordovaUbuntu/CordovaViewInternal.qml b/CordovaUbuntu/CordovaViewInternal.qml
index 02dea8c..47ea2ab 100644
--- a/CordovaUbuntu/CordovaViewInternal.qml
+++ b/CordovaUbuntu/CordovaViewInternal.qml
@@ -82,11 +82,27 @@ OrientationHelper {
                 request.accept();
             }
 
+            onJavaScriptConsoleMessage: {
+                var msg = "[JS] (%1:%2) %3".arg(sourceId).arg(lineNumber).arg(message)
+                if (level === WebView.LogSeverityVerbose) {
+                    console.log(msg)
+                } else if (level === WebView.LogSeverityInfo) {
+                    console.info(msg)
+                } else if (level === WebView.LogSeverityWarning) {
+                    console.warn(msg)
+                } else if ((level === WebView.LogSeverityError) ||
+                           (level === WebView.LogSeverityErrorReport) ||
+                           (level === WebView.LogSeverityFatal)) {
+                    console.error(msg)
+                }
+            }
+
             context: WebContext {
                 id: webcontext
 
                 devtoolsEnabled: debuggingEnabled
-                devtoolsPort: debuggingEnabled ? 9222 : -1
+                devtoolsIp: debuggingDevtoolsIp
+                devtoolsPort: debuggingEnabled ? debuggingDevtoolsPort : -1
 
                 userScripts: [
                     UserScript {

http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/blob/e64d5582/main.cpp
----------------------------------------------------------------------
diff --git a/main.cpp b/main.cpp
index ffef445..2ab8337 100644
--- a/main.cpp
+++ b/main.cpp
@@ -18,15 +18,18 @@
 #include <QtCore>
 #include <QApplication>
 #include <QtQuick>
+#include <QtNetwork/QNetworkInterface>
 
-static void customMessageOutput(
+const int kDebuggingDevtoolsDefaultPort = 9222;
+
+void customMessageOutput(
         QtMsgType type,
         const QMessageLogContext &,
         const QString &msg) {
 
     switch (type) {
     case QtDebugMsg:
-        if (qgetenv("DEBUG").size()) {
+      if (QString::fromUtf8(qgetenv("DEBUG")) == "1") {
             fprintf(stderr, "Debug: %s\n", msg.toStdString().c_str());
         }
         break;
@@ -39,7 +42,23 @@ static void customMessageOutput(
     case QtFatalMsg:
         fprintf(stderr, "Fatal: %s\n", msg.toStdString().c_str());
         abort();
+        break;
+    case QtInfoMsg:
+        fprintf(stderr, "Info: %s\n", msg.toStdString().c_str());
+        break;
+    }
+}
+
+QString getDebuggingDevtoolsIp()
+{
+    QString host;
+    Q_FOREACH(QHostAddress address, QNetworkInterface::allAddresses()) {
+        if (!address.isLoopback() && (address.protocol() == QAbstractSocket::IPv4Protocol)) {
+            host = address.toString();
+            break;
+        }
     }
+    return host;
 }
 
 int main(int argc, char *argv[]) {
@@ -75,6 +94,19 @@ int main(int argc, char *argv[]) {
     view.rootContext()->setContextProperty(
                 "debuggingEnabled", debuggingEnabled);
 
+    QString debuggingDevtoolsIp;
+    int debuggingDevtoolsPort = -1;
+
+    if (debuggingEnabled) {
+      debuggingDevtoolsIp = getDebuggingDevtoolsIp();
+      debuggingDevtoolsPort = kDebuggingDevtoolsDefaultPort;
+    }
+
+    view.rootContext()->setContextProperty(
+                "debuggingDevtoolsIp", debuggingDevtoolsIp);
+    view.rootContext()->setContextProperty(
+                "debuggingDevtoolsPort", debuggingDevtoolsPort);
+
     view.rootContext()->setContextProperty(
                 "www", wwwDir.absolutePath());
 


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


[7/9] cordova-ubuntu git commit: use ubuntu-app-stop to stop the app more cleanly

Posted by db...@apache.org.
use ubuntu-app-stop to stop the app more cleanly


Project: http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/commit/bc919c10
Tree: http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/tree/bc919c10
Diff: http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/diff/bc919c10

Branch: refs/heads/master
Commit: bc919c100e4bd89be12b8be141d7f1d7e4dbce40
Parents: 78ea9da
Author: David Barth <da...@canonical.com>
Authored: Tue May 17 18:39:52 2016 +0200
Committer: David Barth <da...@canonical.com>
Committed: Tue May 17 18:39:52 2016 +0200

----------------------------------------------------------------------
 bin/templates/project/cordova/lib/run.js | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/blob/bc919c10/bin/templates/project/cordova/lib/run.js
----------------------------------------------------------------------
diff --git a/bin/templates/project/cordova/lib/run.js b/bin/templates/project/cordova/lib/run.js
index ba622a7..6373639 100644
--- a/bin/templates/project/cordova/lib/run.js
+++ b/bin/templates/project/cordova/lib/run.js
@@ -143,9 +143,9 @@ function runOnDevice(rootDir, debug, target, architecture, framework) {
 
     assert.ok(names.length == 1);
 
-    logger.info('Killing application if already running on your device.');
+    logger.info('Stopping application if needed.');
 
-    Devices.adbExec(target, 'shell "ps -A -eo pid,cmd | grep cordova-ubuntu | awk \'{ print \\$1 }\' | xargs kill -9"');
+    Devices.adbExec(target, 'shell "ubuntu-app-stop  \\`ubuntu-app-triplet ' + appId + '\\`"');
 
     if (debug)
         Devices.adbExec(target, 'forward --remove-all');


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


[8/9] cordova-ubuntu git commit: fix build issue with function signature missing the cordova variable name; also avoid a warning

Posted by db...@apache.org.
fix build issue with function signature missing the cordova variable name; also avoid a warning


Project: http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/commit/d6f921f7
Tree: http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/tree/d6f921f7
Diff: http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/diff/d6f921f7

Branch: refs/heads/master
Commit: d6f921f7fa178388cf4cb353f32d38b50bd5959d
Parents: bc919c1
Author: David Barth <da...@canonical.com>
Authored: Tue May 17 19:26:23 2016 +0200
Committer: David Barth <da...@canonical.com>
Committed: Tue May 17 19:26:23 2016 +0200

----------------------------------------------------------------------
 src/coreplugins.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/blob/d6f921f7/src/coreplugins.cpp
----------------------------------------------------------------------
diff --git a/src/coreplugins.cpp b/src/coreplugins.cpp
index 646eafe..ebae0f6 100644
--- a/src/coreplugins.cpp
+++ b/src/coreplugins.cpp
@@ -26,7 +26,8 @@ INSERT_HEADER_HERE
 
 extern "C" {
 
-Q_DECL_EXPORT QList<QSharedPointer<CPlugin>> cordovaGetPluginInstances(Cordova *) {
+Q_DECL_EXPORT QList<QSharedPointer<CPlugin>> cordovaGetPluginInstances(Cordova *cordova) {
+    Q_UNUSED(cordova);
     QList<QSharedPointer<CPlugin>> res;
 
     INSERT_PLUGIN_HERE


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


[4/9] cordova-ubuntu git commit: tweak devtools url message

Posted by db...@apache.org.
tweak devtools url message


Project: http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/commit/5c888c63
Tree: http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/tree/5c888c63
Diff: http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/diff/5c888c63

Branch: refs/heads/master
Commit: 5c888c631789bdab71d807c10ceea938cdcb5f54
Parents: 98a1fe6
Author: Alexandre Abreu <al...@canonical.com>
Authored: Tue May 10 11:48:19 2016 -0400
Committer: Alexandre Abreu <al...@canonical.com>
Committed: Tue May 10 11:48:19 2016 -0400

----------------------------------------------------------------------
 main.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/blob/5c888c63/main.cpp
----------------------------------------------------------------------
diff --git a/main.cpp b/main.cpp
index 14818d6..4e676da 100644
--- a/main.cpp
+++ b/main.cpp
@@ -104,7 +104,7 @@ int main(int argc, char *argv[]) {
       debuggingDevtoolsIp = getDebuggingDevtoolsIp();
       debuggingDevtoolsPort = kDebuggingDevtoolsDefaultPort;
 
-      qDebug() << QString("Devtools started at http://%1:%2")
+      qDebug() << QString("Devtools URL: http://%1:%2")
         .arg(debuggingDevtoolsIp)
         .arg(debuggingDevtoolsPort);
     }


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


[3/9] cordova-ubuntu git commit: Tweak debug launch

Posted by db...@apache.org.
Tweak debug launch


Project: http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/commit/98a1fe60
Tree: http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/tree/98a1fe60
Diff: http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/diff/98a1fe60

Branch: refs/heads/master
Commit: 98a1fe603d70cb0c63904d19c3ee1f5de18740af
Parents: 2b00f30
Author: Alexandre Abreu <al...@canonical.com>
Authored: Tue May 10 10:08:03 2016 -0400
Committer: Alexandre Abreu <al...@canonical.com>
Committed: Tue May 10 10:08:03 2016 -0400

----------------------------------------------------------------------
 bin/templates/project/cordova/lib/run.js | 2 +-
 main.cpp                                 | 6 ++++++
 2 files changed, 7 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/blob/98a1fe60/bin/templates/project/cordova/lib/run.js
----------------------------------------------------------------------
diff --git a/bin/templates/project/cordova/lib/run.js b/bin/templates/project/cordova/lib/run.js
index 580498e..f1335f9 100644
--- a/bin/templates/project/cordova/lib/run.js
+++ b/bin/templates/project/cordova/lib/run.js
@@ -165,7 +165,7 @@ to http://' + getDeviceInetAddress(target) + ':9222');
 
     logger.info('Launching the application on your device.');
 
-    return Devices.adbExecAsync(target, 'shell "DEBUG=1 ubuntu-app-launch  \\`ubuntu-app-triplet ' + appId + '\\`"').then(function () {
+    return Devices.adbExecAsync(target, 'shell "ubuntu-app-launch  \\`ubuntu-app-triplet ' + appId + '\\`"').then(function () {
         logger.rainbow('have fun!');
         Utils.popd();
     });

http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/blob/98a1fe60/main.cpp
----------------------------------------------------------------------
diff --git a/main.cpp b/main.cpp
index 0bf55e6..14818d6 100644
--- a/main.cpp
+++ b/main.cpp
@@ -88,6 +88,12 @@ int main(int argc, char *argv[]) {
             (qEnvironmentVariableIsSet("DEBUG")
              && QString(qgetenv("DEBUG")) == "1");
 
+    // TODO revamp this for something cleaner, uniform
+    // and runtime bound
+#if !defined(NDEBUG)
+    debuggingEnabled = true;
+#endif
+
     view.rootContext()->setContextProperty(
                 "debuggingEnabled", debuggingEnabled);
 


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


[9/9] cordova-ubuntu git commit: CB-11294 Updated RELEASENOTES and Version for release 4.3.4

Posted by db...@apache.org.
CB-11294 Updated RELEASENOTES and Version for release 4.3.4


Project: http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/commit/2e2083f6
Tree: http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/tree/2e2083f6
Diff: http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/diff/2e2083f6

Branch: refs/heads/master
Commit: 2e2083f60929f82a13494e9fdccec36a96627f1a
Parents: d6f921f
Author: David Barth <da...@canonical.com>
Authored: Thu May 19 10:13:59 2016 +0200
Committer: David Barth <da...@canonical.com>
Committed: Thu May 19 10:13:59 2016 +0200

----------------------------------------------------------------------
 RELEASENOTES.md | 9 +++++++++
 package.json    | 2 +-
 2 files changed, 10 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/blob/2e2083f6/RELEASENOTES.md
----------------------------------------------------------------------
diff --git a/RELEASENOTES.md b/RELEASENOTES.md
index af16f55..d704078 100644
--- a/RELEASENOTES.md
+++ b/RELEASENOTES.md
@@ -20,6 +20,15 @@
 -->
 ## Release Notes for Cordova Ubuntu ##
 
+### 4.3.4
+* fix build issue with function signature missing the cordova variable name; also avoid a warning
+* use ubuntu-app-stop to stop the app more cleanly
+* Update run devtools message
+* tweak devtools url message
+* Tweak debug launch
+* Add app launch tweaks
+* Improve debugging behavior; Add ip option
+
 ### 4.3.3
 * Fix reliance on deprecated Oxide's onLoadingChanged signal
 * Fix debugging enabled flag & remove webkit specific bit

http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/blob/2e2083f6/package.json
----------------------------------------------------------------------
diff --git a/package.json b/package.json
index 9480a67..1cd7300 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
 {
     "name": "cordova-ubuntu",
-    "version": "4.3.3",
+    "version": "4.3.4",
     "description": "Cordova tooling for the Ubuntu platform.",
     "main": "bin/create",
     "repository": {


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


[5/9] cordova-ubuntu git commit: Update run devtools message

Posted by db...@apache.org.
Update run devtools message


Project: http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/commit/626568c6
Tree: http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/tree/626568c6
Diff: http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/diff/626568c6

Branch: refs/heads/master
Commit: 626568c614dd9b7ce6fa6ad4cd1b75d7ce23108c
Parents: 5c888c6
Author: Alexandre Abreu <al...@canonical.com>
Authored: Tue May 10 13:27:38 2016 -0400
Committer: Alexandre Abreu <al...@canonical.com>
Committed: Tue May 10 13:27:38 2016 -0400

----------------------------------------------------------------------
 bin/templates/project/cordova/lib/run.js | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/blob/626568c6/bin/templates/project/cordova/lib/run.js
----------------------------------------------------------------------
diff --git a/bin/templates/project/cordova/lib/run.js b/bin/templates/project/cordova/lib/run.js
index f1335f9..ba622a7 100644
--- a/bin/templates/project/cordova/lib/run.js
+++ b/bin/templates/project/cordova/lib/run.js
@@ -112,9 +112,7 @@ function runNative(rootDir, debug) {
     var cmd = './cordova-ubuntu www/';
     if (debug) {
         cmd = "DEBUG=1 " + cmd;
-        logger.warn('Debug enabled. \
-Try pointing a Chrome/Chromium browser \
-to http://' + getDeviceInetAddress() + ':9222');
+        logger.warn('Debug enabled. Devtools debug URL: http://' + getDeviceInetAddress(target) + ':9222');
     }
 
     logger.info('Launching the application.');
@@ -157,9 +155,7 @@ function runOnDevice(rootDir, debug, target, architecture, framework) {
     Devices.adbExec(target, 'shell "cd /home/phablet/; pkcon install-local ' + names[0] + ' -p --allow-untrusted -y"', {silent: false});
 
     if (debug) {
-        logger.warn('Debug enabled. \
-Try pointing a Chrome/Chromium browser \
-to http://' + getDeviceInetAddress(target) + ':9222');
+        logger.warn('Debug enabled. Devtools debug URL: http://' + getDeviceInetAddress(target) + ':9222');
         Devices.adbExec(target, 'forward tcp:9222 tcp:9222');
     }
 


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


[6/9] cordova-ubuntu git commit: Merge pull request #12 from cordova-ubuntu/fix-debugging-handling

Posted by db...@apache.org.
Merge pull request #12 from cordova-ubuntu/fix-debugging-handling

 Fix debugging handling 

Project: http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/commit/78ea9dae
Tree: http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/tree/78ea9dae
Diff: http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/diff/78ea9dae

Branch: refs/heads/master
Commit: 78ea9dae73a9af1253a71e030304bfd863a1759b
Parents: 7c96ab3 626568c
Author: david-barth-canonical <da...@canonical.com>
Authored: Wed May 11 09:46:20 2016 +0200
Committer: david-barth-canonical <da...@canonical.com>
Committed: Wed May 11 09:46:20 2016 +0200

----------------------------------------------------------------------
 CordovaUbuntu/CordovaViewInternal.qml    | 22 ++++++++++++--
 bin/templates/project/cordova/lib/run.js | 27 +++++++++++++++--
 main.cpp                                 | 43 +++++++++++++++++++++++++--
 3 files changed, 84 insertions(+), 8 deletions(-)
----------------------------------------------------------------------



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


[2/9] cordova-ubuntu git commit: Add app launch tweaks

Posted by db...@apache.org.
Add app launch tweaks


Project: http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/commit/2b00f308
Tree: http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/tree/2b00f308
Diff: http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/diff/2b00f308

Branch: refs/heads/master
Commit: 2b00f308215a00ad7c3305190e8f5a74fdd4dd0f
Parents: e64d558
Author: Alexandre Abreu <al...@canonical.com>
Authored: Mon May 9 20:25:32 2016 -0400
Committer: Alexandre Abreu <al...@canonical.com>
Committed: Mon May 9 20:25:32 2016 -0400

----------------------------------------------------------------------
 CordovaUbuntu/CordovaViewInternal.qml    |  4 ++--
 bin/templates/project/cordova/lib/run.js | 31 ++++++++++++++++++++++++---
 main.cpp                                 |  9 ++++----
 3 files changed, 35 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/blob/2b00f308/CordovaUbuntu/CordovaViewInternal.qml
----------------------------------------------------------------------
diff --git a/CordovaUbuntu/CordovaViewInternal.qml b/CordovaUbuntu/CordovaViewInternal.qml
index 47ea2ab..2f91f73 100644
--- a/CordovaUbuntu/CordovaViewInternal.qml
+++ b/CordovaUbuntu/CordovaViewInternal.qml
@@ -129,8 +129,8 @@ OrientationHelper {
                     msgId: "from-cordova"
                     contexts: [usContext]
                     callback: function(msg, frame) {
-                        CordovaWrapper.messageHandler(msg.args)
-                        console.log(JSON.stringify(msg.args))
+                        CordovaWrapper.messageHandler(msg.payload)
+                        console.log('Message payload', JSON.stringify(msg.payload))
                     }
                 }
             ]

http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/blob/2b00f308/bin/templates/project/cordova/lib/run.js
----------------------------------------------------------------------
diff --git a/bin/templates/project/cordova/lib/run.js b/bin/templates/project/cordova/lib/run.js
index 9f905d8..580498e 100644
--- a/bin/templates/project/cordova/lib/run.js
+++ b/bin/templates/project/cordova/lib/run.js
@@ -81,6 +81,27 @@ module.exports.run = function(rootDir, desktop, debug, target, nobuild, emulator
     });
 };
 
+function getDeviceInetAddress(target) {
+    function parseInetLines(lines) {
+        var ip = '';
+        for (var i = 0; i < lines.length; ++i) {
+            var match = /\s+inet\s+(\d+.\d+.\d+.\d+)?.*/.exec(lines[i])
+            if (match && match.length > 0 && match[1] != '127.0.0.1') {
+                ip = match[1];
+                break;
+            }
+        }
+        return ip
+    }
+    var lines = [];
+    if (target) {
+        lines = Devices.adbExec(target, 'shell ip -f inet addr').output.split('\n');
+    } else {
+        lines = Utils.execSync('ip -f inet addr').output.split('\n');
+    }
+    return parseInetLines(lines)
+}
+
 function runNative(rootDir, debug) {
     logger.info('Running Cordova');
     var ubuntuDir = path.join(rootDir, 'platforms', 'ubuntu');
@@ -91,7 +112,9 @@ function runNative(rootDir, debug) {
     var cmd = './cordova-ubuntu www/';
     if (debug) {
         cmd = "DEBUG=1 " + cmd;
-        logger.warn('Debug enabled. Try pointing a Chrome/Chromium browser to http://127.0.0.1:9222');
+        logger.warn('Debug enabled. \
+Try pointing a Chrome/Chromium browser \
+to http://' + getDeviceInetAddress() + ':9222');
     }
 
     logger.info('Launching the application.');
@@ -134,13 +157,15 @@ function runOnDevice(rootDir, debug, target, architecture, framework) {
     Devices.adbExec(target, 'shell "cd /home/phablet/; pkcon install-local ' + names[0] + ' -p --allow-untrusted -y"', {silent: false});
 
     if (debug) {
-        logger.warn('Debug enabled. Try pointing a Chrome/Chromium browser to http://127.0.0.1:9222');
+        logger.warn('Debug enabled. \
+Try pointing a Chrome/Chromium browser \
+to http://' + getDeviceInetAddress(target) + ':9222');
         Devices.adbExec(target, 'forward tcp:9222 tcp:9222');
     }
 
     logger.info('Launching the application on your device.');
 
-    return Devices.adbExecAsync(target, 'shell bash -c "ubuntu-app-launch  \\`ubuntu-app-triplet ' + appId + '\\`"').then(function () {
+    return Devices.adbExecAsync(target, 'shell "DEBUG=1 ubuntu-app-launch  \\`ubuntu-app-triplet ' + appId + '\\`"').then(function () {
         logger.rainbow('have fun!');
         Utils.popd();
     });

http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/blob/2b00f308/main.cpp
----------------------------------------------------------------------
diff --git a/main.cpp b/main.cpp
index 2ab8337..0bf55e6 100644
--- a/main.cpp
+++ b/main.cpp
@@ -29,7 +29,7 @@ void customMessageOutput(
 
     switch (type) {
     case QtDebugMsg:
-      if (QString::fromUtf8(qgetenv("DEBUG")) == "1") {
+        if (QString::fromUtf8(qgetenv("DEBUG")) == "1") {
             fprintf(stderr, "Debug: %s\n", msg.toStdString().c_str());
         }
         break;
@@ -43,9 +43,6 @@ void customMessageOutput(
         fprintf(stderr, "Fatal: %s\n", msg.toStdString().c_str());
         abort();
         break;
-    case QtInfoMsg:
-        fprintf(stderr, "Info: %s\n", msg.toStdString().c_str());
-        break;
     }
 }
 
@@ -100,6 +97,10 @@ int main(int argc, char *argv[]) {
     if (debuggingEnabled) {
       debuggingDevtoolsIp = getDebuggingDevtoolsIp();
       debuggingDevtoolsPort = kDebuggingDevtoolsDefaultPort;
+
+      qDebug() << QString("Devtools started at http://%1:%2")
+        .arg(debuggingDevtoolsIp)
+        .arg(debuggingDevtoolsPort);
     }
 
     view.rootContext()->setContextProperty(


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org