Copy file to devices by package. Need help or advice

Solved
N
Nikolay
CJSC British American Tobaco-SPb

Hello!

I am trying to place configuration XML to persistent storage of our devices.

Created a package, assigned it to profile.

Package contains XML file and pre install script

copy "\DataCollectionService.xml" "\Storage\IPSM\honeywell\persist\"

I can not understand what need i use as a source path. Can anyone help with this issue?

6 years ago
Android
ANSWERS
RC
Raymond Chan Diamond Contributor
6 years ago (edited 6 years ago)

What was the destination directory of your .xml file when you configured/created the .pcg file in package studio?  The default in package studio is usually %sdcard%\.   Any destination folder can be specified as long as MobiControl device agent has the permission to write to that folder.  Hence, the simple choice is public folder such as %sdcard%\Download\.  

Once the .xml file has been transferred to the specified destination folder,  it should be the post-install script that will be executed to copy/move the file to \Storage\IPSM\honeywell\persist\.   not pre-install script as you said in your post.  You also have to make sure the directory   \Storage\IPSM\honeywell\persist\ is writable by the device agent and the path is correct (e.g. path delimiter is \ rather than / on your device, etc.)

Solution
N
Nikolay
6 years ago

Hello Raymond.

I can not find where i can change dest point, so just find copied file in explorer - you are right - it was strored in sdcard folder.

Thanks - postinstall script worked well.

But my main problem was in using "\" 

this version works for me:

copy "%sdcard%/DataCollectionService.xml" "/storage/IPSM/honeywell/persist/"

MD
Matt Dermody Diamond Contributor
6 years ago

Is the DataCollectionService.xml file already present on the device or are you placing it there with your Package? If you are placing it in sdcard yourself then the copy post-install script is arguably unnecessary as you could have just placed the file directly in the destination path.