使用 Eclipse DDMS 将大文件推送到模拟器/SD 卡的问题

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/7521122/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 17:02:00  来源:igfitidea点击:

Problem Pushing Large File to Emulator/SDcard with Eclipse DDMS

androideclipseandroid-emulatorandroid-sdcardddms

提问by JPM

I am using Eclipse DDMS to push a file over onto my Android Emulator sdcard. I select the file and press Open, a dialog pops up and starts pushing the file. In the view "File Explorer" in the DDMS perspective I can see the sdcard directory and can see my file created in it. Then in the popup the progress meter gets halfway then I get this error in the Console window:

我正在使用 Eclipse DDMS 将文件推送到我的 Android Emulator sdcard 上。我选择文件并按打开,弹出一个对话框并开始推送文件。在 DDMS 透视图中的“文件资源管理器”视图中,我可以看到 sdcard 目录并可以看到我在其中创建的文件。然后在弹出窗口中进度表到达一半然后我在控制台窗口中收到此错误:

[2011-09-22 15:15:56] Failed to push the item(s).
[2011-09-22 15:15:56] (null)

Then the File Explorer completely refreshes and the file disappears. I know the sdcard is setup for 1G of space and the file I am pushing is only 9M.

然后文件资源管理器完全刷新,文件消失。我知道 sdcard 的空间设置为 1G,而我推送的文件只有 9M。

Here are images during push and after fail.

这是推送期间和失败后的图像。

Start of PushAfter failure Notification

推送开始After failure Notification

So what am I doing wrong or what do I need to do to fix this?

那么我做错了什么或者我需要做什么来解决这个问题?

回答by JPM

Here is the way you fix it. I had a large file about 160M so what was happening it was most likely timing out. So to fix this I went to the Eclipse Windows -> Preferences -> Android -> DDMS then I set the ADB connection time out to 500000 and checked "Thread updates enabled" and checked Heap updates enabled". I was then able to push any file size up to the sdcard. I got the idea after reading this thread

这是您修复它的方法。我有一个大约 160M 的大文件,所以发生的事情很可能是超时了。所以为了解决这个问题,我去了 Eclipse Windows -> Preferences -> Android -> DDMS 然后我将 ADB 连接超时设置为 500000 并检查“启用线程更新”并检查启用堆更新。然后我能够推送任何文件大小高达 SD 卡。阅读此线程后我有了想法

Restart the IDE in some cases in mine I didn't need to.

在我不需要的某些情况下重新启动 IDE。

enter image description here

enter image description here

回答by ryvianstyron

I know the question is already answered and accepted - but I solved this problem a different way. Sometimes, I'm not quite sure "why" but the ADB needs to be reset.

我知道这个问题已经得到回答并被接受 - 但我以不同的方式解决了这个问题。有时,我不太确定“为什么”,但 ADB 需要重置。

When your emulator is running, do the following:

当您的模拟器运行时,请执行以下操作:

  1. Go to DDMS
  2. Go to Devices under DDMS
  3. Select your running emulator so that its highlighted.
  4. In the top right hand corner of your devices screen there's a little "down arrow". Click it
  5. Hit the reset ADB option and do not be alarmed by the force quit red text in console window.
  1. 前往 DDMS
  2. 转到 DDMS 下的设备
  3. 选择您正在运行的模拟器,使其突出显示。
  4. 在设备屏幕的右上角有一个小的“向下箭头”。点击它
  5. 点击重置 ADB 选项,不要被控制台窗口中的强制退出红色文本警告。

You should now be able to push files onto the system fine, as long as your SD card is set to a size that can handle it.

您现在应该可以正常地将文件推送到系统上,只要您的 SD 卡设置为可以处理它的大小。

Hope this helps someone!

希望这对某人有帮助!

回答by Mahendran A

Just restart the your eclipse IDE.It will work perfectly.

只需重新启动您的 Eclipse IDE。它将完美运行。

回答by NujnaH

Can't add a comment so I guess I have to add this as an answer. Does it work if you try doing adb push filename /mnt/sdcard/ftp/new/ ?

无法添加评论,所以我想我必须将其添加为答案。如果您尝试执行 adb push filename /mnt/sdcard/ftp/new/ ,它是否有效?

If that doesn't work either, try doing a kill-server and start-server on the adb and maybe that'll work.

如果这也不起作用,请尝试在 adb 上执行 kill-server 和 start-server,也许这会起作用。

回答by Hox

you can upload files to sdcard image using PassMark OSMount - just mount card image in read/write mode and it appears as harddisk in windows. Also much faster than uploading via adb/ddms

您可以使用 PassMark OSMount 将文件上传到 sdcard 映像 - 只需以读/写模式挂载卡映像,它就会在 Windows 中显示为硬盘。也比通过 adb/ddms 上传快得多