1. Home
  2. How to launch SureLock when it is stuck on the Clear defaults screen using SureMDM?

How to launch SureLock when it is stuck on the Clear defaults screen using SureMDM?

KB ID: 42G2104064
Views: 477
Updated: May 2021

Generally, when an end-user tries to launch a third-party launcher application, SureLock loses its default launcher ability and the device comes out of lockdown. The device gets stuck on a Clear defaults page.

To launch SureLock again, the admin needs to go to the System settings of the device and set SureLock as the default launcher manually. However, if this happens on multiple devices and the devices are in the field, the situation gets cumbersome.

In such cases, we can use the below steps to clear defaults and launch SureLock again remotely on the devices.

1. For device enrolled in Device owner mode: 

There are 4 steps involved in achieving this. 

​A. Hide apps on the device using SureMDM.

  • Log into SureMDM, and navigate to Jobs.
  • Select New Job and select the OS as Android.
  • Click Application Policy, enter the Job name, and select the applications you would like to hide. 
  • Click Add and select the Job Type as Hide Apps. Save the Job.
  • Push the job to the device(s)

B. Set Surelock as the default launcher using the below run-script.

  • Log into SureMDM.
  • Create a run script job with the below-mentioned commands on the SureMDM web console. Once the job is created push the job to the device(s)

    Command: 
!#suremdm
setDefaultLauncherSureLock

 C. Launch SureLock using the below run-script.

  • Log into SureMDM.
  • Create a run script job with the below-mentioned commands on the SureMDM web console. Once the job is created push the job to the device(s)

    Command: 
am start -a android.intent.action.MAIN -n com.gears42.surelock/.ClearDefaultsActivity 

D. Un-hide the third-party home launcher application by using the Application settings job.

This is to ensure that the device doesn’t get bricked when SureLock is not in place.

  • Log into SureMDM, and navigate to Jobs.
  • Select New Job and select the OS as Android.
  • Click Application Policy, enter the Job name, and select the applications you would like to hide. 
  • Click Add and select the Job Type as Show Apps. Save the Job.
  • Push the job to the device(s)

2. For Samsung KNOX devices:

There are 4 steps involved in achieving this.

A. Disable all the launcher applications on the device (except SureLock).

  • Log into SureMDM.
  • Create a run script job with the below-mentioned commands on the SureMDM web console. Once the job is created push the job to the device(s)

    Command: 
!#suremdm 
disable(packagename1,packagename2,……..packagenameN)

In the command above, enter the package names of the launcher applications (Except SureLock) instead of packagename1,packagename2,……..packagenameN

B. Set Surelock as a default Homescreen app and launch SureLock on the device. 

  • Log into SureMDM.
  • Create a run script job with the below-mentioned commands on the SureMDM web console. Once the job is created push the job to the device(s)

    Command: 
am start -a android.intent.action.MAIN -n com.gears42.surelock/.ClearDefaultsActivity 

​​​​C. Disable other home screens on the device using SureLock and SureMDM. 

  • Log into SureMDM.
  • Select the device and Click on the SureLock icon.
  • Navigate to the Samsung Knox Settings option and check Disable other home screens option.
  • Based on your requirement either select Save as Job or Apply the settings the device(s)

D. Enable the third-party launcher apps again.

This is to ensure that the device doesn’t get bricked when SureLock is not in place.

  • Log into SureMDM.
  • Create a run script job with the below-mentioned commands on the SureMDM web console. Once the job is created push the job to the device(s)

    Command: 
!#suremdm 
enable(packagename1,packagename2,……..packagenameN)

In the command above, enter the package names of the launcher applications (Except SureLock) instead of packagename1,packagename2,……..packagenameN

3. For EA devices

  • Log into SureMDM.
  • Create a run script job with the below-mentioned commands on the SureMDM web console. Once the job is created push the job to the device(s)

    Command: 
!#suremdm 
disable(packagename1,packagename2,……..packagenameN)

In the command above, enter the package names of the launcher applications (Except SureLock) instead of packagename1,packagename2,……..packagenameN

B. Set Surelock as a default Homescreen app and launch SureLock on the device. 

  • Log into SureMDM.
  • Create a run script job with the below-mentioned commands on the SureMDM web console. Once the job is created push the job to the device(s)

    Command: 
am start -a android.intent.action.MAIN -n com.gears42.surelock/.ClearDefaultsActivity 

C. Make the below-mentioned changes in the SureLock settings job

  • Log into SureMDM.
  • Select the device and Click on SureLock icon. Further click Edit XML option at the bottom of the SureLock Settings screen. 
  • Add the below tags in the XML and place them under HomeScreen Tags.
<DisableAllHomeScreenApps>true</DisableAllHomeScreenApps>    
<AutoDisableNewHomeScreenApps>true</AutoDisableNewHomeScreenApps>                       

D. Enable the third-party launcher apps again.

This is to ensure that the device doesn’t get bricked when SureLock is not in place.

  • Log into SureMDM.
  • Create a run script job with the below-mentioned commands on the SureMDM web console. Once the job is created push the job to the device(s)

    Command: 
!#suremdm 
enable(packagename1,packagename2,……..packagenameN)

In the command above, enter the package names of the launcher applications (Except SureLock) instead of packagename1,packagename2,……..packagenameN

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