简体   繁体   English

Android Emulator:将文件写入本地文件系统?

[英]Android Emulator: Write file to local file system?

I am wondering if its possible to get my android application to save a file to a windows file system or is there a simple work around I can adopt? 我想知道是否有可能让我的Android应用程序将文件保存到Windows文件系统,或者我可以采用一种简单的解决方法?

I am using the android emulator to do tests and I need it to write to the local hard drive so I can do further processing on the file. 我正在使用android模拟器进行测试,我需要将其写入本地硬盘驱动器,以便可以对文件进行进一步处理。

I hope this is possible and I appreciate any help. 我希望这是可能的,并感谢您的帮助。

您可以将文件保存到仿真器的SD卡中,然后执行adb pull

据我所知答案是否定的,您可以将文件保存到SD卡或应用程序的存储中,并使用Eclipse中的文件资源管理器工具(“窗口->显示视图->其他->文件资源管理器”)提取该文件文件到您的计算机或使用adb pull方法

If you are using conventional SDK the answer is (probably) no. 如果您使用的是传统的SDK,答案(可能)是“否”。 If you look at ~/.android/avd you will see that whatever your emulator is doing is stored into *.img files. 如果查看〜/ .android / avd,您会发现模拟器所做的一切都存储在* .img文件中。 Said that you can create some sort of service running on the localhost and connect to that from your app. 说您可以创建在本地主机上运行的某种服务,然后从您的应用程序连接到该服务。 This will actually better resemble real-life scenario 实际上,这将更好地类似于现实生活中的场景

Based on your reaction to @pixie answer it looks like I misunderstood your question. 根据您对@pixie答案的反应,似乎我误解了您的问题。 Indeed you can simply use your Eclipse DDMS perspective to navigate to the file and then "pull" or "push" a file. 实际上,您可以简单地使用Eclipse DDMS透视图导航到文件,然后“拉”或“推”文件。 You can't just do it programmatically from withing your app 您不仅可以通过应用程序以编程方式进行操作

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM