Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

copy file from windows to android using batch

I want create batch process to update files on android tablet (for non-experienced user) via USB port. These devices eg. Motorola Xoom is recognized as "Portable device" and don't have a letter to identify itself. On explorer there is path eg "\Xoom\Internal Storage\".

Problem is that i don't know how to get suffix of tablet path.

copy file.ext ???/directory/file.ext

I tried to use adb push (which works, using getExternalStorage() as path of device path "/mnt/sdcard") however there is required to enable debug mode, therefore this is not optimal solution. I dont want to force user to enable this mode, run batch process and then disable debug mode.

Thanks


Just another few notes:

  • key words to describe problem reduced to "get path to portable device"
  • android version on devices is 3.0.x - (api level 11) not enough to use android.hardware.usb package
like image 394
user1314802 Avatar asked Oct 29 '25 14:10

user1314802


1 Answers

you can use MOUNTVOL command to mount the USB drive, identified by its GUID, on a specific mount point, independently of the available drive letters.

 MOUNTVOL C:\XOOM \\?\Volume{a000351d-dbaa-11e0-bdaa-020255061358}\

and then

 copy file.ext c:\XOOM\directory\file.ext
like image 198
PA. Avatar answered Oct 31 '25 05:10

PA.