当前位置: 网学 > 编程文档 > Android > 正文

Android monkey 资料

来源:Http://myeducs.cn 联系QQ:点击这里给我发消息 作者: myeducs.cn 发布时间: 13/03/17

【网学网提醒】:本文主要为网学会员提供Android monkey 资料,希望对需要Android monkey 资料网友有所帮助,学习一下!


    Androidmonkey资料
    一、为什么要用Monkey测试?002简单在说就是象猴子一样乱点,为了测试软件的稳定性,健壮性。号称最快速有效的方法。有时候运行相同系列的测试,即使是复杂的测试,但是以相003同的顺序和路径,即使一遍又一遍地运行也很少机会能发现内存和资源使用的bug。而此时猴子就比人更有效了。004005简介006Monkey是一个命令行工具,可以运行在模拟器里或实际设备中。它向系统007发送伪随机的用户事件流,实现对正在开发的应用程序进行压力测试。Monkey包括许多选项,它们大致分为四大类:008009·基本配置选项,如设置尝试的事件数量。010011·运行约束选项,如设置只对单独的一个包进行测试。012013·事件类型和频率。014015·调试选项。016017018019020021·如果应用程序崩溃或接收到任何失控异常,Monkey将停止并报错。022023024025按照选定的不同级别的反馈信息,在Monkey中还可以看到其执行过程报告和生成的事件。·如果应用程序产生了应用程序不响应(applicationnotresponding)的错误,Monkey将会停止并报错。·如果限定了Monkey运行在一个或几个特定的包上,那么它会监测试图转到其它包的操作,并对其进行阻止。在Monkey运行的时候,它生成事件,并把它们发给系统。同时,Monkey还对测试中的系统进行监测,对下列三种情况进行特殊处理:
     026027二、怎么用的?028029首先用一个最简单的例子分析:030//p参数:表示指定测试的程序031//v参数:表示查看monkey生成的一些详细的随机的事件名032//数字100:表示测试事件数为100033monkey-pcom.example.android.apis034035036结果如下:037038:Monkey:seed=0count=100039040041:AllowPackage:com.example.android.apis042:IncludeCategory:android.intent.category.LAUNCHER043:IncludeCategory:android.intent.category.MONKEY044045//各种事件所占的比例。046//各数字分别表示:047[--pct-touchPERCENT]048[--pct-motionPERCENT]049[--pct-trackballPERCENT]050[--pct-syskeysPERCENT]051[--pct-navPERCENT]052[--pct-majornavPERCENT]053[--pct-appswitchPERCENT]054[--pct-flipPERCENT]055[--pct-anyeventPERCENT]056//Eventpercentages:057//058//059//060//061//0:15.0%1:10.0%2:15.0%3:25.0%4:15.0%-v-v-v100
     062//063//064//065//067068
    5:2.0%6:2.0%7:1.0%8:15.0%
    066:Switch://表示跳转到com.example.android.apis里面的ApiDemos这一个Activity里。
    0#Intent;action=android.intent.action.MAIN;category=android.intent.c6ategory.LAUNCHER;launchFlags=0x10000000;component=com.example.andro9id.apis/.ApiDemos;end070071//允许此Intent跳转,//AllowingstartofIntent{act=android.intent.
    action.MAINcat=[android.intent.category.LAUNCHER]072cmp=com.example.android.apis/.ApiDemos}inpackagecom.example.android.apis073074//发送的一些动作,如点击按下,点击放开,移动。075:SendingPointerACTION_MOVEx=-4.0y=2.0076:SendingPointerACTION_UPx=0.0y=0.0077:SendingPointerACTION_DOWNx=207.0y=282.0078:SendingPointerACTION_UPx=189.0y=289.0079:SendingPointerACTION_DOWNx=95.0y=259.0080:SendingPointerACTION_UPx=95.0y=259.0081:SendingPointerACTION_DOWNx=295.0y=223.0082:SendingPointerACTION_UPx=290.0y=213.0083:SendingPointerACTION_MOVEx=-5.0y=3.0084:SendingPointerACTION_MOVEx=0.0y=-5.0085086//拒绝此跳转,因为它是跳转到非它自己的包的Activity,本测试中是指写测试它程序所在的包,此跳转是跳出本程序,进入到桌面。
    //RejectingstartofIntent{act=android.intent.action.MAINcat=[android.intent.category.HOME]087cmp=com.android.launcher/.Launcher}inpackagecom.android.launcher088089//继续发送动作。
     090:SendingPointerACTION_DOWNx=74.0y=201.0091:SendingPointerACTION_UPx=74.0y=201.0092:SendingPointerACTION_MOVEx=3.0y=-2.0093:SendingPointerACTION_UPx=0.0y=0.0094:SendingPointerACTION_MOVEx=-4.0y=2.0095Eventsinjected:100096097//丢弃的,键=0,指针=0,轨迹球=0,翻转=0。098:Dropped:keys=0pointers=0trackballs=0flips=0099100101102103//monkey测试完成。104//Monkeyfinished105106107108109110以下是monkey命令行的一些参数:111-p:所在测试的包,可以是一个也可以是多个如monkey-pcom.androd.sms-pcom.androd.explorer从例子中可以看出,该程序在这次测试中没有问题,若程序出现问题终端将打印出异常供程序员查找错误。//网络统计经过时间为4202ms,其中4202ms是用于在手机上的,0ms用于无线网络上,没有连接的时间为0ms。##Networkstats:elapsedtime=4202ms(4202msmobile,0mswifi,0msnotconnected)
    -c:如果用此参数指定了一个或几个类别,Monkey将只允许系统启动被这些类别中的某个类别列出的Activity。如果不指定任何类别,Monkey将选择112下列类别中列出的Activity:Intent.CATEGORY_LAUNCHER或Intent.CATEGORY_MONKEY。要指定多个类别,需要使用多个-c选项,每个-c选项只能用于一个类别。113-ignore-crash:当应用程序崩溃或发生任何失控异常时,Monkey将停止运行。如果设置此选项,Monkey将继续向系统发送事件,直到计数完成。
    -ignore-timeouts:通常,当应用程序发生任何超时错误(如“Application114NotResponding”对话框)时,Monkey将停止运行。如果设置此选项,Monkey将继续向系统发送事件,直到计数完成。115-ignore-security-exceptions:通常,当应用程序发生许可错误(如启动一个需要某些
    许可的Activity)时,Monkey将停止运行。如果设置了此选项,
     Monkey将继续向系统发送事件,直到计数完成。116117118119120121122123124-monitor-native-crashes:监视并报告Android系统中本地代码的崩溃事件。如果设置了–kill-process-after-error,系统将停止运行。-kill-process-after-error:如果程序出现错误,monkey将结束此程序进程。-hprof:设置此项,将在monkey事件序列之前和之后立即生成profilling报告。这将会在data/misc中生成大文件(约5mb)所以要小心使用它。-pct-touch:调整触摸事件的百分比(触摸事件是一个down-up事件,它发生在屏幕的某单一位置)。-pct-motion:动作事件的百分比(动作事件由屏幕上某处的一个down事件、一系列的随机事件和一个up事件组成)。-pct-trackball:调整轨迹事件的百分比(轨迹事件由一个或几个随机移动组成,有时还伴随着点击)。-pct-syskeys:调整系统按键事件的百分比(这些按键通常被保留,由系统使用,如home,back,startcall,endcall及音量控制)。-pct-nav调整基本导航事件的百分比(导航事件来自方向输入设备的up/down/left/right组成)。-pct-majornav:调整“主要”导航事件的百分比(这些导航事件通常引发图形界面中的动作,如:5-way键盘的中间按键、回退按键、菜单按键)
    -pct-appswitch:调整启动Activity的百分比。在随机间隔里,Monkey将执125行一个startActivity()调用,作为最大程度覆盖包中全部Activity的一种方法。126-pct-anyevent:调整启动Activity的百分比。它包罗了所有其它的事件类型,如:按键,其它不常用的设备按钮。
    127-pct-flip:128–wait-dbg:停止执行中的Monkey,直到有调试器和它相连接。–dbg-no-events:设置此选项,Monkey将执行初始启动,进入到一个测试Activity,然后不会再进一步生成事件。为了得到最佳结果,把它与-v、一129个或几个包约束、以及一个保持Monkey运行30秒或更长时间的非零值联合起来,从而提供一个环境,可以监视应用程序所调用的包之间的转换。130-setup:131-f:-port:为monkey开启专用端口。此时只monkey不会帮你乱点击,而此时你自己就是一只monkey了,在你乱点的时候,monkey会输出你点击后回馈的132信息。如果你打完命令之后模拟器上没有启动你所要启动的包,你需要自己启动,但是你只能启动你-p中指定的那几个包。ctrl+c中断。133--throttle:当事件起效时等待的毫秒数。134-s:随机数生成器的seed值。如果用相同的seed值再次运行monkey,它将生成相同的事件序列。
     135COUNT:要发送的事件数。136usage:monkey[-pALLOWED_PACKAGE[-pALLOWED_PACKAGE]...]1371381391401411
    42143144145146147148149150151152153154155Monkey测试结果:156#monkey-pwfh.LessonTable-v-v-v200157:Monkey:seed=0count=200158:AllowPackage:wfh.LessonTable159:IncludeCategory:android.intent.category.LAUNCHER160:IncludeCategory:android.intent.category.MONKEY161162//Selectingmainactivitiesfromcategoryandroid.intent.category.LAUNCHER//-NOTUSINGmainactivitycom.android.browser.BrowserActivity(frompackagecom.android.browser)[-cMAIN_CATEGORY[-cMAIN_CATEGORY]...][--ignore-crashes][--ignore-timeouts][--ignore-security-exceptions][--monitor-native-crashes][--kill-process-after-error][--hprof][--pct-touchPERCENT][--pct-motionPERCENT][--pct-trackballPERCENT][--pct-syskeysPERCENT][--pct-navPERCENT][--pct-majornavPERCENT][--pct-appswitchPERCENT][--pct-flipPERCENT][--pct-anyeventPERCENT][--wait-dbg][--dbg-no-events][--setupscriptfile][-fscriptfile[-fscriptfile]...][--portport][-sSEED][-v[-v]...][--throttleMILLISEC]COUNT
    //-NOTUSINGmainactivity163com.android.music.MusicBrowserActivity(frompackagecom.android.music)164//-NOTUSINGmainactivitycom.android.contacts.DialtactsActivity(frompackage
     com.android.contacts)//-NOTUSINGmainactivity165com.android.contacts.DialtactsContactsEntryActivity(frompackagecom.android.contacts)166167168169170171172173174//-NOTUSINGmainactivitycom.android.mms.ui.ConversationList(frompackagecom.android.mms)//-NOTUSINGmainactivitycom.android.spare_parts.SpareParts(frompackagecom.android.spare_parts)//-NOTUSINGmainactivitycom.android.camera.Camera(frompackagecom.android.camera)//-NOTUSINGmainactivitycom.android.alarmclock.AlarmClock(frompackagecom.android.alarmclock)//-NOTUSINGmainactivitycom.android.settings.Settings(frompackagecom.android.settings)//-NOTUSINGmainactivitycom.android.camera.GalleryPicker(frompackagecom.android.gallery)//-NOTUSINGmainactivitycom.android.email.activity.Welcome(frompackagecom.android.email)//-NOTUSINGmainactivitycom.example.android.apis.ApiDemos(frompackagecom.example.android.apis)//-NOTUSINGmainactivitycom.android.calculator2.Calculator(frompackagecom.android.calculator2)
    //-NOTUSINGmainactivity175com.android.customlocale.CustomLocaleActivity(frompackagecom.android.customlocale)176177178//-NOTUSINGmainactivitycom.android.development.Development(frompackagecom.android.development)//-NOTUSINGmainactivitycom.myactivity.MyActivity(frompackagecom.myactivity)//+Usingmainactivitywfh.LessonTable.MainTable(frompackagewfh.LessonTable)-NOTUSINGmainactivitywfh.rss.MainRSS(frompackagewfh.rss)//Selectingmainactivitiesfromcategoryandroid.intent.category.MONKEY//-NOTUSINGmainactivitycom.android.launcher.Launcher(frompackagecom.android.launcher)
    179//180181
    //-NOTUSINGmainactivity182com.android.settings.ManageAppl
    ications(frompackagecom.android.settings)
     183
    //-NOTUSINGmainactivitycom.android.settings.RunningServices(frompackagecom.android.settings)
    184//Seeded:0185//Eventpercentages:186//187//188//189//190//191//192//193//194//0:15.0%1:10.0%2:15.0%3:25.0%4:15.0%5:2.0%6:2.0%7:1.0%8:15.0%
    :Switch:1#Intent;action=android.intent.action.MAIN;category=android.intent.c9ategory.LAUNCHER;launchFlags=0x10000000;component=wfh.LessonTable/.5MainTable;end1//AllowingstartofIntent{act=android.intent.action.MAIN9cat=[android.intent.category.LAUNCHER]6cmp=wfh.LessonTable/.MainTable}inpackagewfh.LessonTable197Sleepingfor0milliseconds198:SendKey(ACTION_DOWN):21199:SendKey(ACTION_UP):21200//KEYCODE_DPAD_LEFT//KEYCODE_DPAD_LEFT
    Sleepingfor0milliseconds//-----------------------------------用--throttle来设置一个起效的事件发生后时延时。
    201:SendingPointerACTION_MOVEx=-4.0y=2.0202:SendingPointerACTION_MOVEx=-5.0y=-4.0203:SendingPointerACTION_MOVEx=0.0y=-1.0204:SendingPointerACTION_MOVEx=-3.0y=2.0205:SendingPointerACTION_MOVEx=-4.0y=2.0//-------------移动事件!!!
    206:SendingPointerACTION_MOVEx=-2.0y=4.0207:SendingPointerACTION_MOVEx=4.0y=1.0208:SendingPointerACTION_MOVEx=-5.0y=4.0209:SendingPointerACTION_MOVEx=-5.0y=1.0210:SendingPointerACTION_MOVEx=0.0y=-2.0211:SendingPointerACTION_DOWNx=0.0y=0.0
     212:SendingPointerACTION_UPx=0.0y=0.0213Sleepingfor0milliseconds214:SendKey(ACTION_DOWN):82215:SendKey(ACTION_UP):82216Sleepingfor0milliseconds217:SendKey(ACTION_DOWN):64218:SendKey(ACTION_UP):64219Sleepingfor0milliseconds220:SendKey(ACTION_DOWN):23221:SendKey(ACTION_UP):23222Sleepingfor0milliseconds223:SendKey(ACTION_DOWN):91224//KEYCODE_MUTE//AllowingstartofIntent{cmp=wfh.LessonTable/.EditLesson}inpackagewfh.LessonTable//KEYCODE_MUTE//KEYCODE_DPAD_CENTER//KEYCODE_DPAD_CENTER//KEYCODE_EXPLORER//KEYCODE_EXPLORER//KEYCODE_MENU//KEYCODE_MENU
    225:SendKey(ACTION_UP):91226Sleepingfor0milliseconds
    227:SendingPointerACTION_DOWNx=207.0y=282.0228:SendingPointerACTION_MOVEx=210.0y=277.0229:SendingPointerACTION_MOVEx=204.0y=283.0230:SendingPointerACTION_MOVEx=205.0y=278.0231:SendingPointerACTION_MOVEx=199.0y=278.0232:SendingPointerACTION_MOVEx=199.0y=287.0233:SendingPointerACTION_MOVEx=194.0y=295.0234:SendingPointerACTION_MOVEx=198.0y=290.0235:SendingPointerACTION_MOVEx=197.0y=286.0236:SendingPointerACTION_MOVEx=189.0y=289.0237:SendingPointerACTION_UPx=189.0y=289.0238Sleepingfor0milliseconds239:SendKey(ACTION_DOWN):56240:SendKey(ACTION_UP):56241Sleepingfor0milliseconds242:SendingPointerACTION_DOWNx=95.0y=259.0243:SendingPointerACTION_UPx=95.0y=259.0244Sleepingfor0milliseconds2
    45:SendingPointerACTION_DOWNx=295.0y=223.0246:SendingPointerACTION_MOVEx=291.0y=223.0//KEYCODE_PERIOD//KEYCODE_PERIOD
     247:SendingPointerACTION_MOVEx=291.0y=218.0248:SendingPointerACTION_MOVEx=284.0y=215.0249:SendingPointerACTION_MOVEx=284.0y=206.0250:SendingPointerACTION_MOVEx=285.0y=205.0251:SendingPointerACTION_MOVEx=290.0y=213.0252:SendingPointerACTION_UPx=290.0y=213.0253Sleepingfor0milliseconds254:SendKey(ACTION_DOWN):82255:SendKey(ACTION_UP):82256Sleepingfor0milliseconds257:SendingPointerACTION_MOVEx=-5.0y=3.0258:SendingPointerACTION_MOVEx=3.0y=2.0259:SendingPointerACTION_MOVEx=-1.0y=2.0260:SendingPointerACTION_MOVEx=-4.0y=4.0261:SendingPointerACTION_MOVEx=-4.0y=0.0262:SendingPointerACTION_MOVEx=-2.0y=2.0263:SendingPointerACTION_MOVEx=3.0y=2.0264:SendingPointerACTION_MOVEx=-2.0y=-5.0265:SendingPointerACTION_MOVEx=1.0y=4.0266:SendingPointerACTION_MOVEx=-4.0y=-5.0267:SendKey(ACTION_DOWN):21268:SendKey(ACTION_UP):21269Sleepingfor0milliseconds270:SendingPointerACTION_MOVEx=0.0y=-5.0271:SendingPointerACTION_MOVEx=3.0y=-5.0272:SendingPointerACTION_MOVEx=4.0y=0.0273:SendingPointerACTION_MOVEx=-4.0y=3.0274:SendingPointerACTION_MOVEx=4.0y=1.0275:SendingPointerACTION_MOVEx=-4.0y=3.0276:SendingPointerACTION_MOVEx=-1.0y=-4.0277:SendingPointerACTION_MOVEx=-2.0y=-2.0278:SendingPointerACTION_MOVEx=-4.0y=-3.0279:SendingPointerACTION_MOVEx=-5.0y=-1.0280:SendKey(ACTION_DOWN):3281:SendKey(ACTION_UP):3282//KEYCODE_HOME//KEYCODE_HOME//KEYCODE_DPAD_LEFT//KEYCODE_DPAD_LEFT//KEYCODE_MENU//KEYCODE_MENU
    //RejectingstartofIntent{act=android.intent.action.MAIN
     cat=[android.intent.category.HOME]cmp=com.android.launcher/.Launcher}inpackagecom.android.launcher283Sleepingfor0milliseconds284:SendingPointerACTION_DOWNx=74.0y=201.0285:SendingPointerACTION_UPx=74.0y=201.0286Sleepingfor0milliseconds287:SendKey(ACTION_DOWN):23288:SendKey(ACTION_UP):23289Sleepingfor0milliseconds290:SendingPointerACTION_MOVEx=3.0y=-2.0291:SendingPointerACTION_MOVEx=-2.0y=-1.0292:SendingPointerACTION_MOVEx=-5.0y=4.0293:SendingPointerACTION_MOVEx=-2.0y=0.0294:SendingPointerACTION_MOVEx=3.0y=2.0295:SendingPointerACTION_MOVEx=0.0y=0.0296:SendingPointerACTION_MOVEx=4.0y=3.0297:SendingPointerACTION_MOVEx=-3.0y=-1.0298:SendingPointerACTION_MOVEx=-4.0y=1.0299:SendingPointerACTION_MOVEx=-5.0y=1.0300:SendingPointerACTION_DOWNx=0.0y=0.0301:SendingPointerACTION_UPx=0.0y=0.0302Sleepingfor0milliseconds303:SendKey(ACTION_DOWN):21304:SendKey(ACTION_UP):21305306Sleepingfor0milliseconds307:SendKey(ACTION_DOWN):82308:SendKey(ACTION_UP):82309Sleepingfor0milliseconds310:SendKey(ACTION_DOWN):20311:SendKey(ACTION_UP):20312Sleepingfor0mil
    liseconds313:SendKey(ACTION_DOWN):20314:SendKey(ACTION_UP):20315Sleepingfor0milliseconds//KEYCODE_DPAD_DOWN//KEYCODE_DPAD_DOWN//KEYCODE_DPAD_DOWN//KEYCODE_DPAD_DOWN//KEYCODE_MENU//KEYCODE_MENU//KEYCODE_DPAD_LEFT//KEYCODE_DPAD_LEFT//KEYCODE_DPAD_CENTER//KEYCODE_DPAD_CENTER
    //activityResuming(wfh.LessonTable)
     316:SendKey(ACTION_DOWN):21317:SendKey(ACTION_UP):21
    //KEYCODE_DPAD_LEFT//KEYCODE_DPAD_LEFT
    318Sleepingfor0milliseconds??????319:SendingPointerACTION_MOVEx=-4.0y=2.0320:SendingPointerACTION_MOVEx=4.0y=0.0321//Sendingevent#100322:SendingPointerACTION_MOVEx=3.0y=0.0323:SendingPointerACTION_MOVEx=3.0y=1.0324:SendingPointerACTION_MOVEx=3.0y=-5.0325:SendingPointerACTION_MOVEx=-4.0y=3.0326:SendingPointerACTION_MOVEx=1.0y=-2.0327:SendingPointerACTION_MOVEx=0.0y=2.0328:SendingPointerACTION_MOVEx=-2.0y=1.0329:SendingPointerACTION_MOVEx=2.0y=-1.0330:SendingPointerACTION_MOVEx=4.0y=2.0331:SendingPointerACTION_MOVEx=-1.0y=2.0332:SendingPointerACTION_MOVEx=3.0y=-3.0333:SendingPointerACTION_MOVEx=4.0y=0.0334:SendingPointerACTION_MOVEx=0.0y=-1.0335:SendingPointerACTION_MOVEx=4.0y=-1.0336:SendingPointerACTION_MOVEx=-4.0y=4.0337:SendingPointerACTION_MOVEx=4.0y=4.0338:SendingPointerACTION_MOVEx=-4.0y=2.0339:SendingPointerACTION_MOVEx=2.0y=-2.0340:SendKey(ACTION_DOWN):22341:SendKey(ACTION_UP):22342Sleepingfor0milliseconds343:SendKey(ACTION_DOWN):53344:SendKey(ACTION_UP):53345Sleepingfor0milliseconds346:SendKey(ACTION_DOWN):24347:SendKey(ACTION_UP):24348Sleepingfor0milliseconds349:SendKey(ACTION_DOWN):82350:SendKey(ACTION_UP):82351Sleepingfor0milliseconds//KEYCODE_MENU//KEYCODE_MENU//KEYCODE_VOLUME_UP//KEYCODE_VOLUME_UP//KEYCODE_Y//KEYCODE_Y//KEYCODE_DPAD_RIGHT//KEYCODE_DPAD_RIGHT
     352:SendingPointerACTION_DOWNx=149.0y=150.0353:SendingPointerACTION_MOVEx=149.0y=151.0354:SendingPointerACTION_MOVEx=152.0y=158.0355:SendingPointerACTION_MOVEx=148.0y=162.0356:SendingPointerACTION_MOVEx=148.0y=156.0357:SendingPointerACTION_MOVEx=152.0y=149.0358:SendingPointerACTION_MOVEx=155.0y=146.0359:SendingPointerACTION_MOVEx=150.0y=138.0360:SendingPointerACTION_MOVEx=155.0y=142.0361:SendingPointerACTION_MOVEx=162.0y=150.0362:SendingPointerACTION_UPx=162.0y=150.0363Sleepingfor0milliseconds364:SendKey(ACTION_DOWN):82365:SendKey(ACTION_UP):82366//KEYCODE_MENU//KEYCODE_MENU
    //AllowingstartofIntent{cmp=wfh.LessonTable/.AWeekLesson}inpackagewfh.LessonTable
    367Sleepingfor0milliseconds368:SendingPointerACTION_MOVEx=0.0y=-1.0369:SendingPointerACTION_MOVEx=-2.0y=0.0370:SendingPointerACTION_MOVEx=2.0y=2.0371:SendingPointerACTION_MOVEx=-5.0y=-1.0372:SendingPointerACTION_MOVEx=-1.0y=0.0373:SendingPointerACTION_MOVEx=-4
    .0y=4.0374:SendingPointerACTION_MOVEx=4.0y=4.0375:SendingPointerACTION_MOVEx=3.0y=-2.0376:SendingPointerACTION_MOVEx=2.0y=2.0377:SendingPointerACTION_MOVEx=-1.0y=-1.0378:SendKey(ACTION_DOWN):19379:SendKey(ACTION_UP):19380Sleepingfor0milliseconds381:SendingPointerACTION_DOWNx=134.0y=239.0382:SendingPointerACTION_UPx=134.0y=239.0383Sleepingfor0milliseconds384:SendKey(ACTION_DOWN):4385:SendKey(ACTION_UP):4386Sleepingfor0milliseconds//KEYCODE_BACK//KEYCODE_BACK//KEYCODE_DPAD_UP//KEYCODE_DPAD_UP
     387:SendKey(ACTION_DOWN):23388389:SendKey(ACTION_UP):23390Sleepingfor0milliseconds391:SendKey(ACTION_DOWN):22392:SendKey(ACTION_UP):22393Sleepingfor0milliseconds394:SendKey(ACTION_DOWN):19395:SendKey(ACTION_UP):19396Sleepingfor0milliseconds397:SendKey(ACTION_DOWN):21398:SendKey(ACTION_UP):21399Sleepingfor0milliseconds400:SendKey(ACTION_DOWN):19401:SendKey(ACTION_UP):19402Sleepingfor0milliseconds403:SendKey(ACTION_DOWN):23404:SendKey(ACTION_UP):23405Sleepingfor0milliseconds
    //KEYCODE_DPAD_CENTER//KEYCODE_DPAD_CENTER//KEYCODE_DPAD_RIGHT//KEYCODE_DPAD_RIGHT//KEYCODE_DPAD_UP//KEYCODE_DPAD_UP//KEYCODE_DPAD_LEFT//KEYCODE_DPAD_LEFT//KEYCODE_DPAD_UP//KEYCODE_DPAD_UP//KEYCODE_DPAD_CENTER//KEYCODE_DPAD_CENTER
    //activityResuming(wfh.LessonTable)
    406:SendingPointerACTION_DOWNx=118.0y=37.0407:SendingPointerACTION_MOVEx=119.0y=33.0408:SendingPointerACTION_UPx=119.0y=33.0409Sleepingfor0milliseconds410:SendingPointerACTION_DOWNx=297.0y=358.0411:SendingPointerACTION_MOVEx=289.0y=363.0412:SendingPointerACTION_MOVEx=284.0y=369.0413:SendingPointerACTION_UPx=284.0y=369.0414Sleepingfor0milliseconds415:SendingPointerACTION_DOWNx=258.0y=403.0416:SendingPointerACTION_MOVEx=249.0y=398.0417:SendingPointerACTION_MOVEx=258.0y=393.0418:SendingPointerACTION_MOVEx=258.0y=402.0419:SendingPointerACTION_MOVEx=263.0y=395.0420:SendingPointerACTION_MOVEx=266.0y=399.0421:SendingPointerACTION_MOVEx=273.0y=403.0422:SendingPointerACTION_UPx=273.0y=403.0
     423Sleepingfor0milliseconds424:SendingPointerACTION_MOVEx=-5.0y=-5.0425:SendingPointerACTION_MOVEx=1.0y=-2.0426:SendingPointerACTION_MOVEx=1.0y=-4.0427:SendingPointerACTION_MOVEx=-2.0y=2.0428:SendingPointerACTION_MOVEx=3.0y=-3.0429:SendingPointerACTION_MOVEx=2.0y=-4.0430:SendingPointerACTION_MOVEx=-5.0y=2.0431:SendingPointerACTION_MOVEx=0.0y=0.0432当测试到ACTION_MOVEx=0.0y=0.0这个动作时,发生了FC(ForceClose)错误,以下为输出错误信息。同时在LogCat里面也有错误输出,而且LogCat433里面的错误信息更为详细,在实际的测试中应该结合两者输出的信息进行调试程序。434435//CRASH:wfh.LessonTable(pid1973)436//ShortMsg:java.lang.NullP
    ointerException437//LongMsg:java.lang.NullPointerException//BuildLabel:43android:generic/sdk/generic/:2.1-update1/ECLAIR/35983:eng/test-ke8ys439//BuildChangelist:35983440//BuildTime:1273161972441//ID:442//Tag:AndroidRuntime443//java.lang.NullPointerException:444//445446447atandroid.widget.TabHost.dispatchKeyEvent(TabHost.java:279)//atandroid.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:748)//atandroid.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:748)//atandroid.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:748)atandroid.widget.TabHost.dispatchKeyEvent(TabHost.java:275)//atandroid.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:748)//atandroid.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:748)
    448//449450
     45//at1android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:748)//at45com.android.internal.policy.impl.PhoneWindow$DecorView.superDispat2chKeyEvent(PhoneWindow.java:1655)//at45com.android.internal.policy.impl.PhoneWindow.superDispatchKeyEvent3(PhoneWindow.java:1102)45//4atandroid.app.Activity.dispatchKeyEvent(Activity.java:2038)
    //at45com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchKey5Event(PhoneWindow.java:1631)//at45android.view.ViewRoot.deliverKeyEventToViewHierarchy(ViewRoot.java6:2368)457//atandroid.view.ViewRoot.handleFinishedEvent(ViewRoot.java:2338)atandroid.view.ViewRoot.handleMessage(ViewRoot.java:1641)atandroid.os.Handler.dispatchMessage(Handler.java:99)atandroid.os.Looper.loop(Looper.java:123)atandroid.app.ActivityThread.main(ActivityThread.java:4363)atjava.lang.reflect.Method.invokeNative(Method.java:-2)atjava.lang.reflect.Method.invoke(Method.java:521)
    458//459//460//461//462//463//
    //at46com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteI4nit.java:860)465//atcom.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)atdalvik.system.NativeStart.main(NativeStart.java:-2)
    466//467
    468**Monkeyabortedduetoerror.469Eventsinjected:190470:Dropped:keys=0pointers=11trackballs=0flips=0471##Networkstats:elapsedtime=27954ms(27954msmobile,0mswifi,0msnotconnected)
    472**Systemappearstohavecrashedatevent190of200usingseed0473#
     474475476开始monkey测试时android的LogCat输出的信息:47747811-0108:52:53.712:DEBUG/AndroidRuntime(2077):>>>>>>>>>>>>>>AndroidRuntimeSTART<<<<<<<<<<<<<<11-0108:52:54.453:DEBUG/AndroidRuntime(2077):---registeringnativefunctions---
    47911-0108:52:53.742:DEBUG/AndroidRuntime(2077):CheckJNIisON480
    48111-0108:52:55.542:DEBUG/ddm-heap(2077):Gotfeaturelistrequest11-0108:52:59.533:INFO/ActivityManager(53):Startingactivity:Intent{act=android.intent.action.MAIN482cat=[android.intent.category.LAUNCHER]flg=0x10000000cmp=wfh.LessonTable/.MainTable}48348448511-0108:53:00.842:INFO/ActivityManager(53):Displayedactivitywfh.LessonTable/.MainTable:126
    6ms(total1266ms)11-0108:53:03.123:DEBUG/dalvikvm(1973):GCfreed7524objects/507616bytesin246ms11-0108:53:03.173:INFO/dalvikvm(1973):Uncaughtexceptionthrownbyfinalizer(willbediscarded):
    11-0108:53:03.213:INFO/dalvikvm(1973):Ljava/lang/IllegalStateException;:Finalizingcursor486android.database.sqlite.SQLiteCursor@43c585c0onMOthathasnotbeendeactivatedorclosed11-0108:53:03.213:INFO/dalvikvm(1973):at48android.database.sqlite.SQLiteCursor.finalize(SQLiteCursor.java:5796)48848911-0108:53:03.213:INFO/dalvikvm(1973):atdalvik.system.NativeStart.run(NativeMethod)11-0108:53:03.233:INFO/dalvikvm(1973):Uncaughtexceptionthrownbyfinalizer(willbediscarded):
    11-0108:53:03.252:INFO/dalvikvm(1973):Ljava/lang/IllegalStateException;:Finalizingcursor490android.database.sqlite.SQLiteCursor@43c57f98onMOthathasnotbeendeactivatedorclosed11-0108:53:03.252:INFO/dalvikvm(1973):at49android.database.sqlite.SQLiteCursor.finalize(SQLiteCursor.java:5196)49211-0108:53:03.252:INFO/dalvikvm(1973):atdalvik.system.NativeStart.run(NativeMethod)
     493
    11-0108:53:03.263:INFO/dalvikvm(1973):Uncaughtexceptionthrownbyfinalizer(willbediscarded):
    11-0108:53:03.293:INFO/dalvikvm(1973):Ljava/lang/IllegalStateException;:Finalizingcursor494android.database.sqlite.SQLiteCursor@43c57970onMOthathasnotbeendeactivatedorclosed11-0108:53:03.293:INFO/dalvikvm(1973):at49android.database.sqlite.SQLiteCursor.finalize(SQLiteCursor.java:5596)49649711-0108:53:03.303:INFO/dalvikvm(1973):atdalvik.system.NativeStart.run(NativeMethod)11-0108:53:03.323:INFO/dalvikvm(1973):Uncaughtexceptionthrownbyfinalizer(willbediscarded):
    11-0108:53:03.323:INFO/dalvikvm(1973):Ljava/lang/IllegalStateException;:Finalizingcursor498android.database.sqlite.SQLiteCursor@43c57330onMOthathasnotbeendeactivatedorclosed11-0108:53:03.333:INFO/dalvikvm(1973):at49android.database.sqlite.SQLiteCursor.finalize(SQLiteCursor.java:5996)50050111-0108:53:03.353:INFO/dalvikvm(1973):atdalvik.system.NativeStart.run(NativeMethod)11-0108:53:03.363:INFO/dalvikvm(1973):Uncaughtexceptionthrownbyfinalizer(willbediscarded):
    11-0108:53:03.403:INFO/dalvikvm(1973):Ljava/lang/IllegalStateException;:Finalizingcursor502android.database.sqlite.SQLiteCursor@43c45330onMOthathasnotbeendeactivatedorclosed11-0108:53:03.403:INFO/dalvikvm(1973):at50android.database.sqlite.SQLiteCursor.finalize(SQLiteCursor.java:5396)50450511-0108:53:03.403:INFO/dalvikvm(1973):atdalvik.system.NativeStart.run(NativeMethod)11-0108:53:03.423:INFO/dalvikvm(1973):Uncaughtexceptionthrownbyfinalizer(willbediscarded):
    11-0108:53:03.433:INFO/dalvikvm(1973):Ljava/lang/IllegalStateException;:Finalizingcursor506android.database.sqlite.SQLiteCursor@43c44d08onMOthathasnotbeendeactivatedorclosed5011-0108:53:03.443:INFO/dalvikvm(1973):at7android
    .database.sqlite.SQLiteCursor.finalize(SQLiteCursor.java:5
     96)50850911-0108:53:03.443:INFO/dalvikvm(1973):atdalvik.system.NativeStart.run(NativeMethod)11-0108:53:03.453:INFO/dalvikvm(1973):Uncaughtexceptionthrownbyfinalizer(willbediscarded):
    11-0108:53:03.483:INFO/dalvikvm(1973):Ljava/lang/IllegalStateException;:Finalizingcursor510android.database.sqlite.SQLiteCursor@43c446c8onMOthathasnotbeendeactivatedorclosed11-0108:53:03.483:INFO/dalvikvm(1973):at51android.database.sqlite.SQLiteCursor.finalize(SQLiteCursor.java:5196)51251311-0108:53:03.503:INFO/dalvikvm(1973):atdalvik.system.NativeStart.run(NativeMethod)11-0108:53:03.523:INFO/dalvikvm(1973):Uncaughtexceptionthrownbyfinalizer(willbediscarded):
    11-0108:53:03.563:INFO/dalvikvm(1973):Ljava/lang/IllegalStateException;:Finalizingcursor514android.database.sqlite.SQLiteCursor@43c26288onMOthathasnotbeendeactivatedorclosed11-0108:53:03.572:INFO/dalvikvm(1973):at51android.database.sqlite.SQLiteCursor.finalize(SQLiteCursor.java:5596)51651711-0108:53:03.572:INFO/dalvikvm(1973):atdalvik.system.NativeStart.run(NativeMethod)11-0108:53:03.622:INFO/dalvikvm(1973):Uncaughtexceptionthrownbyfinalizer(willbediscarded):
    11-0108:53:03.642:INFO/dalvikvm(1973):Ljava/lang/IllegalStateException;:Finalizingcursor518android.database.sqlite.SQLiteCursor@43c25cb0onMOthathasnotbeendeactivatedorclosed11-0108:53:03.642:INFO/dalvikvm(1973):at51android.database.sqlite.SQLiteCursor.finalize(SQLiteCursor.java:5996)52052152211-0108:53:03.662:INFO/dalvikvm(1973):atdalvik.system.NativeStart.run(NativeMethod)11-0108:53:03.662:INFO/dalvikvm(1973):Uncaughtexceptionthrownbyfinalizer(willbediscarded):11-0108:53:03.722:INFO/dalvikvm(1973):Ljava/lang/IllegalStateException;:Finalizingcursor
     android.database.sqlite.SQLiteCursor@43c256d8onMOthathasnotbeendeactivatedorclosed11-0108:53:03.722:INFO/dalvikvm(1973):at52android.database.sqlite.SQLiteCursor.finalize(SQLiteCursor.java:5396)52452511-0108:53:03.722:INFO/dalvikvm(1973):atdalvik.system.NativeStart.run(NativeMethod)11-0108:53:03.732:INFO/dalvikvm(1973):Uncaughtexceptionthrownbyfinalizer(willbediscarded):
    11-0108:53:03.752:INFO/dalvikvm(1973):Ljava/lang/IllegalStateException;:Finalizingcursor526android.database.sqlite.SQLiteCursor@43c250e8onMOthathasnotbeendeactivatedorclosed11-0108:53:03.752:INFO/dalvikvm(1973):at52android.database.sqlite.SQLiteCursor.finalize(SQLiteCursor.java:5796)52852911-0108:53:03.762:INFO/dalvikvm(1973):atdalvik.system.NativeStart.run(NativeMethod)11-0108:53:03.902:INFO/dalvikvm(1973):Uncaughtexceptionthrownbyfinalizer(willbediscarded):
    11-0108:53:03.902:INFO/dalvikvm(1973):Ljava/lang/IllegalStateException;:Finalizingcursor530android.database.sqlite.SQLiteCursor@43c1e780onMOthathasnotbeendeactivatedorclosed11-01
    08:53:03.902:INFO/dalvikvm(1973):at53android.database.sqlite.SQLiteCursor.finalize(SQLiteCursor.java:5196)53253353453553653711-0108:53:03.912:INFO/dalvikvm(1973):atdalvik.system.NativeStart.run(NativeMethod)11-0108:53:04.247:WARN/KeyCharacterMap(1973):Nokeyboardforid011-0108:53:04.252:WARN/KeyCharacterMap(1973):Usingdefaultkeymap:/system/usr/keychars/qwerty.kcm.bin11-0108:53:04.762:INFO/ActivityManager(53):Startingactivity:Intent{cmp=wfh.LessonTable/.EditLesson}11-0108:53:05.233:WARN/WindowManager(53):Nowindowtodispatchpointeraction011-0108:53:05.533:WARN/WindowManager(53):Nowindowtodispatchpointeraction1
    53811-0108:53:06.782:INFO/ActivityManager(53):Displayedactivity
     wfh.LessonTable/.EditLesson:1637ms(total1637ms)53954011-0108:53:09.623:WARN/ActivityManager(53):Launchtimeouthasexpired,givingupwakelock!11-0108:53:09.682:WARN/ActivityManager(53):ActivityidletimeoutforHistoryRecord{43d3ab48wfh.LessonTable/.MainTable}
    11-0108:53:12.662:INFO/ActivityManager(53):Startingactivity:Intent{act=android.intent.action.MAIN541cat=[android.intent.category.HOME]flg=0x10200000cmp=com.android.launcher/.Launcher}11-0108:53:15.433:INFO/NotificationService(53):enqueueToastpkg=wfh.LessonTable542callback=android.app.ITransientNotification$Stub$Proxy@43d5b308duration=154311-0108:53:15.513:INFO/System.out(1973):UpdateRecord54411-0108:53:19.353:INFO/NotificationService(53):enqueueToastpkg=androidcallback=android.widget.Toast$TN@43ced790duration=0
    11-0108:53:19.752:WARN/InputManagerService(53):Windowalready545focused,ignoringfocusgainof:com.android.internal.view.IInputMethodClient$Stub$Proxy@43d2bab054654711-0108:53:20.752:INFO/ActivityManager(53):Startingactivity:Intent{cmp=wfh.LessonTable/.AWeekLesson(hasextras)}11-0108:53:21.852:INFO/ActivityManager(53):Displayedactivitywfh.LessonTable/.AWeekLesson:1028ms(total1028ms)11-0108:53:27.113:WARN/dalvikvm(1973):threadid=3:threadexitingwithuncaughtexception(group=0x4001b188)
    54811-0108:53:27.093:DEBUG/AndroidRuntime(1973):ShuttingdownVM549550551552以下为LogCat输出的错误信息,在以下的信息中首先从自己的包中找错误,如果没有自己的包的话就再找发生错误的包的第一个发生了异常。由错误提示可以看出很大的可能是因为TabHost引发的异常。经过查看代码发现是由553于TabHost的编写不规范,TabHost与其中一个view放在了一起,monkey在测试做滚球上下滚动时当滚到TabHost时就发生了异常了。所以把TabHost与Activity分开写就不会出现些问题了。55455555655711-0108:53:27.113:ERROR/AndroidRuntime(1973):Uncaughthandler:
     threadmainexitingduetouncaughtexception55855956056156256356456556611-0108:53:27.133:ERROR/AndroidRuntime(1973):java.lang.NullPointerException11-0108:53:27.133:ERRO
    R/AndroidRuntime(1973):atandroid.widget.TabHost.dispatchKeyEvent(TabHost.java:279)11-0108:53:27.133:ERROR/AndroidRuntime(1973):atandroid.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:748)11-0108:53:27.133:ERROR/AndroidRuntime(1973):atandroid.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:748)11-0108:53:27.133:ERROR/AndroidRuntime(1973):atandroid.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:748)11-0108:53:27.133:ERROR/AndroidRuntime(1973):atandroid.widget.TabHost.dispatchKeyEvent(TabHost.java:275)11-0108:53:27.133:ERROR/AndroidRuntime(1973):atandroid.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:748)11-0108:53:27.133:ERROR/AndroidRuntime(1973):atandroid.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:748)11-0108:53:27.133:ERROR/AndroidRuntime(1973):atandroid.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:748)
    11-0108:53:27.133:ERROR/AndroidRuntime(1973):at56com.android.internal.policy.impl.PhoneWindow$DecorView.superDispat7chKeyEvent(PhoneWindow.java:1655)11-0108:53:27.133:ERROR/AndroidRuntime(1973):at56com.android.internal.policy.impl.PhoneWindow.superDispatchKeyEvent8(PhoneWindow.java:1102)5611-0108:53:27.133:ERROR/AndroidRuntime(1973):at9android.app.Activity.dispatchKeyEvent(Activity.java:2038)11-0108:53:27.133:ERROR/AndroidRuntime(1973):at57com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchKey0Event(PhoneWindow.java:1631)11-0108:53:27.133:ERROR/AndroidRuntime(1973):at57android.view.ViewRoot.deliverKeyEventToViewHierarchy(ViewRoot.jav1a:2368)57257357411-0108:53:27.133:ERROR/AndroidRuntime(1973):atandroid.view.ViewRoot.handleFinishedEvent(ViewRoot.java:2338)11-0108:53:27.133:ERROR/AndroidRuntime(1973):atandroid.view.ViewRoot.handleMessage(ViewRoot.java:1641)11-0108:53:27.133:ERROR/AndroidRuntime(1973):atandroid.os.Handler.dispatchMessage(Handler.java:99)at
    57511-0108:53:27.133:ERROR/AndroidRuntime(1973):
     android.os.Looper.loop(Looper.java:123)57657757811-0108:53:27.133:ERROR/AndroidRuntime(1973):atandroid.app.ActivityThread.main(ActivityThread.java:4363)11-0108:53:27.133:ERROR/AndroidRuntime(1973):atjava.lang.reflect.Method.invokeNative(NativeMethod)11-0108:53:27.133:ERROR/AndroidRuntime(1973):java.lang.reflect.Method.invoke(Method.java:521)at
    11-0108:53:27.133:ERROR/AndroidRuntime(1973):at57com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteI9nit.java:860)580581582583584585586587588589590591四、总结:592在monkey测试中常用的命令组合有:5931、monkey-pcom.yourpackage-v500//简单的输出测试的信息。5945952、monkey-pcom.yourpackage-v-v-v500//以深度为三级输出测试信息。3、monkey-pcom.yourpackage--port端口号-v//为测试分配一个专用的端口号,不过这个命令只能输出跳转的信息及有错误时输出信息。11-0108:53:27.133:ERROR/AndroidRuntime(1973):atcom.android.internal.os.Zygo
    teInit.main(ZygoteInit.java:618)11-0108:53:27.133:ERROR/AndroidRuntime(1973):dalvik.system.NativeStart.main(NativeMethod)at
    11-0108:53:27.163:INFO/Process(53):Sendingsignal.PID:1973SIG:311-0108:53:27.173:INFO/dalvikvm(1973):threadid=7:reactingtosignal311-0108:53:27.173:ERROR/dalvikvm(1973):Unabletoopenstacktracefile'/data/anr/traces.txt':Permissiondenied11-0108:53:27.622:INFO/AndroidRuntime(2077):AndroidRuntimeonExitcallingexit(190)11-0108:53:33.702:WARN/ActivityManager(53):Launchtimeouthasexpired,givingupwakelock!11-0108:53:33.733:WARN/ActivityManager(53):ActivityidletimeoutforHistoryRecord{43d3ab48wfh.LessonTable/.MainTable}11-0108:53:41.173:DEBUG/dalvikvm(1334):GCfreed62objects/3120bytesin2419ms11-0108:53:43.742:WARN/ActivityManager(53):ActivitydestroytimeoutforHistoryRecord{43dc5028wfh.LessonTable/.AWeekLesson}
    5964、monkey-pcom.yourpackage-s数字-v500//为随机数的事件序列
     定一个值,若出现问题下次可以重复同样的系列进行排错。597598599五、附录:600以下内容为android系统中的keycode值,在以后的调试中会经常需要查询:601KEYCODE_UNKNOWN=0;602KEYCODE_SOFT_LEFT=1;603KEYCODE_SOFT_RIGHT=2;604KEYCODE_HOME=3;605KEYCODE_BACK=4;606KEYCODE_CALL=5;607KEYCODE_ENDCALL=6;608KEYCODE_0=7;609KEYCODE_1=8;610KEYCODE_2=9;611KEYCODE_3=10;612KEYCODE_4=11;613KEYCODE_5=12;614KEYCODE_6=13;615KEYCODE_7=14;616KEYCODE_8=15;617KEYCODE_9=16;618KEYCODE_STAR=17;619KEYCODE_POUND=18;620KEYCODE_DPAD_UP=19;621KEYCODE_DPAD_DOWN=20;622KEYCODE_DPAD_LEFT=21;623KEYCODE_DPAD_RIGHT=22;624KEYCODE_DPAD_CENTER=23;625KEYCODE_VOLUME_UP=24;626KEYCODE_VOLUME_DOWN=25;627KEYCODE_POWER=26;628KEYCODE_CAMERA=27;629KEYCODE_CLEAR=28;630KEYCODE_A=29;//----------------------------------//----------------------------------5、monkey-pcom.yourpackage-v--throttle3000500//为每一次执行一次有效的事件后休眠3000毫秒。
     631KEYCODE_B=30;632KEYCODE_C=31;633KEYCODE_D=32;634KEYCODE_E=33;635KEYCODE_F=34;636KEYCODE_G=35;637KEYCODE_H=36;638KEYCODE_I=37;639KEYCODE_J=38;640KEYCODE_K=39;641KEYCODE_L=40;642KEYCODE_M=41;643KEYCODE_N=42;644KEYCODE_O=43;645KEYCODE_P=44;646KEYCODE_Q=45;647KEYCODE_R=46;648KEYCODE_S=47;649KEYCODE_T=48;650KEYCODE_U=49;651KEYCODE_V=50;652KEYCODE_W=51;653KEYCODE_X=52;654KEYCODE_Y=53;655KEYCODE_Z=54;656KEYCODE_COMMA=55;657KEYCODE_PERIOD=56;658KEYCODE_ALT_LEFT=57;659KEYCODE_ALT_RIGHT=58;660KEYCODE_SHIFT_LEFT=59;661KEYCODE_SHIFT_RIGHT=60;662KEYCODE_TAB=61;663KEYCODE_SPACE=62;664KEYCODE_SYM=63;665KEYCODE_EXPLORER=64;//----------------------------------666KEYCODE_ENVELOPE=65;//---------------信封-------------------//-----------------,-----------------//-----------------.------------------
     667KEYCODE_ENTER=66;668KEYCODE_DEL=67;669KEYCODE_GRAVE=68;670KEYCODE_MINUS=69;
    671KEYCODE_EQUALS=70;//---------------坟墓-------------------//---------------负-------------------//--------------等于(=)--------------------//---------------------------//----------------------------
    672KEYCODE_LEFT_BRACKET=71;673KEYCODE_RIGHT_BRACKET=72;674KEYCODE_BACKSLASH=73;675KEYCODE_SEMICOLON=74;677KEYCODE_SLASH=76;678KEYCODE_AT=77;679KEYCODE_NUM=78;680KEYCODE_HEADSETHOOK=79;682KEYCODE_PLUS=81;683KEYCODE_MENU=82;684KEYCODE_NOTIFICATION=83;685KEYCODE_SEARCH=84;
    //-------------反斜线\--------------//--------------;-------------//--------------/?-------------//------------------@--------------//----------------------------
    676KEYCODE_APOSTROPHE=75;//---------------’-------------
    681KEYCODE_FOCUS=80;//*Camera*focus//------------+---------------//----------------------------
    686KEYCODE_MEDIA_PLAY_PAUSE=85;687KEYCODE_MEDIA_STOP=86;688KEYCODE_MEDIA_NEXT=87;689KEYCODE_MEDIA_PREVIOUS=88;690KEYCODE_MEDIA_REWIND=89;692KEYCODE_MUTE=91;
    分类:Android测试
    //------------倒带----------------
    691KEYCODE_MEDIA_FAST_FORWARD=90;//-----------静音-----------------
    
    
  • 上一篇资讯: android ndk
  • 网学推荐

    免费论文

    原创论文

    浏览:
    设为首页 | 加入收藏 | 论文首页 | 论文专题 | 设计下载 | 网学软件 | 论文模板 | 论文资源 | 程序设计 | 关于网学 | 站内搜索 | 网学留言 | 友情链接 | 资料中心
    版权所有 QQ:3710167 邮箱:3710167@qq.com 网学网 [Myeducs.cn] 您电脑的分辨率是 像素
    Copyright 2008-2015 myeducs.Cn www.myeducs.Cn All Rights Reserved
    湘ICP备09003080号