You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Appium Desktop 1.5.0报错无法连接服务器,请求排查解决

Troubleshooting "Cannot Connect to Server" Error in Appium Desktop 1.5.0

Hey there, let’s walk through practical fixes for this connection error based on your setup. First, let’s recap your environment to make sure we’re aligned:

  • MacBook Air running macOS 10.13.4
  • Appium Desktop 1.5.0
  • Android Studio 3.1.2 with Nexus 5 emulator (Android 8.0/Oreo)
  • Your configured desired capabilities:
{ 
  "platformName": "Android", 
  "platformVersion": "8.0", 
  "deviceName": "jacquelineNexus5", 
  "automationName": "Appium", 
  "app": "/Users/jacquelinegeorge/Documents/Appium/Apps/ApiDemos-debug.apk" 
}

1. Double-Check Appium Server is Running

First off—confirm the Appium Desktop server is actually up. When you launch Appium Desktop, you should see a green "Server is running" banner at the top, along with the default host/port (0.0.0.0:4723). If you don’t see this, click the play icon to start the server, and wait for the initialization logs to finish before running your test.

2. Check for Port Conflicts

Another process might be using Appium’s default port (4723). Verify this on your MacBook:

  • Open Terminal and run:
    lsof -i :4723
    
  • If results pop up, a different app is using the port. You can either kill that process with kill -9 <PID> (replace <PID> with the number from the output) or change Appium’s port: go to Preferences > Server in Appium Desktop, set a new port like 4724, restart the server, and update your test to use this new port.

3. Ensure Your Emulator is Properly Connected

Even if the emulator is open, it might not be recognized by adb. Let’s check:

  • Run this in Terminal:
    adb devices
    
  • You should see jacquelineNexus5 listed with a device status. If it shows offline or is missing:
    • Fully close and restart the emulator from Android Studio
    • Reset the adb server with:
      adb kill-server && adb start-server
      

4. Tweak Your Desired Capabilities

Your config looks solid, but a small adjustment might help:

  • Confirm the app path is correct: navigate to that folder in Finder to make sure ApiDemos-debug.apk exists there.
  • For Android 8.0, try switching automationName to UiAutomator2 (Appium relies on this for newer Android versions, which can fix connection issues):
    { 
      "platformName": "Android", 
      "platformVersion": "8.0", 
      "deviceName": "jacquelineNexus5", 
      "automationName": "UiAutomator2", 
      "app": "/Users/jacquelinegeorge/Documents/Appium/Apps/ApiDemos-debug.apk" 
    }
    

5. Do a Full Restart

Sometimes quirky glitches vanish with a fresh start:

  • Quit Appium Desktop, Android Studio, and the emulator completely
  • Restart your MacBook, then launch tools in this order: Android Studio first, start the emulator and wait for it to fully load, then launch Appium Desktop and start the server before running your test.

If none of this works, check the Appium server logs (the big log window in Appium Desktop)—they usually have specific error details (like adb connection failures or app installation issues) that can point you to the root cause.

内容的提问来源于stack exchange,提问作者fypnlp

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.26 08:49:15