Nativescript开发应用程序测试在“之后卡住”;检查emulator是否正在运行;

Nativescript开发应用程序测试在“之后卡住”;检查emulator是否正在运行;,nativescript,appium-android,Nativescript,Appium Android,检查仿真器是否正在运行后,测试被卡住,稍后它会说检查失败 下面是测试消息 $npm运行e2e--runType android28 > philgo-v5@0.0.0 e2e /Users/jaehosong/apps/philgo/philgo-v5 > tsc -p e2e && mocha --opts ./e2e/config/mocha.opts --recursive e2e --appiumCapsLocation ./e2e/config/appium

检查仿真器是否正在运行后,测试被卡住
,稍后它会说
检查失败

下面是测试消息

$npm运行e2e--runType android28

> philgo-v5@0.0.0 e2e /Users/jaehosong/apps/philgo/philgo-v5
> tsc -p e2e && mocha --opts ./e2e/config/mocha.opts --recursive e2e --appiumCapsLocation ./e2e/config/appium.capabilities.json "--runType" "android28"

Parsed args:   {"port":4723,"projectDir":"/Users/jaehosong/apps/philgo/philgo-v5","projectBinary":"/Users/jaehosong/apps/philgo/philgo-v5/node_modules/.bin","pluginRoot":"/Users/jaehosong/apps/philgo/philgo-v5/node_modules/nativescript-dev-appium","pluginBinary":"/Users/jaehosong/apps/philgo/philgo-v5/node_modules/nativescript-dev-appium/node_modules/.bin","wdaLocalPort":8410,"testFolder":"e2e","runType":"android28","appiumCapsLocation":"./e2e/config/appium.capabilities.json","verbose":false,"cleanApp":false,"path":"/Users/jaehosong/apps/philgo/philgo-v5","capabilitiesName":"appium.capabilities.json","driverConfig":{"host":"localhost","port":4723},"logImageTypes":[]}


./e2e/config/appium.capabilities.json
Capabilities found at: ./e2e/config/appium.capabilities.json
Automation name set to: UIAutomator2
To change automation name, you need to set it in appium capabilities!
Available applications:  ["platforms/android/app/build/outputs/apk/debug/app-debug.apk"]
Pick first application:   "platforms/android/app/build/outputs/apk/debug/app-debug.apk"
Application full path: /Users/jaehosong/apps/philgo/philgo-v5/platforms/android/app/build/outputs/apk/debug/app-debug.apk
Executing "/bin/ps aux | grep -ie 'sdk/emulator/qemu' | grep -ie 'Pixel2Api28PieX86' | grep -v grep  | xargs kill -9"
No matching processes to kill!
Starting emulator with options: -avd Pixel2Api28PieX86 -port 5548 ["-no-audio","-no-boot-anim","-wipe-data","-no-snapshot-load","-no-snapshot-save"]
Booting emulator ...
Check if "emulator-5548" is running.
Check has "failed".
这是截图:


之所以发生这种情况,可能是因为您安装了错误版本的仿真器

转到Android Studio(顺便说一句,您可以直接转到SDK文件夹中的AVD管理器):

  • 打开Android虚拟设备管理器
  • 创建虚拟设备
  • 选择一些你想要的硬件
  • 选择目标为“Google API”而非“Google Play”的图像(查看“x86图像”选项卡)
  • 完成虚拟设备的创建
  • 注意:我使用Pie、API 28、x86_64来运行{NS}测试

    仅供参考,这里是appium.capabilities.json的配置:

    "android28": {
        "platformName": "Android",
        "platformVersion": "28",
        "deviceName": "Pixel_2_API_28",
        "avd": "Pixel_2_API_28",
        "lt": 60000,
        "newCommandTimeout": 720,
        "noReset": false,
        "fullReset": false,
        "app": ""
    }