使用 GUI -OR- adb 命令从模拟器中提取文件时出现问题
我正在 Eclipse Win7x64 中开发我的第一个 Android 应用程序,但在提取 SQLite 文件来检查其中的内容时遇到问题。我使用 DDMS GUI 来拉取时看到了这个问题,这似乎有些已知:
[2011-03-01 20:15:51] 拉选失败
[2011-03-01 20:15:51](空)
所以我尝试了 adb 命令行,虽然它似乎看到了该文件,但实际上并没有可以在高清上找到。我尝试了多种语法,在路径中使用前/后斜杠,并在文件名周围加上引号,而没有显式路径。我得到“374 kb/s (6144 b)”或任何表明拉取成功的信息,但该文件不存在。
I'm developing my first Android application in Eclipse, Win7x64 and am having trouble pulling a SQLite file to inspect what's getting in it. I'm seeing this problem using DDMS GUI to pull, which seems somewhat known:
[2011-03-01 20:15:51] Failed to pull selection
[2011-03-01 20:15:51] (null)
So I tried the adb command line and while it appears to see the file, it is not to be found on the HD. I've tried multiple syntaxes with front/back slashes in the path and quotes surrounding the filename with no explicit path. I get "374 kb/s (6144 b)" or whatever suggesting a successful pull, but the file is not there.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
重新启动 Eclipse 为我解决了这个问题(文件菜单,重新启动选项)。
Restarting Eclipse fixed this for me (File Menu, Restart option).
您是否尝试从
/data/data/your.application.name
中提取数据?您使用的是量产手机吗?如果是这样,你可能就不走运了;生产手机不允许访问该目录。您是否指定了源名称和目标名称?
adb 坚持目标名称是文件名,而不是目录;特别是,
.
表示“将文件放入 CWD”将不起作用。除此之外,不知道。你的报告听起来确实有点奇怪。
您可能会发现尝试创建 AVD(模拟设备)并部署到该设备很有用。 AVD 不是生产设备,因此您可以做真正手机不允许您做的事情,例如修改应用程序的私有数据区域。如果这是权限问题,这将解决它。
Are you trying to pull from
/data/data/your.application.name
? Are you on a production phone? If so, you may be out of luck; production phones disallow access to that directory.Are you specifying both the source and destination names?
adb insists on the destination name being a filename, not a directory; in particular,
.
to mean 'put the file in the CWD' won't work.Other than that, dunno. Your report does sound a bit peculiar.
You may find it useful to try creating an AVD (an emulated device) and deploying to that. AVDs are not production devices and as such you can do things that real phones won't let you, like tinkering in your application's private data area. If this is a permissions problem this will work round it.
您只需 adb 这一系列步骤和命令:
1- 转到平台工具所在的目录。
(我的是:C:\Program Files (x86)\Android\android-sdk\platform-tools)
2-点击Ctrl + Shitt +鼠标右键,选择“在此处打开命令窗口”
(这是打开命令提示符,您还可以打开命令提示符并键入命令: cd C:\Program Files (x86)\Android\android-sdk\platform-tools)
3- 打开 shell 后,键入以下命令
如果您输入了该内容,现在您可以看到数据库,如果您单击 DDMS 中的下拉按钮,则会出现错误。
但您需要做的是输入最后一个命令:
因此,这些是完整的命令序列:
You just need to adb this secuence of steps and commands:
1- Go to the directory where your platform tools resides.
(Mine is: C:\Program Files (x86)\Android\android-sdk\platform-tools)
2- Click Ctrl + Shitt + Mouse right button and select "Open Command Window here"
(This is to open the command promt, you can also open the command promt and type the command: cd C:\Program Files (x86)\Android\android-sdk\platform-tools)
3- Once the shell is open, type this commands
If you typed that, now you can see the databases, and if you click the pull button in the DDMS, then the error arises.
But what you need to do is to type this last command:
So, these are the full sequence of commands:
重新启动修复了通过 GUI 使用 DDMS 拉取的问题。
A reboot fixed the problem with using the DDMS pull via GUI.
如果您在 VirtualBox 上运行模拟器,问题可能是权限问题。因此,使用 Alt+F1 从正在运行的模拟器中更改权限,并
If you run the emulator on a VirtualBox, the problem could be permissions. So, change the permissions from within the running emulator with Alt+F1 and