Can I build a debug version of an Adobe AIR application?

对着背影说爱祢 提交于 2019-11-28 08:49:24

not a direct answer but if you publish for AIR3.5 (or 3.6 beta), you can get some debug info:

add a listener for uncaught RTEs to top level of your app:

this.loaderInfo.uncaughtErrorEvents.addEventListener(UncaughtErrorEvent.UNCAUGHT_ERROR, globalErrorHandler);

and grab debug info from error in listener:

function globalErrorHandler(event:UncaughtErrorEvent):void
{
    var message:String;
    //check for runtime error
    if (event.error is Error)
        message = (event.error as Error).getStackTrace();
    //handle other errors
    else if (event.error is ErrorEvent)
        message = (event.error as ErrorEvent).text;
    else
        message = event.error.toString();
    //do something with message (eg display it in textfield)
    myTextfield.text = message;
}

getStackTrace will return a stack trace even for release AIR apps (as long as you use AIR3.5 or above).

JeffryHouser

Without the SDK Tools; I don't think it is possible to run an aIR app in debug mode. But, here are a few alternatives to consider:

  • The client must have some idea what is going on to cause the error, right? Can you give them a special build with Alert Boxes or logging or something to help isolate the error to a line of code?
  • Can you listen for the uncaughtException event? The event will give you the full stack trace ( Error.getStackTrace() ); which you could then log--possibly with other information. Then you just have to tell your client to "Go here" and "send me this file." Or even display the info in some Alert and have the user copy and paste it into an email to you. More info on uncaughtException here and here
Stefan Habacher

check my post. Maybe it helps you to get stack trace with line numbers in a AIR release build. How can I get stacktrace for Adobe AIR global runtime errors in non-debug mode?

I use it in 2 big projects right now and it works very well.

Greetings

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!