更新到 Froyo 后无法使用 adb cd do sdcard
我的应用程序拍摄照片并保存到 SD 卡。它在 Android 2.1 上运行良好,但我刚刚升级到 Froyo,现在我得到:
ERROR/CameraPreview(28216): Problem taking picture
WARN/System.err(28216): java.io.FileNotFoundException: /mnt/sdcard/silviaterra/temp.jpg (Permission denied)
WARN/System.err(28216): at org.apache.harmony.luni.platform.OSFileSystem.openImpl(Native Method)
WARN/System.err(28216): at org.apache.harmony.luni.platform.OSFileSystem.open(OSFileSystem.java:152)
WARN/System.err(28216): at java.io.FileOutputStream.<init>(FileOutputStream.java:97)
WARN/System.err(28216): at java.io.FileOutputStream.<init>(FileOutputStream.java:69)
当我打开 adb shell(作为 root 用户)时,我得到:
$ cd sdcard
cd: can't cd to sdcard
$ cd mnt/sdcard
cd: can't cd to mnt/sdcard
我尝试终止并重新启动 adb 服务器,但没有运气。对发生的事情有什么想法吗?谢谢!
My application takes a picture and saves to the sdcard. It worked fine on Android 2.1, but I just upgraded to Froyo and now I'm getting:
ERROR/CameraPreview(28216): Problem taking picture
WARN/System.err(28216): java.io.FileNotFoundException: /mnt/sdcard/silviaterra/temp.jpg (Permission denied)
WARN/System.err(28216): at org.apache.harmony.luni.platform.OSFileSystem.openImpl(Native Method)
WARN/System.err(28216): at org.apache.harmony.luni.platform.OSFileSystem.open(OSFileSystem.java:152)
WARN/System.err(28216): at java.io.FileOutputStream.<init>(FileOutputStream.java:97)
WARN/System.err(28216): at java.io.FileOutputStream.<init>(FileOutputStream.java:69)
When I open up adb shell (as root user), I get:
$ cd sdcard
cd: can't cd to sdcard
$ cd mnt/sdcard
cd: can't cd to mnt/sdcard
I've tried killing and restarting the adb server, but no luck. Any ideas on what's going on? Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
好吧——这个有点棘手。结果我的“USB 连接类型”是“磁盘驱动器”,所以即使我已经从 Ubuntu 中卸载了 SD 卡,我猜仍然有一个锁。诀窍是切换回“仅充电”
Ok - this one was a bit tricky. Turns out that my "USB Connection Type" was "Disk drive", and so even though I had unmounted the sdcard from Ubuntu, I guess there was still a lock in place. The trick is to just switch back to "Charge Only"