Appium:如何从Android For Work工作资料中启动应用程序

Vin*_*nod 8 automation android ui-automation appium

我需要启动一个具有不同工作档案的应用程序(Android For Work).如果在个人资料中安装应用程序,那么我可以从同一设备上的个人资料中启动应用程序.

但是,当我仅在工作资料中安装应用程序时,我无法通过adb命令启动应用程序.

据我了解,谷歌为个人和工作档案保留了两个不同的容器.我认为工作资料具有不同的空间,而adb无法访问该应用和工作资料工作区.

我需要通过appium启动应用程序

如果有人对上述问题有答案,请回答.提前致谢 !

小智 3

您的意思是在不同的用户帐户上启动应用程序吗?请检查此链接: https: //stackoverflow.com/a/24093533/5093606 您可以尝试使用以下方式获取帐户列表

adb shell pm list users
Run Code Online (Sandbox Code Playgroud)

如果您有工作帐户,请尝试

adb shell am start --user WORKING_ACCOUNT com.example.MainActivity
Run Code Online (Sandbox Code Playgroud)