目的
友盟的集成测试可以实时看到日志,不需要等到第二天。但如果使用安卓真机调试的话还是有点麻烦,所以记录一下我使用模拟器集成测试的步骤。
添加测试设备
1、安装DeviceID.apk(用来查看设备信息)
2、安装成功后,在设备上打开(推荐 海马玩模拟器)
3、软件会自动获取到 IMEI 和WIFI MAC Address ,这两个值在友盟的后台需要用到
输入获取到的device_id,mac,例如:{"device_id":"xxxx","mac_address":"xxxx"} 名称:填设备名称
注:前提是应用已集成友盟SDK
5、打包APK,安装好在模拟器上,启动APP,在友盟的后台日志就会实时刷新,如下图所示
Android查看调试Log?
安装好Android SDK后,在android sdk的 xxx/android-sdk/tools/monitor.bat 双击打开monitor.bat就会弹出Android Device Monitor
游戏启动之后看Log中的 MobclickAgent 的信息
如果log中看不到mac_address,在AndroidManifest.xml中添加
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
UALogEntry(client_stats:ClientStats(successful_requests:13,Failed_requests:0,last_request_spent_ms:115),app_info:AppInfo(key:556bd4ac67e58e72040029b3,version:1.10810 Development,version_index:10810,package_name:com.cosmosBox.StrikeHero,sdk_type:ANDROID,sdk_version:5.5.3.0,channel:Development,wrapper_type:Unity,wrapper_version:1.6,vertical_type:1),device_info:DeviceInfo(device_id:357656050778701,idmd5:55528b4fefa7e5aea9096a38cf6eb8d,mac_address:, model:C6802,cpu:ARMv7 Processor rev 0 (v7l),os:Android,os_version:4.3,resolution:Resolution(height:1824,width:1080),device_board:MSM8974,device_brand:Sony,device_manutime:1389197219000,device_manufacturer:Sony,device_manuid:14.2.A.1.136,device_name:C6802),misc_info:MiscInfo(time_zone:8,language:zh,country:TW,carrier:CTM,access_type:ACCESS_TYPE_WIFI),sessions:[Session(id:43DB0F728E6AA7AEC7897836E637F248,start_time:1433232881322,end_time:1433234025158,duration:1143836,pages:[Page(page_name:Home,duration:8299),Page(page_name:ChapterList,duration:3591),Page(page_name:Home,duration:47018),duration:14051),duration:1610),Page(page_name:LevelList,duration:57496),duration:5041),duration:324340),duration:51677),duration:3630),duration:2892)],traffic:Traffic(upload_traffic:211819,download_traffic:97588))],imprint:Imprint(property:{umid=ImprintValue(value:55528b4fefa7e5aea9096a38cf6eb8d,ts:1433230219745,guid:91fb418336fde92a273ff42021da5fd812753a2f)},version:1,checksum:517f8b423fa10ae18b2d47bb09f8d12d),id_tracking:IdTracking(snapshots:{android_id=IdSnapshot(identity:99bcbdb70940cf02,ts:1433230386545,version:1),utdid=IdSnapshot(identity:VW1Z/6ojZY4DAHyxJck9p/+P,ts:1433230386548,serial=IdSnapshot(identity:EP7327JRUT,imei=IdSnapshot(identity:357656050778701,ts:1433230386544,idmd5=IdSnapshot(identity:55528b4fefa7e5aea9096a38cf6eb8d,version:1)},journals:[]))
友盟SDK for unity开发文档:http://dev.umeng.com/game_analytics/game-unity/integration#1
游戏统计集成测试文档: http://dev.umeng.com/game_analytics/gt/game-test#1
实时日志截图
下面是一些我在对接友盟SDK的实时日志截图
触发行为:点金手
触发行为:买VIP
触发行为:恢复体力