Following are some screenshots serving as a proof:
(Click image to enlarge)
Note that you cannot replicate those images by issuing that shell command, because the test activity you would run would hide all the icons in the left of status bar and even time in my ROM.
Here are the instructions I followed:
Find the disabled components. Do:
adb shell dumpsys PACKAGE
Replace PACKAGE with package name of Setup Wizard app. Often, it would be a setup wizard from Google with package name com.google.android.setupwizard. Package name of CyanogenMod's setup wizard
is com.cyanogenmod.setupwizard. If it has GApps installed, then use package name of Google's setup wizard. If none of the package name works then this resource may help: View app's full package name?
This step inter alia provided me a list of components of that app currently disabled. Here is a relevant excerpt under the heading Packages: from the output of the said command:
com.google.android.setupwizard.SetupWizardActivity is the main and default activity of that app. Although the app has requested the permission android.permission.RECEIVE_BOOT_COMPLETED, strangely, there is no receiver declared in the manifest to receive android.intent.action.BOOT_COMPLETED broadcast. My guess is that the property user_setup_complete alone is used for the purpose of launching that app.
Whatsoever the disabled components shown in your command's output for User 0 are, simply enable all of them for the same user. The simplest way is to use pm command.
Note: It is not clear to me why but when I tried to enable the components using an app (say X), they were disabled automatically once I exited the X app. So I recommend you enable the components using the command-line and refrain from interacting with screen at all costs.
One of the commands must return output containing either the key user_setup_complete or, as Andrew T. noted, setup_wizard_has_run.
Once you have the key, do:
adb shell settings put secure KEY 0 # replace KEY with the key noted above.
Do adb reboot for full reboot or adb shell su -c 'setprop ctl.restart zygote' for soft-reboot or reboot ordinarily as you would and there you would have the Setup Wizard app waiting for interaction after reboot is completed.
Had the same issue with my new Pixel 2 XL. I'd used Nova Launcher to make a widget "activities" for launching system apps previously and sure enough, Pixel Setup was in the list so I added that widget/button and it fired up and offered me to restore from a cloud backup etc.
RECEIVE_BOOT_COMPLETEDpermission and setting the global flag
SETUP_WIZARD_HAS_RUN... though running
adb shell settings put global setup_wizard_has_run 0and rebooting didn't solve this...