Tips & Tricks on Android

Friday, February 20, 2009

cp on Android

The Android Dev Phone (and G1, by extension) does not have the cp command in the adb shell prompt. Since you can compile and run C code on the phone, you could in theory also compile the cp program but that's probably a stretch. Alternatively, you can:
cat source_file > dest_file

This works because the phone has a full-featured shell which supports stream redirection.

9 comments:

  1. You can use also dd if=source_file of=dest_file. Redirection support is not needed.

    ReplyDelete
  2. This comment has been removed by the author.

    ReplyDelete
  3. how would you copy recursively a complete directory ?

    ReplyDelete
  4. In a few short years, the Google Android operating system has gained immense foothold in the smartphone market.

    best android apps

    best iphone apps

    ReplyDelete
  5. I have faced problems using cat to copy files. dd seems to be a safer option.

    Thanks for the tip Hector!

    ReplyDelete
  6. Thanks for providing valuable information on the topic. Keep posting. Hong Kong Company Formation

    ReplyDelete
  7. That is very good comment you shared.Thank you so much that for you shared those things with us.Im wishing you to carry on with ur achivments.All the best. chat Mirc indir Sohbet Siteleri

    ReplyDelete