Android Plus Device name to text file

Android Plus Device name to text file

Is there anyway to get the Android Plus device name and write it to a file and call it and place it in a specific folder? Using MobiControl v13.4


For some background info. We use an inhouse app that uses 2 files for configuration. To preconfig the app if I upload both files before hand and then install it works fine (either upload manually or via a profile, profile is our preferred method). The problem is one of these files is supposed to match the Mobi name. This is not something I know how to preconfigure when uploading to 400 devices.


Can anyone suggest a way to write the device name to a text file prior to installing the apk? Ideally doing it through a profile/package would be preferred as that way it can be deployed as a required package by our profile.

2 Answers

Order By:   Standard | Newest | Votes
Chris | posted this 07 October 2020

We have done this with a file sync rule. We copy an empty "devicename.txt" file to a folder like /sdcard/soti/.


We use a before file sync script:

mkdir /sdcard/SOTI
del /sdcard/SOTI/*.txt


and a after filesync script:

copy /sdcard/SOTI/Devicename.txt /sdcard/SOTI/%MCDEVICENAME%.txt
del /sdcard/SOTI/Devicename.txt


This filecopy rule is scheduled for every Monday 9:00 clock.

  • 1
  • 0
Matt Dermody | posted this 02 October 2020

I think it would honestly be easier to architect in reverse. You could have the app save a unique custom device name to an ini file and then use the Custom Data configuration in Mobicontrol to extract the value from the device so that it is viewable and reportable in your console. This Custom Data value wouldn't replace the actual MobiControl Device Name but you could call it anything you want, like CustomDeviceName.

  • 0
  • 0

Give us your feedback
Give us your feedback