Reputation: 1580
I'm trying to write text to a file with adb and stumble on some problems.
If I do it in two steps, like this:
adb shell
echo "hello" > /sdcard/temp/hello.txt
it works. But if I try to do it on one row like this:
adb shell echo "hello" > /sdcard/temp/hello.txt
I get "No such file or directory". Must I change the path in some way? I'm going to call on this from another script I have must have it on one row.
Upvotes: 2
Views: 10887
Reputation: 16414
You need to quote the entire script you'd like executed:
adb shell "echo \"hello\" > /sdcard/temp/hello.txt"
Upvotes: 5