问题
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