Software Archive
Read-only legacy content
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
17060 Discussions

How to see error log in the device? using console.log

Dani_Carla
Beginner
1,414 Views

Hi...
Im trying see the error log in the cel.

I'm using console.log handler, but I can see bugs only  in the emulator, and would like to see on Android device.

 

0 Kudos
5 Replies
Ad
New Contributor III
1,414 Views

Use the DEBUG tab and connect your Android device by using the "Debug App on Device" button (your device must be USB connected)

Now you will get the debugger view and with the console window at the bottom (if not: use the "Show drawer" button in the right top conner)
Here you can see the JS errors and your console.log(text) messages.

0 Kudos
Chris_P_Intel
Employee
1,414 Views

Also, if you are using App Designer there is a "Console" widget you can add to your app that will show you all console.log messages and allow you to evaluate JS interactively. It's not very fancy, but can be handy if you need something quick and dirty.  

 

The previous reply is the smarter way to proceed.

0 Kudos
Dani_Carla
Beginner
1,414 Views

Ad wrote:

Use the DEBUG tab and connect your Android device by using the "Debug App on Device" button (your device must be USB connected)


Ad
It does not work for me... I'm using connection bluetooth and does not work properly in the emulator and AppPreview

CHRIS P.
I dont use App Designer

In Intel AppCenter there's a script to help debugging, but it always disconnects and I can not finish my debug

debug_intel.jpg

When open the APP on the device it connects , but when I start using it disconnects alone

debug_intel_2.jpg

debug_intel_3.jpg

0 Kudos
Ad
New Contributor III
1,414 Views

Hi Dani,

Why don't you use the TEST tab in XDK and follow the instructions for "On Device Debugging"?

You need to embed another Weinre Tag in your HTML file and push your files to the server.
Start your App in the Intel App Preview App and hit the "Begin Debugging On Device" button in the TEST tab.
In the Weinre debug windows you will find the Console, where you can use the command "console.log(msg)" to 'debug' your app.

I hope this will help to solve your problem,
Ad
 

0 Kudos
Anusha_M_Intel1
Employee
1,414 Views

Hi Dani,

All are valid suggestions. I have one more. We have a sample app that has a small console window below the app that displays all console.log messages. https://github.com/xmnboy/hello-cordova

All you have to do is all this code in index.html at the end:

    <div class="align-center" >
        <textarea id="id_textArea" class="align-left" style="height:35rem; width:90%" readonly="readonly" wrap="off"></textarea>
    </div>

And then create this file (https://github.com/xmnboy/hello-cordova/blob/master/www/js/util.js) and put it in your www/js/ folder. 

You will then have to add a reference to this file in index.html:

<script src="js/util.js"></script>

This console window can be viewed via the emulator, app preview, on-device debugging, built app etc. 

0 Kudos
Reply