Archive for 2011/4/27
Recently, I started developing application on Adobe Android AIR.
But I wonder how I can debug my application on Android Phone.
I searched it, but many solutions can’t fit my case.
My requirements are
1 ) No USB connection
2 ) No Android SDK on my PC.
3 ) Can support on production mode ( No debug player )
In other words, The limitations move to outer enviroment from app and android phone.
And I want to control the outer environment.
My solution
Requirements
1 ) Need syslog server that can support TCP connetcion ( these are “rsyslog” or “syslog-ng” as I know )
2 ) TCPSyslogTarget as3 class ( can download on airxlib_log )
3 ) Wifi connection ( optional )
“optional” means .. I don’t think it is easy to make syslog server on the global network.
setup syslog server
The following config is a part of “rsyslog.conf”.
$ModLoad imtcp.so $InputTCPServerRun 514 $AllowedSender TCP, 127.0.0.1, 192.168.1.0/24 : local1.* /var/log/air.log
setup logging functions on your source code
import com.coltware.airxlib.log.TCPSyslogTarget;
// my syslog server's ip is "192.168.1.5". please change
var syslog:TCPSyslogTarget = new TCPSyslogTarget("192.168.1.5");
syslog.program = "AdobeAIR";
syslog.filters = ["*"];
syslog.level = LogEventLevel.DEBUG;
syslog.facility = TCPSyslogTarget.LOG_LOCAL1;
syslog.includeCategory = true;
Log.addTarget(syslog);
use flex logging functions.
import mx.logging.ILogger;
import mx.logging.Log;
private static var log:ILogger = Log.getLogger("foofoo");
log.debug("mmmmmm....");
At first, I tried to use UDP connection. But I can’t. ( I don’t know the reason )
