adb - Push application-readable file to Android device -


i'm trying push file android device , read within test app. doesn't particularly matter file is, can hardcode path in app, file has written device separately. if push file somewhere adb, it's owned root permissions 660 , app can't open it. if run-as app , try read file, "permission denied". if try chmod file "operation not permitted". there way this, other rooting device?

you utilize application's internal private storage (usually present under /data/local/ has explicit adb shell user access).

in case can below.

# create file (on host pc) # $ touch hello.txt  # push device (if below path doesnt exist, create it) # $ adb push hello.txt /data/local/tmp   0 kb/s (14 bytes in 0.043s)  # switch adb shell # $ adb shell  # see permissions before applying chmod # shell@android:/ $ ls -l /data/local/tmp/ -rw-rw-rw- shell    shell          14 2015-07-14 15:35 hello.txt  # change permissions using chmod #  shell@android:/ $ chmod 777 /data/local/tmp/hello.txt  # see permissions after applying chmod # shell@android:/ $ ls -l data/local/tmp/ -rwxrwxrwx shell    shell          14 2015-07-14 15:35 hello.txt 

tested on non-rooted android phone.

android  os : 5.0.2   adb version : android debug bridge version 1.0.31 

refer comments answer.


Comments

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

Rendering JButton to get the JCheckBox behavior in a JTable by using images does not update my table -