开发者

How do I debug a crash with a Flex/AIR Mobile application?

I have a flex app using the 4.5.1 sdk and AIR 2.7 running on an Android 3.2 tablet. During use, I can get it to crash fairly regularly. It's usually when I'm rapidly scrolling around in a List control. I can't seem to find the cause.

The application will just suddenly close. It happens in both debug and release builds.

When in debug mode, it just disconnects from the debugger and doesn't give me any useful information.开发者_运维技巧

I'm at a loss on how to debug this. What are some techniques I can use?

I found the "adb logcat" command. Relevant info from the log below, unfortunately it doesn't mean much to me.

I/DEBUG   (   85): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
I/DEBUG   (   85): Build fingerprint: 'asus/US_epad/TF101:3.2/HTJ85B/US_epad-8.6.5.9-20110816:user/release-keys'
I/DEBUG   (   85): pid: 2447, tid: 2447  >>> air.com.projectite.ProjectiteMobile <<<
I/DEBUG   (   85): signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 5a00923a
I/DEBUG   (   85):  r0 59fe2008  r1 00628e8c  r2 00025e3a  r3 00628e8c
I/DEBUG   (   85):  r4 006160e8  r5 8126c8d5  r6 bef8fb28  r7 002f8000
I/DEBUG   (   85):  r8 04fe8000  r9 00628e80  10 02ed04fd  fp 81eea9a0
I/DEBUG   (   85):  ip 59fe3400  sp bef8faf8  lr 8126cb7f  pc 8126cb48  cpsr 88000030
I/DEBUG   (   85):  d0  00000000c0800000  d1  cb000004c0800000
I/DEBUG   (   85):  d2  cb000004cb000000  d3  41f00000c0800000
I/DEBUG   (   85):  d4  40f0000000000000  d5  40e0000000000000
I/DEBUG   (   85):  d6  0000000000000000  d7  0000000000000004
I/DEBUG   (   85):  d8  40f14c4000000000  d9  c059206affffff9b
I/DEBUG   (   85):  d10 4263ddb6c2ca0354  d11 bfefeb3780000000
I/DEBUG   (   85):  d12 0000000000000000  d13 0000000000000000
I/DEBUG   (   85):  d14 0000000000000000  d15 0000000000000000
I/DEBUG   (   85):  scr 2000001b
I/DEBUG   (   85): 
I/DEBUG   (   85):          #00  pc 0026cb48  /data/data/com.adobe.air/lib/libCore.so
I/DEBUG   (   85):          #01  pc 00194054  /data/data/com.adobe.air/lib/libCore.so
I/DEBUG   (   85):          #02  pc 001a2774  /data/data/com.adobe.air/lib/libCore.so
I/DEBUG   (   85):          #03  pc 001aa5f8  /data/data/com.adobe.air/lib/libCore.so
I/DEBUG   (   85): 
I/DEBUG   (   85): libc base address: aff00000
I/DEBUG   (   85): 
I/DEBUG   (   85): code around pc:
I/DEBUG   (   85): 8126cb28 69e01e42 7ce2ea22 bfa84281 6a601e41 
I/DEBUG   (   85): 8126cb38 71e1ea21 f20cfb00 eb006920 46190c81 
I/DEBUG   (   85): 8126cb48 0002f85c 2200eac0 2320eac0 f282fa3f 
I/DEBUG   (   85): 8126cb58 f393fa3f b005c10c f04fbd30 80da0200 
I/DEBUG   (   85): 8126cb68 805a809a e7f6801a 46204d05 92029103 
I/DEBUG   (   85): 
I/DEBUG   (   85): code around lr:
I/DEBUG   (   85): 8126cb5c b005c10c f04fbd30 80da0200 805a809a 
I/DEBUG   (   85): 8126cb6c e7f6801a 46204d05 92029103 9301447d 
I/DEBUG   (   85): 8126cb7c 9b0147a8 99039a02 bf00e7cd fffffd59 
I/DEBUG   (   85): 8126cb8c 4604b530 b08568c0 d02f2800 42906a20 
I/DEBUG   (   85): 8126cb9c 1e42bfd8 ea2269e0 428872e2 1e41bfd8 
I/DEBUG   (   85): 
I/DEBUG   (   85): stack:
I/DEBUG   (   85):     bef8fab8  812a21e1  /data/data/com.adobe.air/lib/libCore.so
I/DEBUG   (   85):     bef8fabc  bef8fb00  
I/DEBUG   (   85):     bef8fac0  bef8fcf8  
I/DEBUG   (   85):     bef8fac4  00000001  
I/DEBUG   (   85):     bef8fac8  00000000  
I/DEBUG   (   85):     bef8facc  812a9c7f  /data/data/com.adobe.air/lib/libCore.so
I/DEBUG   (   85):     bef8fad0  5be301d0  
I/DEBUG   (   85):     bef8fad4  00000001  
I/DEBUG   (   85):     bef8fad8  00000000  
I/DEBUG   (   85):     bef8fadc  00642f18  
I/DEBUG   (   85):     bef8fae0  000024b4  
I/DEBUG   (   85):     bef8fae4  aff13f17  /system/lib/libc.so
I/DEBUG   (   85):     bef8fae8  006160e8  
I/DEBUG   (   85):     bef8faec  8126c8d5  /data/data/com.adobe.air/lib/libCore.so
I/DEBUG   (   85):     bef8faf0  df002777  
I/DEBUG   (   85):     bef8faf4  e3a070ad  
I/DEBUG   (   85): #00 bef8faf8  00d15114  
I/DEBUG   (   85):     bef8fafc  00628e8c  
I/DEBUG   (   85):     bef8fb00  0000002f  
I/DEBUG   (   85):     bef8fb04  000004fe  
I/DEBUG   (   85):     bef8fb08  00628e80  
I/DEBUG   (   85):     bef8fb0c  00616178  
I/DEBUG   (   85):     bef8fb10  00628e8c  
I/DEBUG   (   85):     bef8fb14  81194058  /data/data/com.adobe.air/lib/libCore.so
I/DEBUG   (   85): #01 bef8fb18  00000000  
I/DEBUG   (   85):     bef8fb1c  812a5f9f  /data/data/com.adobe.air/lib/libCore.so
I/DEBUG   (   85):     bef8fb20  0061bc68  
I/DEBUG   (   85):     bef8fb24  81ea8ee0  
I/DEBUG   (   85):     bef8fb28  04fe0000  
I/DEBUG   (   85):     bef8fb2c  002f0000  
I/DEBUG   (   85):     bef8fb30  bef8ff3c  
I/DEBUG   (   85):     bef8fb34  00628e80  
I/DEBUG   (   85):     bef8fb38  ffffffa0  
I/DEBUG   (   85):     bef8fb3c  00000003  
I/DEBUG   (   85):     bef8fb40  00000000  
I/DEBUG   (   85):     bef8fb44  00000000  
I/DEBUG   (   85):     bef8fb48  0019fe40  
I/DEBUG   (   85):     bef8fb4c  02ed04fd  
I/DEBUG   (   85):     bef8fb50  81eea9a0  
I/DEBUG   (   85):     bef8fb54  811a2778  /data/data/com.adobe.air/lib/libCore.so
I/BootReceiver(  136): Copying /data/tombstones/tombstone_01 to DropBox (SYSTEM_TOMBSTONE)
I/ActivityManager(  136): Process air.com.projectite.ProjectiteMobile (pid 2447) has died.
I/WindowManager(  136): WIN DEATH: Window{41c90270 air.com.projectite.ProjectiteMobile/air.com.projectite.ProjectiteMobile.AppEntry paused=false}


I don't know about Android development, but I stumbled upon this gem last week : http://jpauclair.net/mm-cfg-secrets/

A part that could interest you is this one. This could help you find where the crash occurs, at least.

AS3Trace = 1|0

This one is also very useful for debugging It trace every single call to any function that is being called in the SWF at runtime! It’s like expending the StackTrace to the full software run time.

If you got a crash hard to find, you can turn this on and you will see ALL the last function executed that leaded to the crash.

You can even see Timer Call and Events callbacks!


There are a few approaches you may try:

Start by trying to profile your app w/ the Flash Builder Profiler and look for memory leaks. Are there objects out there not getting garbage collected? You may find an obvious "quick fix".

Second, you may try removing functionality / screens from your app 1 x 1 and seeing if they have an effect on the crash / performance. If you remove something and it fixes the problem, then you can hone in on that code to try to optimize it or figure out why it is causing the problem.

I have rebuilt apps from scratch, slowly adding stuff in until I find out what was breaking things. It's tedious; but effective.

There are a lot of "obvious" things you can look at, such as replacing MXML with ActionScript and removing use of binding which will often increase performance.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜