Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Adobe AIR Development

Reply
Developer
Posts: 439
Registered: ‎10-25-2010
My Device: Not Specified

How to trace()?

[ Edited ]

I'm running via command line, and can't see any traces in the console... The app launches on the simulator fine, I can see the initial stage, what am I missing here??

 

I tried using -target bar-debug but no luck.

Contributor
Posts: 35
Registered: ‎10-25-2010
My Device: Not Specified

Re: How to trace()?

Tracing on console only available in debug mode when you actually using Flash Buidler debugger. It is not available in the command line form.

Developer
Posts: 439
Registered: ‎10-25-2010
My Device: Not Specified

Re: How to trace()?

So the trick is to create a remote debugging session, and pass "-connect 192.x.x.x" in the compile settings.

 

I'm just not sure how to start the debugging session from FlashBuilder... I found some tricks for a MXML project, but not for a pure AS one...

Contributor
Posts: 35
Registered: ‎10-25-2010
My Device: Not Specified

Re: How to trace()?

SDK installs plugins for Flash Builder, so you should have  Launch configuration called BlackBerry Air Application - if you create it - you just use it in Debug mode. If you don't have it - something is wrong with installation

Developer
Posts: 278
Registered: ‎10-27-2010
My Device: Playbook

Re: How to trace()?

[ Edited ]

Whenever I am in a situation where I have to test without a debug version of the player, I always do one of two things:

 

1. Create a separate application that I can localConnection into and send all of my trace data there, rather than using trace().

2. Create a simple TextArea that can easily be removed or commented out for final release and have that accessible, but all of the text to be traced gets pushed into that window.

 

I know this might not apply to you, but I thought you might find it helpful in case you have a hard time getting trace to actually work.  If you do, please let me know how you did it.

 

--kdittyr

--------------
kdittyr

Accepted PlayBook Applications:
HDB Converter -- Utilities/Calculators
Developer
Posts: 439
Registered: ‎10-25-2010
My Device: Not Specified

Re: How to trace()?

Well I have 4.0, which the debug option won't appear in (I copied the .ink file), and I downloaded 4.5 and can add a debug config, but it throws an error when deploying

 

I'm getting:

An internal error occurred during: "Launching BlackberryHello (1)".
com.adobe.flexide.launching.AbstractFdbLaunchDelegate.getLaunchHandler()Lcom/adobe/flexide/launching/IFdbLaunchHandler;

 

 

Works fine when I use a custom run command... I really don't want to download a 3rd version of FB :/

Contributor
Posts: 35
Registered: ‎10-25-2010
My Device: Not Specified

Re: How to trace()?

It does not work with 4.5, it works with 4.0.1 +

You should read release notes and Getting Started before randomly pocking around.

Developer
Posts: 439
Registered: ‎10-25-2010
My Device: Not Specified

Re: How to trace()?

[ Edited ]

You  should stay out of threads if you don't have a clue to the proper answer, how about that?

 

All we need is to be able to start a remote debug session, and we can easily deploy via command line, instead of relying on some half broken GUI, or requiring a minor dot release of FB.

Developer
Posts: 6,473
Registered: ‎12-08-2010
My Device: PlayBook, Z10
My Carrier: none

Re: How to trace()?

Not sure this would help anyone, but I've whipped up a tiny Python script that an app built with the debug option can connect to, from within the simulator, to send trace messages. Works on Windows 7, should work on any other OS too. (The notes at http://osflash.org/ofd were extremely helpful in doing this.) I shouldn't have had to do this, since "fdb" ought to work, but no matter what I tried it did not. (I confirmed that "fdb/run" made it listen on port 7935, and that the simulator was connecting on port 7935, so I assume some incompatibility in protocol or version or something... whatever.) If this would be helpful, I can post it somewhere... here even, as it's quite small. On the other hand, if anyone has actually got "fdb" to work as described, my solution shouldn't be needed and I'd be happy to see a recipe for how to do that.

Peter Hansen -- (BB10 and dev-related blog posts at http://peterhansen.ca.)
Author of White Noise and Battery Guru for BB10 and for PlayBook | Get more from your battery!
Developer
Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10
My Carrier: Verizon

Re: How to trace()?

I too get trace() to work sometimes and getting the remote debug to work from the simulator has been problematic.  Though I still have trouble getting my environment to work to debug from the simulator, local debug has been nice by using Alcon (http://blog.hexagonstar.com/downloads/alcon/).  Other than levels of debug, it shows continuous on FPS and memory usage, plus it has a nice object inspector that shows an object in a tree form.  Very simple library to install and API.

 

The author mentioned he is working on a remote connection.  If you like the tool, let him know you too would be interested in a remote debug control session.