1. Home
  2. Knowledge Base
  3. Remotely Execute Commands On AstroContacts App Using SureMDM

Remotely Execute Commands On AstroContacts App Using SureMDM

AstroContacts by 42Gears supports script commands to execute certain actions remotely on the AstroContacts application using SureMDM.

Prerequisite

– Android devices should have AstroContacts and SureMDM 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 remotely execute commands on AstroContacts app using SureMDM:

NOTE: These script commands can be executed only on Android devices.

1. Launch AstroContacts app

am start -n com.gears42.astrocontacts/com.gears42.astrocontacts.MainActivity

2. 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 the AstroContacts app

am broadcast -a com.gears42.astrocontacts.ACTION -e action loginandsync -e email abc@abc.com -e password 000000

4. Logout from the AstroContacts app

am broadcast -a com.gears42.astrocontacts.ACTION -e action logout

4a. 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 the phonebook app

am broadcast -a com.gears42.astrocontacts.ACTION -e action unsync

6a. 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

8a. For password-protected device settings –

am broadcast -a com.gears42.astrocontacts.ACTION -e action autosync -e enabled false -e password 0000

NOTE: Once enabled, duplicate contacts that match all the specified fields will be removed from the phonebook app on contact sync.

9. 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

9a. 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.

10. 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

For more details on our products, click here 
If you need further assistance, please submit a ticket here

Was this helpful?
YesNo
Updated on August 2021