How to run device setup wizard on Android emulator?
Asked Answered
I

0

6

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?

Incubus answered 21/5, 2022 at 11:53 Comment(1)
@JorgeQueiroz unfortunately, no. In theory, one would need to change android source code and flash the custom ROM for it to work. I'm not being paid enough to do this and I also lack enthusiasm or experience.Incubus

© 2022 - 2024 — McMap. All rights reserved.