4

I want to run device setup wizard - the app that's getting run when you first boot your fresh (factory reset) device. The problem is: I want to run it on Android Emulator.

I've tried the following on Emulator running Android 12:

  1. Boot emulator via Android Studio wizard.
  2. adb shell
  3. su
  4. Figure out what components of the wizard are disabled:

dumpsys package com.google.android.setupwizard | grep disabled -A3

this gave me:

      disabledComponents:
        com.google.android.setupwizard.SetupWizardActivity
        com.google.android.setupwizard.deferred.ComponentStateMitigationReceiver
  1. Then I've enabled the components with the following commands:

pm enable com.google.android.setupwizard/.SetupWizardActivity

pm enable com.google.android.setupwizard/.deferred.ComponentStateMitigationReceiver

  1. Then I've poked around in settings to see various values that might influence the setup wizard run with the following commands:

content query --uri content://settings/secure

content query --uri content://settings/global

content query --uri content://settings/system

  1. Then I've set some values:

settings put secure user_setup_complete 0

settings put secure user_setup_personalization_state 0

settings put global device_provisioned 0

  1. reboot.

And the device rebooted to home screen and no setup wizard was run.

Is there something wrong in the steps above? How do I run a setup wizard on emulator? Is it even possible?

Sevastyan Savanyuk
  • 5,797
  • 4
  • 22
  • 34

0 Answers0