Android模拟器SD卡突然只读(未安装?) [英] Android emulator sdcard suddenly read-only(failing to mount?)

查看:127
本文介绍了Android模拟器SD卡突然只读(未安装?)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在使用Android模拟器用了几个星期已安装SD卡,现在没有问题。今天,我开始了我的应用程序,它崩溃了NullPointerException异常时,我的活动尝试访问到/ mnt / SD卡。我检查DDMS文件浏览器,并到/ mnt / SD卡似乎是空的。我尝试将文件推到它,但它只读,权限是d ---------。有这两条线在logcat的输出的开头:

I've been using the android emulator with a mounted sdcard for a couple weeks now with no problem. Today I start my app and it crashes with a NullPointerException when my activity tries to access /mnt/sdcard. I check the DDMS file explorer and /mnt/sdcard seems to be empty. I try to push a file onto it but it's read-only, permissions are d---------. There are these two lines at the beginning of the logcat output:

D/Vold    (   29): Volume sdcard state changing -1 (Initializing) -> 0 (No-Media)
D/Vold    (   29): Volume sdcard state changing 0 (No-Media) -> 1 (Idle-Unmounted)

所以我把它的意思是sdcard.img突然没有安装出于某种原因。任何想法,为什么这将是?

So I take it to mean that sdcard.img is suddenly failing to mount for some reason. Any ideas why this would be?

推荐答案

打开一个shell到模拟器

Open up a shell to the emulator

adb shell

然后键入以下命令:

Then type the following command:

mount -o remount,rw /sdcard

现在行了?

这篇关于Android模拟器SD卡突然只读(未安装?)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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