android - 在同时运行的多个模拟器上运行相同的 ADB Shell 脚本
问题描述
在使用多个工作人员运行自动化 UI 测试时,我想执行以下脚本:
beforeAll(async () => {
if (device.getPlatform() === 'android') {
console.log('*** disable android system popups ***')
execSync(
'adb shell settings put secure immersive_mode_confirmations confirmed'
)
}
await device.launchApp()
})
这将不起作用,因为 shell 不知道要定位哪个模拟器。
Command failed: adb shell settings put secure immersive_mode_confirmations confirmed
adb: more than one device/emulator
有没有办法使用相同的命令一次简单地定位所有模拟器实例?或者我可以以某种方式adb devices
使用 JS 访问列表并将命令映射到每个实例吗?
解决方案
推荐阅读
- spring-boot - Spring + LDAP 身份验证 + Google 登录
- python - 给定月份的列及其对应的值,如何找到每年的最大值?
- django - DRF:如何为权限组返回名称而不是 id?
- c# - VB.NET LINQ Group By Into Select New 无法访问类成员 BC30456
- python - 如何在 python 单元测试中修补或模拟后续 API 调用?
- docker - 运行 docker-compose restart 是否重新运行初始化脚本
- javascript - 如何通过单击菜单外部来关闭移动菜单
- sql - 给定父母时获得孩子的观点
- ruby-on-rails - 为什么上次登录 IP 和当前登录 IP Rails Devise 不正确?
- c# - DbfDataReader - 文件路径异常