Script for device check-in?

Script for device check-in?

Is there a way to send a script down to an Android device to force it to check-in?  I tried "connect -f" but I can't really tell if it's doing anything, nothing logs as a device check-in.

I would like to send a device check-in script as part of a post installation script in a package after a new software version is installed.  This would allow to us to quickly see if the app version incremented successfully as well as some other items.

 


Thanks

  • 26 January 2021
  • SOTI MobiControl
  • 7 Answers
  • 0 Upvote
  • 2 Followers
  • 587 Views
    • 7 Answers
    • 0 Upvote
    • 2 Followers

7 Answers

Order By:   Standard | Newest | Votes
Raymond Chan | posted this 27 January 2021

There is no Android script in MobiControl that directly force a device check-in and do nothing else except leaving a check-in log entry on your device log tab.  However, you should be able to  indirectly force a device check-in, say for example, with a FULL connection event.  You are almost there.  Just try the following

    disconnect
    sleep 10
    connect -f

This works on my device tested a moment ago.  However, your mileage may vary with different device-agent versions or with the power management mode/status on individual device.

  • 0
  • 0
JCMOD@SOTI | posted this 27 January 2021

Hi Chris,

 

Thank you for posting in SOTI Central.

 

We do have a Legacy Script Command called "checkin" which should serve your purpose. However, it doesn't output "Device (Agent) checked-in" as you would normally expect. In terms of the issue itself, the app version should increment once the package is classed as installed, if you're seeing different behavior I suggest double-checking your search integrity within Global Settings -> MobiControl Search Sync Interval.

 

Also to note in v15 we introduced support for Javascript Scripting, one of the methods is to perform an agent check in. Perhaps it'll be worth checking that out to see if can be of use.

 

Source: https://www.soti.net/mc/help/javascriptapi/en/mobicontrol.agent.html#.checkIn

 

Feel free to reach out if you have any questions or need clarification. Also please mark the relevant post as the solution if the issue is resolved.

 

Regards,

Technical Support | SOTI Inc. |1.905.624.9828 | support@soti.net | www.soti.net |

  • 0
  • 0
Raymond Chan | posted this 27 January 2021

Hi Chris,

 

Regarding accuracies of status and version of apps, there has been problem/discrepancy related to the newly added search module since version v14.0.    Depending on your MobiControl server version, there may still be discrepancy even if you have forced a search cache sync in  Global Settings -> MobiControl Search Sync Interval.  You might need to fuse status information of profile that deploy apps to cross check your results.

 

  • 0
  • 0
Chris R. | posted this 27 January 2021

Thanks for the responses.  I'm actually on 13.4 and we see application versions update properly sometimes and other times it will not update.  We are in the process to migrating to 15.2 and were hoping that part was resolved.  I don't believe the search interval settings are available in 13.4.

 

I sent the checkin script to a device to check but got the "Script command is not supported by device (checkin)" error.  Is this only supported on 14+?

  • 0
  • 0
Raymond Chan | posted this 27 January 2021

You are right.  MobiControl Search module has only been introduced since v14.0.  Thus,  search interval settings are not available in 13.4.

 

The new javascript engine is also supported for v14.x device agents.  So, you don't need to upgrade straight to v15.x just for the sake of using javascript.

 

As mentioned in my previous post about some discrepancy related reported app version in v14+, whatever approach you use to initiate a device check-in doesn't seem to be too important.   checkin is an undocumented script command available on v14.   The script I mentioned earlier, namely

 

    disconnect
    sleep 10
    connect -f

 should work in all MobiControl versions including v13.x.  Please let me know if you find any problem with it.

 

 

 

  • 0
  • 0
Chris R. | posted this 27 January 2021

I sent the script below and it does handle the check-in when in connects back, that should get me by for now.  Thanks!

disconnect
sleep 10
connect -f

  • 0
  • 0
Raymond Chan | posted this 28 January 2021

It's good to know that.

 

BTW, just in case you don't know, I would like to add that you have the option to use v14.x device agents to work with your v13.x server to use some new features or fix the problem of old agent.  Many years ago, the major versions of the server and agent  should almost always match.  It seems to be more flexible.

 

Having said that, please be warned that you should do THOROGH tests for EACH device model to confirm connections, remote-upgradability, stability and functioning of all policies that you used before you go ahead with mass-scale agent upgrade on all production devices of that tested model.  If you miss something critical in your tests, you might risk losing control of the device in the worst case, and you might have to recall the device and even to factory-reset and re-enroll it depending on the device mode and problem scope.   On top of your positive test results obtained, getting a go-ahead/no-objection reply from Soti support team before starting your agent upgrade on production devices is always a good practice.

 

  • 0
  • 0

Give us your feedback
Give us your feedback
Feedback