I am developing under Android 1.6 (Android SDK 2.1). I create a avd by using avd manager in Eclipse. When I launch this avd, I found that the /sdcard directory's permisson is "d---------". So I can't push file to the sdcard.
我正在开发Android 1.6 (Android SDK 2.1)。我在Eclipse中使用avd管理器创建avd。当我启动avd时,我发现/sdcard目录的permisson是“d---------”。所以我不能把文件推到sdcard。
Does anyone know how to solve this problem?
有人知道如何解决这个问题吗?
20 个解决方案
#1
121
I found this works
我发现这工作
$./adb shell
$su
mount -o rw,remount rootfs /
chmod 777 /mnt/sdcard
exit
Source: http://www.coderanch.com/t/611842/Android/Mobile/Android-emulator-sdcard-writable
来源:http://www.coderanch.com/t/611842/Android/Mobile/Android-emulator-sdcard-writable
#2
48
Once you started the Emulator from one shell, login to another shell & type
一旦您从一个shell启动模拟器,登录到另一个shell & type
adb shell
You should see # prompt
displayed, this is your device(emulator) shell. Now , type following command at adb shell.
您应该会看到# prompt显示,这是您的设备(模拟器)shell。现在,在adb shell中输入以下命令。
mount -o remount rw /sdcard
This will now remount /sdcard
with rw(read-write)
permission & now you can push your files into /sdcard
by using following command from your host shell.
这将使用rw(读写)权限重新加载/sdcard,现在您可以使用来自主机shell的以下命令将文件推入/sdcard。
`adb push filename.mp3 /sdcard,`
where filename.mp3 could be any file that you want to push into Android Emulator.
文件名的地方。mp3可以是任何你想要进入Android模拟器的文件。
Hope this helps :)
希望这有助于:)
#3
19
Ensure two things in the AVD manager utility for the emulator:
确保仿真器的AVD manager实用程序中有两件事:
-
SD Card size is mentioned e.g. 512.
SD卡尺寸如512。
-
From the Hardware tag, press New and select "SD Card Support" from the drop down menu.
从硬件标签,按新的和选择“SD卡支持”从下拉菜单。
Now, start the emulator. SD Card shall now support writing as well.
现在,启动模拟器。SD卡也应该支持书写。
#4
9
Android studio version 0.8.9 and above has a bug creating AVDs.
Android studio 0.8.9及以上版本有创建AVDs的错误。
See Issue 78434.
看到发行78434。
Workaround
解决方案
- go to your ADV folder in .android folder and find your AVD config.ini
- 在.android文件夹中找到你的文件夹,找到你的AVD config.ini文件。
- open it with a text editor that can handle unix newlines. (Notepad will run the lines together since they don't have CR-LFs.)
- 使用可以处理unix换行的文本编辑器打开它。(记事本将一起运行这些行,因为它们没有CR-LFs。)
- change
hw.sdCard=no
tohw.sdCard=yes
- 改变hw。sdCard = no hw.sdCard = yes
this should work for everyone in new builds
这应该适用于所有的新构建版本。
#5
6
Maybe it sounds stupid but it worked for me when I had the same problem: delete the created avd and create one again through AVD Manager with a sd card of, for example, 512MB.
也许这听起来很愚蠢,但当我遇到同样的问题时,它对我起了作用:删除已创建的avd,然后通过带有sd卡(例如512MB)的avd Manager再次创建一个avd。
Check that both have the correct permissions and if not, try to change them with chmod.
检查两者是否具有正确的权限,如果没有,请尝试使用chmod更改它们。
And if everything still fails, repeat the process but creating both avd and sd card manually via terminal:
如果仍然失败,重复这个过程,但是通过终端手工创建avd和sd卡:
android create avd -n my_avd -t 7
mksdcard -l e 512M mysdcard.img
emulator -avd my_avd -sdcard mysdcard.img
Hope that helps!
希望会有帮助!
#6
6
I think the problem here is that you forgot to set SD card size
我认为这里的问题是你忘记设置SD卡的大小
Follow these steps to make it work:
遵循以下步骤使它工作:
- step1: close running emulator
- 步骤1:关闭运行模拟器
- step2: open Android Virtual Device Manager(eclipse menu bar)
- step2:打开Android虚拟设备管理器(eclipse菜单栏)
- step3: choose your emulator -> Edit -> then set SD card size
- 步骤3:选择模拟器->编辑->,然后设置SD卡大小
This works well in my emulator!
这在我的模拟器中工作得很好!
#7
4
Make sure that you had given a value which is greater than zero for SD Card size in the Create AVD Window for that particular emulator.
确保在创建AVD窗口中为特定的仿真器指定的值大于0。
#8
3
mount -o remount, rw /sdcard
安装-o重新安装,rw /sdcard
this is the correct way to remount your sdcard using your emulator.
这是使用模拟器重新挂载sdcard的正确方式。
#9
2
I increased the virtual memory of sdcard up to 512 MB for the emulator and that was enough
我增加了sdcard的虚拟内存到512mb的模拟器,这就足够了。
#10
2
i tried @user2002993 great help but it one place it need to be a little edit so i edited and here what worked for me on android studio , emulator android 5 . go to your adb folder right click on blank arena and select "opne command window here " or if you installed adb by adb-installer open cmd and type these commands ( for not misunderstand i made command BOLD )
我尝试了@user2002993,很好的帮助,但是有一个地方它需要做一点编辑,所以我进行了编辑,这里是android studio,模拟器android 5。进入你的adb文件夹右键点击空白的竞技场,选择“opne命令窗口”或者如果你通过adb-installer安装了adb,打开cmd并输入这些命令(为了不理解错误,我将命令加粗)
adb devices
亚洲开发银行设备
"it should show your emulator number and detail . then followed command here : "
它应该显示你的模拟器号和细节。然后是命令:"
adb shell
亚行壳
"now it shuld show u prompt #"
“现在它会显示#提示符”
su
苏
mount -o rw,remount rootfs
mount - o rw,重新安装rootfs
chmod 777 /mnt/sdcard
chmod 777 / mnt / sdcard
exit
退出
exit
退出
yeah double exit needed .. now your prompt of adb shell is gone . put a file in to your adb folder and give this command and see if it got fixed
是的,需要双重出口。现在你对adb shell的提示已经没有了。将一个文件放到adb文件夹中,并给出这个命令,看看它是否得到了修复
adb push "your file name like : 1.jpg" /sdcard/
adb推送“您的文件名:1.jpg”/sdcard/
or
或
adb push "your file name like : 1.jpg" /storage/sdcard/
adb推送“您的文件名:1.jpg”/存储/sdcard/
now in cmd it shoudl show you transfer time instead of creepy read-only thing :)
现在在cmd里,它应该向你展示传输时间,而不是令人毛骨悚然的只读:)
#11
1
make sure that you have the correct permissions.
确保您有正确的权限。
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
#12
1
I guess, you didn't insert memory size at the time of creating avd. you can do that by editing the avd.
我猜,在创建avd时,您没有插入内存大小。您可以通过编辑avd来实现这一点。
#13
0
Windows uses backward slashes, linux uses forward slashes.
Windows使用反向斜杠,linux使用正向斜杠。
#14
0
sometimes this can cause of a very simple reason, go to your list in eclipse and check whether you have set SDCard size
有时,这可能导致一个非常简单的原因,在eclipse中访问您的列表,并检查您是否设置了SDCard大小。
#15
0
I had this problem on Android L developer preview, and, at least for this version, I solved it by creating an sdcard with a size that had square 2 size (e.g 128M, 256M etc)
我在Android L开发者预览中遇到了这个问题,至少在这个版本中,我通过创建一个大小为2的sdcard (e)来解决这个问题。g 128米、256米等)
#16
0
In adb version 1.0.32 and Eclipse Luna (v 4.4.1).
在adb版本1.0.32和Eclipse Luna (v4.4.1)中。
I found a directory in the avd /mnt/media_rw/sdcard that you can write to using the adb command. adb push {source} /mnt/media_rw/sdcard
我在avd /mnt/media_rw/sdcard中找到了一个目录,您可以使用adb命令编写该目录。亚行推源} { / mnt / media_rw / sdcard
There appears to be rw access to this directory.
似乎有rw访问这个目录。
Hope this helps :-)
希望这有助于:-)
#17
0
Alternate way: Dismount the drive (from settings/storage) and re-mount the sdcard also fixes the problem. (verify by moving a file from internal storage to sdcard) In any case, this simple method saved my butt this time :)
另一种方法:从设置/存储中卸载驱动器,重新安装sdcard也可以修复问题。(通过将文件从内部存储移动到sdcard进行验证)在任何情况下,这个简单的方法都挽救了我的屁股:)
#18
0
- Give any size to Sdcard in Emulator
- 在模拟器中给Sdcard提供任何大小
- unchecked the read only option from c:\user...android\avd -> properties
- 不选中来自c:\用户…安卓\ avd - >属性
- push a file through file explorer
- 通过文件资源管理器推送文件
- restart the Emulator
- 重新启动模拟器
It will definitely works
它肯定会
#19
0
With me in the end helped In the emulator to run applications manager and setting permissions for storage.
最后,我帮助模拟器运行应用程序管理器并设置存储权限。
#20
0
Try this in a Terminal Emulator as root:
在终端模拟器中尝试这样作为根:
restorecon -v -R /data/media
#1
121
I found this works
我发现这工作
$./adb shell
$su
mount -o rw,remount rootfs /
chmod 777 /mnt/sdcard
exit
Source: http://www.coderanch.com/t/611842/Android/Mobile/Android-emulator-sdcard-writable
来源:http://www.coderanch.com/t/611842/Android/Mobile/Android-emulator-sdcard-writable
#2
48
Once you started the Emulator from one shell, login to another shell & type
一旦您从一个shell启动模拟器,登录到另一个shell & type
adb shell
You should see # prompt
displayed, this is your device(emulator) shell. Now , type following command at adb shell.
您应该会看到# prompt显示,这是您的设备(模拟器)shell。现在,在adb shell中输入以下命令。
mount -o remount rw /sdcard
This will now remount /sdcard
with rw(read-write)
permission & now you can push your files into /sdcard
by using following command from your host shell.
这将使用rw(读写)权限重新加载/sdcard,现在您可以使用来自主机shell的以下命令将文件推入/sdcard。
`adb push filename.mp3 /sdcard,`
where filename.mp3 could be any file that you want to push into Android Emulator.
文件名的地方。mp3可以是任何你想要进入Android模拟器的文件。
Hope this helps :)
希望这有助于:)
#3
19
Ensure two things in the AVD manager utility for the emulator:
确保仿真器的AVD manager实用程序中有两件事:
-
SD Card size is mentioned e.g. 512.
SD卡尺寸如512。
-
From the Hardware tag, press New and select "SD Card Support" from the drop down menu.
从硬件标签,按新的和选择“SD卡支持”从下拉菜单。
Now, start the emulator. SD Card shall now support writing as well.
现在,启动模拟器。SD卡也应该支持书写。
#4
9
Android studio version 0.8.9 and above has a bug creating AVDs.
Android studio 0.8.9及以上版本有创建AVDs的错误。
See Issue 78434.
看到发行78434。
Workaround
解决方案
- go to your ADV folder in .android folder and find your AVD config.ini
- 在.android文件夹中找到你的文件夹,找到你的AVD config.ini文件。
- open it with a text editor that can handle unix newlines. (Notepad will run the lines together since they don't have CR-LFs.)
- 使用可以处理unix换行的文本编辑器打开它。(记事本将一起运行这些行,因为它们没有CR-LFs。)
- change
hw.sdCard=no
tohw.sdCard=yes
- 改变hw。sdCard = no hw.sdCard = yes
this should work for everyone in new builds
这应该适用于所有的新构建版本。
#5
6
Maybe it sounds stupid but it worked for me when I had the same problem: delete the created avd and create one again through AVD Manager with a sd card of, for example, 512MB.
也许这听起来很愚蠢,但当我遇到同样的问题时,它对我起了作用:删除已创建的avd,然后通过带有sd卡(例如512MB)的avd Manager再次创建一个avd。
Check that both have the correct permissions and if not, try to change them with chmod.
检查两者是否具有正确的权限,如果没有,请尝试使用chmod更改它们。
And if everything still fails, repeat the process but creating both avd and sd card manually via terminal:
如果仍然失败,重复这个过程,但是通过终端手工创建avd和sd卡:
android create avd -n my_avd -t 7
mksdcard -l e 512M mysdcard.img
emulator -avd my_avd -sdcard mysdcard.img
Hope that helps!
希望会有帮助!
#6
6
I think the problem here is that you forgot to set SD card size
我认为这里的问题是你忘记设置SD卡的大小
Follow these steps to make it work:
遵循以下步骤使它工作:
- step1: close running emulator
- 步骤1:关闭运行模拟器
- step2: open Android Virtual Device Manager(eclipse menu bar)
- step2:打开Android虚拟设备管理器(eclipse菜单栏)
- step3: choose your emulator -> Edit -> then set SD card size
- 步骤3:选择模拟器->编辑->,然后设置SD卡大小
This works well in my emulator!
这在我的模拟器中工作得很好!
#7
4
Make sure that you had given a value which is greater than zero for SD Card size in the Create AVD Window for that particular emulator.
确保在创建AVD窗口中为特定的仿真器指定的值大于0。
#8
3
mount -o remount, rw /sdcard
安装-o重新安装,rw /sdcard
this is the correct way to remount your sdcard using your emulator.
这是使用模拟器重新挂载sdcard的正确方式。
#9
2
I increased the virtual memory of sdcard up to 512 MB for the emulator and that was enough
我增加了sdcard的虚拟内存到512mb的模拟器,这就足够了。
#10
2
i tried @user2002993 great help but it one place it need to be a little edit so i edited and here what worked for me on android studio , emulator android 5 . go to your adb folder right click on blank arena and select "opne command window here " or if you installed adb by adb-installer open cmd and type these commands ( for not misunderstand i made command BOLD )
我尝试了@user2002993,很好的帮助,但是有一个地方它需要做一点编辑,所以我进行了编辑,这里是android studio,模拟器android 5。进入你的adb文件夹右键点击空白的竞技场,选择“opne命令窗口”或者如果你通过adb-installer安装了adb,打开cmd并输入这些命令(为了不理解错误,我将命令加粗)
adb devices
亚洲开发银行设备
"it should show your emulator number and detail . then followed command here : "
它应该显示你的模拟器号和细节。然后是命令:"
adb shell
亚行壳
"now it shuld show u prompt #"
“现在它会显示#提示符”
su
苏
mount -o rw,remount rootfs
mount - o rw,重新安装rootfs
chmod 777 /mnt/sdcard
chmod 777 / mnt / sdcard
exit
退出
exit
退出
yeah double exit needed .. now your prompt of adb shell is gone . put a file in to your adb folder and give this command and see if it got fixed
是的,需要双重出口。现在你对adb shell的提示已经没有了。将一个文件放到adb文件夹中,并给出这个命令,看看它是否得到了修复
adb push "your file name like : 1.jpg" /sdcard/
adb推送“您的文件名:1.jpg”/sdcard/
or
或
adb push "your file name like : 1.jpg" /storage/sdcard/
adb推送“您的文件名:1.jpg”/存储/sdcard/
now in cmd it shoudl show you transfer time instead of creepy read-only thing :)
现在在cmd里,它应该向你展示传输时间,而不是令人毛骨悚然的只读:)
#11
1
make sure that you have the correct permissions.
确保您有正确的权限。
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
#12
1
I guess, you didn't insert memory size at the time of creating avd. you can do that by editing the avd.
我猜,在创建avd时,您没有插入内存大小。您可以通过编辑avd来实现这一点。
#13
0
Windows uses backward slashes, linux uses forward slashes.
Windows使用反向斜杠,linux使用正向斜杠。
#14
0
sometimes this can cause of a very simple reason, go to your list in eclipse and check whether you have set SDCard size
有时,这可能导致一个非常简单的原因,在eclipse中访问您的列表,并检查您是否设置了SDCard大小。
#15
0
I had this problem on Android L developer preview, and, at least for this version, I solved it by creating an sdcard with a size that had square 2 size (e.g 128M, 256M etc)
我在Android L开发者预览中遇到了这个问题,至少在这个版本中,我通过创建一个大小为2的sdcard (e)来解决这个问题。g 128米、256米等)
#16
0
In adb version 1.0.32 and Eclipse Luna (v 4.4.1).
在adb版本1.0.32和Eclipse Luna (v4.4.1)中。
I found a directory in the avd /mnt/media_rw/sdcard that you can write to using the adb command. adb push {source} /mnt/media_rw/sdcard
我在avd /mnt/media_rw/sdcard中找到了一个目录,您可以使用adb命令编写该目录。亚行推源} { / mnt / media_rw / sdcard
There appears to be rw access to this directory.
似乎有rw访问这个目录。
Hope this helps :-)
希望这有助于:-)
#17
0
Alternate way: Dismount the drive (from settings/storage) and re-mount the sdcard also fixes the problem. (verify by moving a file from internal storage to sdcard) In any case, this simple method saved my butt this time :)
另一种方法:从设置/存储中卸载驱动器,重新安装sdcard也可以修复问题。(通过将文件从内部存储移动到sdcard进行验证)在任何情况下,这个简单的方法都挽救了我的屁股:)
#18
0
- Give any size to Sdcard in Emulator
- 在模拟器中给Sdcard提供任何大小
- unchecked the read only option from c:\user...android\avd -> properties
- 不选中来自c:\用户…安卓\ avd - >属性
- push a file through file explorer
- 通过文件资源管理器推送文件
- restart the Emulator
- 重新启动模拟器
It will definitely works
它肯定会
#19
0
With me in the end helped In the emulator to run applications manager and setting permissions for storage.
最后,我帮助模拟器运行应用程序管理器并设置存储权限。
#20
0
Try this in a Terminal Emulator as root:
在终端模拟器中尝试这样作为根:
restorecon -v -R /data/media