如何在Android模拟器上运行设备设置向导?

发布于 2025-01-31 12:15:59 字数 1474 浏览 2 评论 0原文

我想运行设备设置向导 - 首次启动新鲜(出厂设备)设备时正在运行的应用程序。问题是:我想在Android模拟器上运行它。

运行Android 12:启动模拟器的模拟器上的以下操作

  1. 我已经尝试了通过Android Studio向导
  2. adb shell
  3. su
  4. 找出禁用向导的哪些组件:

dumpsys package com.google.android.setupwizard | GREP禁用-A3

这给了我:

      disabledComponents:
        com.google.android.setupwizard.SetupWizardActivity
        com.google.android.setupwizard.deferred.ComponentStateMitigationReceiver
  1. 然后,我启用了具有以下命令的组件:

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

pm pm启用com。 google.android.setupwizard/.deferred.com.ponentStateMitigationReceiver

  1. 然后,我在设置中浏览了各种值,这些值可能会影响以下命令的设置向导运行:

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

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

<代码> content query -uri content -uri content:// settings/system

  1. ,我已经设置了一些值:

设置放置安全user_setup_complete 0

设置put secure user_setup_personalization_state_state 0

设置put global demote_proviseed 0

  1. reboot

然后将设备重新启动到主屏幕,并且没有运行设置向导。

上面的步骤有问题吗?如何在模拟器上运行设置向导?有可能吗?

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文