bash - 如何从命令行启动 Xamarin-Android-Player?

标签 bash android-emulator xamarin

是否有可能从 Mac 上的命令行运行 Xamarin Android Player 设备?

我正在编写自动化 UI 测试,并希望使用 bash 脚本启动它们。对于 Android,我必须先启动模拟器,由于标准 Android 模拟器慢得令人无法接受,我需要使用 XAP。

基本上我正在搜索类似于“正常”命令的命令:

./emulator -avd NameOfYourEmulator -partition-size 512

Xamarin 安卓播放器。 上面的命令不起作用,因为 XAP 设备不像常规 AVD 那样保存,而是保存为 .vdi 文件。

最佳答案

我通过浏览我 Mac 上打开的进程找到了这个命令(命令行中的 ps -f -x)。这很简单:

/path/to/xap/executable --name "Device Name"

对我来说,这是:

/Applications/Xamarin\ Android\ Player.app/Contents/Helpers/Xamarin\ Android\ Player.app/Contents/MacOS/Xamarin\ Android\ Player --name "Nexus 5 (KitKat)"

(转义空格需要反斜杠)

现在出现的问题是设备被锁定,但那是另一回事。

编辑:

如果有人对如何从命令行解锁手机感兴趣,其:

adb shell input keyevent 82

关于bash - 如何从命令行启动 Xamarin-Android-Player?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27523348/

相关文章:

bash - 通过 rsync 发送文件时,inotify 识别出错误的文件名

bash - 如何使用 getopts 忽略无效参数并继续解析?

c# - 使用 .NET 标准库的 Xamarin.Android 上的 JsonSerializationException 'Unable to find a constructor'

c# - 将 Xamarin 连接到 Python MySQL 连接器

linux - 检查是否在 linux bash 脚本中按下了 Enter 键

bash 健壮性 : what is a correct and portable way to trap for the purpose of an "on exit" cleanup routine?

Android 模拟器以不同的分辨率启动

java - Android 在 Eclipse 中跟踪错误?

Android:Google Play 服务无法在模拟器上运行

android - Xamarin 形成 RelativeLayout 使用