如何使用Android应用程序调试似乎与硬件无关的问题? [英] How can I debug a seemingly hardware-dependent issue with my Android app without access to the hardware?

查看:123
本文介绍了如何使用Android应用程序调试似乎与硬件无关的问题?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Android市场上有一个开源应用程序。对于我来说,似乎可以正常工作(有超过1,000个活动安装,我必须假设它适用于大多数人)。



我最近得到了一个错误报告,这表明三星手机中至少有三个用户出现问题(截取和Captivate)。我无法在ADP2和模拟器上重现问题。



为了获得足够的数据来诊断问题,我首先尝试添加日志记录我要求用户通过日志收集器提交日志。每次用户尝试发送日志(有四次尝试)时,它被截断,我没有得到任何有用的数据。



然后我添加了 ACRA 试图获取信息,但我似乎无法自动检测错误发送报告。



由于我没有三星手机,我无法在任何可以与调试器连接的地方复制,我大部分是的想法我唯一的想法是在UI中添加一个按钮来生成一个报告。



有没有其他方法可以建议?



更新:由于人们要求更多细节:本质上,应用程序从资产读取文本文件,并将它们(通过一些预处理)放入ScrollView中的TextView。 (数据被大量添加到SpannableStringBuffer中,然后传递给TextView的setText()函数。)根据所选择的选项,显示的文本介于15k-115k之间。在有这个问题的手机上,只显示部分文字。截止点取决于选项,但似乎在17k-18k之间。



ACRA向所有未捕获的异常发送报告,并将其放入Google表单/电子表格。我已经从我的模拟器和我的手机得到报告,所以我知道这个最终的工作。 (实际上,我经常发现从报告中的堆栈跟踪调试更快,而不是将调试器附加到进程)。



电话规格:我已经行使仿真器上的应用程序运行1.5,1.6,2.1和2.2。我的手机是ADP2(MyTouch的开发版),但是我已经安装了一个第三方ROM 跳到Froyo(2.2)。我不知道专门为三星操作系统构建的模拟器,虽然这将是非常有用的。



由于预期的文本长度不变,我应该能够检测是否正确读取。我在文本处理结束时添加了检查,但是从未触发,表明问题不在于读取文件。然后我尝试向onPostCreate和onPostResume添加检查,但是那些也没有失败。似乎UI线程还没有在这一点上实际运行。



我现在已经完成了6个私人APK版本,附加在错误跟踪器中的错误。我坦白地说,任何用户仍然在尝试他们,感到惊讶。这个最新版本有一个按钮强制一个bug报告 - 只有在UI线程布局屏幕后才会被调用。希望这将给我足够的可变信息,指向正确的方向。

解决方案

我们需要更多地了解性质的问题。是崩溃吗有什么不正确的?等等。

如果这是一个崩溃,你可以添加一个崩溃处理程序(Thread.setUncaughtExceptionHandler,IIRC),并创建一个格式更好的日志,可以选择发送到



此外,尝试收集有关手机规格(OS,分辨率等)的信息,并在调试器中进行重新设置。那些三星手机有Android 2.1 - 你的Nexus可能有2.2?尝试将模拟器设置为使用2.1?



每当我遇到这些问题,我礼貌地问那些写我的人,如果他们有兴趣帮助我 - 而且有通常是几个渴望志愿者的人。我向他们发送了一个带有特殊测试版本的APK文件,它具有额外的调试输出,这有助于我缩小问题。


I have an open-source application on the Android market. It seems to work fine for me (with over 1,000 active installs, I have to presume that it works for most people).

I recently got a bug report that indicated a problem for at least three users on Samsung phones (Intercept and Captivate). I have been unable to reproduce the problem on my ADP2 and on the emulator.

In order to get enough data to diagnose the problem, I first tried to add logging and then I asked users to submit logs via Log Collector. Each time a user tried to send the log (there were four attempts), it was truncated and I did not get any useful data.

I then added ACRA to the project in an attempt to get information, but I don't seem to be able to automatically detect the bug in order to send a report.

Since I don't have a Samsung phone and I can't reproduce it on anything where I could connect with the debugger, I am mostly out of ideas. The only idea I have left is to add a button to the UI to generate a report.

Are there any other approaches to suggest?

Update: since people are asking for more specifics: essentially, the app reads in text files from the assets and puts them (with some preprocessing) into a TextView in a ScrollView. (The data is prgressively added to a SpannableStringBuffer and then that is passed to TextView's setText() function.) Depending on the options chosen, the text displayed is between 15k-115k. On phones with this issue, only part of the text is displayed. The cutoff point depends on the options, but seems to be somewhere between 17k-18k.

ACRA sends a report for all uncaught exceptions and puts them into a Google Form/Spreadsheet. I've gotten reports from my emulator and from my phone, so I know that end works. (Actually, I've often found it faster to debug from the stack trace in that report than to attach the debugger to the process.)

Phone specs: I have exercised the app on emulators running 1.5, 1.6, 2.1, and 2.2. My phone is ADP2 (the developer version of the MyTouch), but I've installed a third-party ROM to jump up to Froyo (2.2). I am unaware of an emulator specifically for the Samsung OS build, although that would be quite helpful here.

Since the expected text length is constant, I should be able to detect if it is read correctly or not. I added checks at the end of my text processing, but those never triggered, indicating that the problem was not with reading the file. I then tried adding checks to onPostCreate and onPostResume, but those did not fail either. It seems that the UI thread had not yet actually run at that point, though.

I've now done 6 private APK versions attached to the bug in the bug tracker. I frankly am surprised that any users are still trying them. This latest version has a button to force a bug report - that will only be called after the UI thread has laid out the screen. Hopefully that will give me enough variable information to point me in the right direction.

解决方案

We'd need to know more about the nature of the problem. Is it a crash? Something doesn't look right? Etc.

If it's a crash, you could add a crash handler (Thread.setUncaughtExceptionHandler, IIRC) and have that create a better-formatted log that can optionally be sent to you.

Also, try to collect information about the specs of the phones (OS, resolution, etc) and repro that in the debugger. Those Samsung phones have Android 2.1 - your Nexus probably has 2.2? Did you try setting the emulator up to use 2.1?

Whenever I had these issues, I politely asked those who wrote me if they were interested in helping me - and there were typically several people who were eager to volunteer. I sent them an APK file with a special test version that had additional debug output, and that helped me narrow down the problem.

这篇关于如何使用Android应用程序调试似乎与硬件无关的问题?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆