android - 如何从命令行将安卓模拟器调到最前面

标签 android bash android-emulator

我找到了一个从命令行启动模拟器的命令:

$ android-sdk-path/emulator/emulator -avd Nexus_5X_API_26 -netdelay none -netspeed full

但我需要从命令行检查模拟器是否已经在运行,然后将它带到屏幕前面。这可以从命令行实现吗?

最佳答案

找到了我的问题的答案:

创建一个osscript文件showEmulator.scpt

tell application "System Events"
  tell application process "Dock"
    tell list 1
      tell UI element "emulator"
        perform action "AXPress"
      end tell
    end tell
  end tell
end tell

然后以这种方式从终端执行 osascript ~/scripts/showEmulator.scpt

关于android - 如何从命令行将安卓模拟器调到最前面,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48041505/

相关文章:

android - Google App Engine 自定义 SSL 和 Android SNI + VIP?

mysql - 创建 bash 脚本以自动创建数据库和用户

android - 不幸的是 appName has stopped 错误

android - onCreate 中的方法仅在设备旋转后运行

android - 如何在单个 TextView 中显示数组列表中的多行?

android - 失败 : Build failed with an exception. React Native

linux - Biolinux 中的自动完成行为

python - 查找给定文件名的日期错误的文件

Android 编辑文本和按钮小部件在平板电脑中显得模糊

android - 常见的 AVD 配置是否已经存在可以下载/查看的地方?