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:
- Boot emulator via Android Studio wizard.
adb shell
su
- 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
- 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
- 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
- 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
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?