Can't run the test from the documentation

I followed all the documentation to set up appium, JDK and Android Studio.
I’m using Windows 10.

I’m using VSCode to write my tests:

const {remote} = require('webdriverio');
const capabilities = {
    platformName: 'Android',
    'appium:automationName': 'UiAutomator2',
    'appium:deviceName': 'Android',
    'appium:appPackage': '',
    'appium:appActivity': '.Settings',
const wdOpts = {
    hostname: process.env.APPIUM_HOST || 'localhost',
    port: parseInt(process.env.APPIUM_PORT, 10) || 4723,
    logLevel: 'info',
async function runTest() {
    const driver = await remote(wdOpts);
    try {
      const batteryItem = await driver.$('//*[@text="Battery"]');
    } finally {
      await driver.pause(1000);
      await driver.deleteSession();

I execute the command appium in the cmd to start the server (running as admin).
The messages keep appearing repeatedly.

Then, I execute node test.js in another cmd window from within the folder, and it just shows the test sourcecode. When I stop the server, I get this error:

Can someone help me solve this?

Seems like your adb is not responsive. Have you tried restarting your machine?