HTC wildfire, application crashes if phone is connected to logcat and app tries to access the sd card

我怕爱的太早我们不能终老 提交于 2019-12-25 08:36:02

问题


I have an HTC Wildfire and I'm using it for testing my applications. I want to have to phone always connected with the usb to the pc so I can see the logs in LogCat or use a debugger.

The problem starts when i try to access the SD card from the app.

Although the phone is in "HTC Sync" mode and I can see the logs... when the app tries to access the SD card then the app crashes. So I have to remove the usb every time I want to test and replug it (and waiiiiiit ) to redeploy the app.

Any suggestions?


回答1:


You can still see logcat if the device is not mounted as a filesystem just as long as it's connected to the USB.

When the device is mounted as an external file system on USB, your pc has control over your SD card, so you can't access it from your app. You need to handle this case and not access the SD card in this case.

See this post for additional info.




回答2:


Ok I found the solution. Although I had downloaded recently the HTC, looks like there was a new version. It installed the latest driver and now it works pretty fine. Thanks a lot.



来源:https://stackoverflow.com/questions/9040165/htc-wildfire-application-crashes-if-phone-is-connected-to-logcat-and-app-tries

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!