本文介绍了命令行中的Android仿真器具有奇怪的分辨率的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在通过以下命令从终端创建一个用于Espresso测试的Android模拟器:

I'm creating an Android emulator for Espresso testing from a terminal via this command:

./avdmanager create avd -n TestEmulator1 -k "system-images;android-25;google_apis;x86_64" -c 2000M --tag "google_apis" --device "Nexus 5X"

但是,当我运行仿真器时,分辨率确实关闭了

However when I run the emulator, the resolution is really off

当我从Android Studio的AVD Manager中检查它时,似乎设置正确.我的命令中是否缺少导致此问题的内容?它导致我的所有测试在运行时均失败.谢谢!

When I check it in the AVD Manager from Android Studio, it looks like the settings are correct. Is there something missing from my command that's causing this issue? It causes all of my tests to fail when run. Thanks!

推荐答案

添加您需要的皮肤分辨率,如下所示:

Add the skin resolution you need like this:

./avdmanager create avd -n TestEmulator1 -k "system-images;android-25;google_apis;x86_64" -c 2000M --tag "google_apis" --device "Nexus 5X"

./emulator -avd TestEmulator1 -no-window -skin 768x1280 &

或者尝试是否像这样的东西(-s "768x1280")仍然适用于新的avdmanager:

Or try if something like this (-s "768x1280") still works with the new avdmanager:

android create avd --force -n nexus4-emulator -t "Google Inc.:Google APIs:"$EMULATOR_VERSION --abi $ANDROID_ABI -s "768x1280" --device "Nexus 4" -c 128M

有关尺寸合适的仿真器的更多信息,请参见此处.

Further information about emulators with a decent size here.

这篇关于命令行中的Android仿真器具有奇怪的分辨率的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-03 16:41