Problems trying to push files into android device using eclipse

♀尐吖头ヾ 提交于 2019-12-08 00:43:03

问题


I'm currently using Samsung Galaxy S2 i1900G to try to test my application but apparently I need to push a database file in order for my application to connect to it and work. But it would seem that every time I try to push a file into the device I would get an error.

Here's the error I keep getting

[2012-05-20 16:16:26 - ddms] transfer error: Read-only file system
[2012-05-20 16:16:56] Failed to push selection: Read-only file system

I can't seem to figure out what the problem is. Will it make any difference if I were to root my phone? And is it possible to root Samsung Galaxy S2 i1900G model for now? Hope you guys can help me out.


回答1:


Here is the solution

  1. Open Android Virtual device manager
  2. select your emulator
  3. edit your emulator
  4. must specified size of your sd card 1024MB
  5. in hardware option click new set property add sd card support: yes(value)
  6. start your emulator, in eclipse window-->showview-->other->android-->file explorer
  7. ->in file explorer open mnt->sdcard and using pushfile button for insert your file and image
  8. DONE



回答2:


You can try adb shell mount -o remount,rw /data to remount /data as rw




回答3:


If your application needs to access a database, you don't need to copy one to the phone. And in any case, if you were to root the phone and force it on, this type of application would only work on your specific phone.

This article here - http://www.vogella.com/articles/AndroidSQLite/article.html - explains how to use an SQLite database with Android applications. You should just use the built-in API to create the database from your application if it doesn't already exist.




回答4:


This is probably since your device is connected in USB storage mode which means your SD card is mounted... You have to connect your device in a different mode in order for adb to be able to push files




回答5:


Even if it is working you won't be able to push to all dirs and it may look like you have a problem when you don't.

In the DDMS Perspective , file explorer tab select the sdcard directory and try a push - it should go - you can only push to rw dirs and some are read only. If you can do this then you just need to make sure the dir you are using is rw - which is shown in the permissions tab of the same view.



来源:https://stackoverflow.com/questions/10671987/problems-trying-to-push-files-into-android-device-using-eclipse

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!