Android模拟器sdcard权限,如何给读取写入权限的android 2.3模拟器的SD卡?(How to give read write permissions to sdcard for an...

如何给读取写入权限的android 2.3模拟器的SD卡?(How to give read write permissions to sdcard for android 2.3 emulator?)

嗨,我需要保持图像在我的SD卡。 为此,我试图将我的图像插入SD卡,但它在ddms中显示sdcard d --------。 我如何给emulator 2.3.3版本提供读写权限? 请帮我解决这个问题.....

提前致谢

Hi I need to keep images in my sdcard. So for that I tried to push my images into the sdcard but it is displaying sdcard d-------- in ddms. How can I give read and write permissions to emulator 2.3.3 version? Please help me regarding this.....

Thanks in advance

原文:https://stackoverflow.com/questions/10513694

更新时间:2019-12-25 18:07

最满意答案

我不认为这个权限字符串从那以后就改变了。 只需添加

您需要先在仿真器上添加“虚拟”外部存储器。 在AVD中,选择您的模拟器,选择编辑,然后在SD卡 - 大小下输入您想要的SD卡大小。

I don't think the permission string has changed ever since. Just add

You need to add "virtual" external memory on your emulator first. In AVD, select your emulator, choose Edit, then type in the size of the sdcard you want under SD Card - Size.

2012-05-09

相关问答

我发现它非常笨拙并且不能很好地工作,但使用的命令是: adb push yourfile.xxx /sdcard/yourfile.xxx 。 为此,您必须将文件放在与您的SDK目录的tools文件夹中的adb.exe相同的目录中,或者将adb设置为系统可识别的命令。 (我不记得怎么做,但我知道它可以完成)。 这也假定您已经通过AVD管理器设置了SD卡。 但是,我这样做时遇到的问题是,有时文件将出现在仿真器上,大小为0字节。 我的意思是我可以在Eclipse中的DDMS文件浏览器中看到该文件,但是

...

SD卡(外部存储) 可移动存储不是外部存储 。 我在清单文件中添加了权限 这些权限与可移动存储无关。 我收到了这个错误 您没有直接文件系统访问可移动存储上的任意位置。 你知道如何允许访问EXTERNAL SD CARD吗? 或者: 在Android 4.4+上,在Android 4.4+上使用getExternalFilesDirs() , getExternalCacheDirs()和/或getExternalMediaDirs() (注意方法名称的复数形式),以便在可移动存储上访问应用程序的唯

...

假设您的仿真器附有有效的SD卡映像,则您的/sdcard目录已经是可读/写的。 Your /sdcard directory already is read/write, assuming you have a valid SD card image attached to your emulator.

问题在于启动模拟器时的命令行参数 〜/ sdcard256m.img 我不得不扩展“ 〜 ”并将其更改为 /home/username/sdcard256m.img 在模拟器中检测到SD卡,我能够通过DDMS文件资源管理器推送文件。 The problem was with the command line parameter while launching the Emulator ~/sdcard256m.img I had to expand "~" and changed it to /h

...

我不认为这个权限字符串从那以后就改变了。 只需添加

您需要先在仿真器上添加“虚拟”外部存储器。 在AVD中,选择您的模拟器,选择编辑,然后在SD卡 - 大小下输入您想要的SD卡大小。 I don't think the permission string has changed ever since. Just

...

在avd目录中,它位于以下位置: 视窗: %USERPROFILE%.android \ AVD \ 有一个名为sdcard.img的文件。 你可以用新的图像文件替换它。 你可以在android-sdk / tools中使用mksdcard创建一个新的SD卡图像文件 用法:mksdcard [-l label] In the avd directory, which is in the following location: Windows:

...

1) 您可以将文件sdcard.img重命名为whatever.img并重新启动模拟器 2) 您可以在“设置”中的模拟器中卸载SD卡 3) 您可以使用sdcard图像将模拟器指向不存在的文件 ( http://developer.android.com/guide/developing/tools/emulator.html >磁盘映像> -sdcard开关) 4) 您无法从运行模拟器中卸载SD卡 (根据这个问题得出最佳答案:( 重新)在Android模拟器上安装SD卡 ) 5) 在硬件编辑虚拟设

...

好的,最后我自己得到了答案...... 我们在这个问题上遇到的第一件事是在执行模拟器时得到以下警告。 警告:SD卡文件必须至少为9MB,忽略/ dev / sdX 跟踪main.c中的源代码后, if (size < 9*1024*1024ULL) {

fprintf(stderr, "### WARNING: SD Card files must be at least 9MB, ignoring '%s'\n", opts->sdcard);

} e

...

首先你必须创建SD卡,否则它将无法读取或写入,首先创建SD卡 创建SD卡 第二次检查你的数据 First you have to create sdcard otherwise it will not read or write, 1st create sd-card create sd-card 2nd check like this your data

在SDK r10提供的模拟器上,您可以从主机获得执行“adb shell”的root shell。 一旦你有这样的root shell,你可以按照以下步骤获得一个命令,可以从终端模拟器以root身份登录你: # Remount /data to allow executables and setuids on it

mount -o remount,rw /dev/block/mtdblock1 /data

# There's no "cp" command on Android

cat /sy

...

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值