Remotely Execute Commands On AstroContacts App Using SureMDM
jun 12, 2019 | 42Gears Team
AstroContacts by 42Gears supports script commands to execute certain actions remotely on AstroContacts application using SureMDM.
Prerequisite
– Android devices should have AstroContacts and SureMDM Nix Agent installed.
– Android devices should be enrolled to 42Gears SureMDM Web Console.
Steps to create Run Script jobs and deploy them on Android devices:
1. On the Job screen, click New Job.
2. On the Select the OS screen, select Android.
3. On the Select Job Type screen, select Run Script.
4. On the Run Script prompt, enter the Job Name, Script and click Save.
5. Select the device(s) and click Apply.
6. Select the created job and click Apply to push the job to Android device(s).
Following script commands can be remotely execute commands on AstroContacts app using SureMDM:
NOTE: These script commands can be executed only on Android devices.
1. Launch AstroContacts app
cam start -n com.gears42.astrocontacts/com.gears42.astrocontacts.MainActivity2. Login to AstroContacts app
am broadcast -a com.gears42.astrocontacts.ACTION -e action login -e email abc@abc.com -e password 000000
3. Login and Sync the contacts in AstroContacts app
am broadcast -a com.gears42.astrocontacts.ACTION -e action loginandsync -e email abc@abc.com -e password 000000
4. Logout from AstroContacts app
am broadcast -a com.gears42.astrocontacts.ACTION -e action logout
For password protected device settings –
am broadcast -a com.gears42.astrocontacts.ACTION -e action logout -e password 0000
5. Sync contacts to phonebook app
am broadcast -a com.gears42.astrocontacts.ACTION -e action sync
NOTE: Syncing of contacts happens only once.
6. Unsync contacts from phonebook app
am broadcast -a com.gears42.astrocontacts.ACTION -e action unsync
For password protected device settings –
am broadcast -a com.gears42.astrocontacts.ACTION -e action unsync -e password 0000
7. Enable Autosync
am broadcast -a com.gears42.astrocontacts.ACTION -e action autosync -e enabled true
For password protected device settings –
am broadcast -a com.gears42.astrocontacts.ACTION -e action autosync -e enabled true -e password 0000
NOTE: Automatically sync the contacts in phonebook app whenever there is contact modification in the AstroContacts Console.
8. Disable AutoSync
am broadcast -a com.gears42.astrocontacts.ACTION -e action autosync -e enabled false
For password protected device settings –
am broadcast -a com.gears42.astrocontacts.ACTION -e action autosync -e enabled false -e password 0000
9. Enable Auto Remove Duplicate contacts on matching all specified fields
am broadcast -a com.gears42.astrocontacts.ACTION -e action autoremoveduplicates -e enabled true -e condition all -e fields emailId,firstName,phoneNumber,lastName,middleName
For password protected device settings –
am broadcast -a com.gears42.astrocontacts.ACTION -e action autoremoveduplicates -e enabled true -e condition all -e fields emailId,firstName,phoneNumber,lastName,middleName -e password 0000
NOTE: Once enabled, duplicate contacts that match all the specified fields will be removed from the phonebook app on contact sync.
10. Enable Auto Remove Duplicate contacts matching one or many specified fields
am broadcast -a com.gears42.astrocontacts.ACTION -e action autoremoveduplicates -e enabled true -e condition any -e fields emailId,firstName,phoneNumber,lastName,middleName
For password protected device settings –
am broadcast -a com.gears42.astrocontacts.ACTION -e action autoremoveduplicates -e enabled true -e condition any -e fields emailId,firstName,phoneNumber,lastName,middleName -e password 0000
NOTE: Once enabled, duplicate contacts that match one or many specified fields will be removed from the phonebook app.
11. Disable Auto Remove Duplicate contacts on phonebook app
am broadcast -a com.gears42.astrocontacts.ACTION -e action autoremoveduplicates -e enabled false
For password protected device settings –
am broadcast -a com.gears42.astrocontacts.ACTION -e action autoremoveduplicates -e enabled false -e password 0000