2

I have written a script which copies all files of a particular type to a certain folder. I also wish to run this script on my connected mobile (which runs android), but I am struggling to get hold of files on my connected phone:

scr.copyfiles(r'This PC\Galaxy S7\Phone\Download\photo.jpg',dest_folder)

This returns a filenotfound error. How do I access files located on my phone?

  • "This PC" is not a real location, it's how Windows shows the list of drives and devices. I'm not sure what path devices get and cannot check right now, but when you have a connected device and go into its filesystem, click the address bar to show the path. – h4z3 Jan 20 '20 at 12:33
  • this is the path that is showing on both the address bar and the file itself – smithsomizm Jan 20 '20 at 12:38
  • You have to use [`adb shell`](https://developer.android.com/studio/command-line/adb#shellcommands) for this. – art Jan 20 '20 at 16:06

1 Answers1

-2

you can write in this way

phone_dir = os.path.join('Computer', 'Galaxy S7', 'Phone', 'Download')
Caio Filus
  • 705
  • 3
  • 17
  • sorry this doesn't really help! – smithsomizm Jan 20 '20 at 13:03
  • take a look in this answer [link](https://stackoverflow.com/questions/17422858/getting-my-phone-directory-in-python) – Caio Filus Jan 20 '20 at 13:08
  • Welcome to Stackoverflow! This doesn't really answer the question, it only concatenates directories together into a path. Also, it has syntax errors. Please consider expanding your explanation to explain **how** this helps access files on a connected phone, and *specifically* addresses the OP's issue. – Kevin Jan 20 '20 at 13:36