1. Home
  2. Knowledge Base
  3. SureLock
  4. 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

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 the Clear defaults page.

To launch SureLock again, the admin needs to go to the System settings of the device and manually set SureLock as the default launcher. 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.

Purpose

The purpose of this knowledge article is to provide a guide on how to launch SureLock when it is stuck on the Clear defaults screen using SureMDM.

Prerequisites

NA

Steps

Step 1: For devices enrolled in Device owner mode:

There are four steps involved in achieving this.

A. Hide apps on the device using SureMDM.

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

B. Set Surelock as the default launcher using the below Run Script.

  1. Log into the SureMDM console.
  2. 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.

  1. Log into the SureMDM console.
  2. 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. Unhide 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.

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

Step 2: For Samsung KNOX devices

There are four steps involved in achieving this.

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

  • Log into the SureMDM Console.
  • 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 the default Home Screen app and launch SureLock on the device.

  1. Log into the SureMDM console.
  2. 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 the SureMDM Console.
  • Select the device and click on the SureLock icon.
  • Navigate to the Samsung Knox Settings option and check the Disable other home screens option.
  • Based on your requirements, either select Save as Job or Apply the settings to 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.

  1. Log into the SureMDM Console.
  2. 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.

Step 3: For EA devices

  1. Log into the SureMDM Console.
  2. 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 the default Home Screen app and launch SureLock on the device.

  1. ​Log into the SureMDM Console.
  2. 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.

  1. Log into the SureMDM Console.
  2. Select the device and click on the SureLock icon. Further, click the Edit XML option at the bottom of the SureLock Settings screen.
  3. Add the below tags to 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.

  1. Log into the SureMDM Console.
  2. 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.

Need more help?

CONTACT US 

Was this helpful?
YesNo
Updated on August 2023