appium启动
appium
PS C:\Windows\system32> appium
[Appium] Welcome to Appium v2.12.1
[Appium] The autodetected Appium home path: C:\Users\liyd\.appium
[HTTP] Could not start REST http interface listener. The requested port may already be in use. Please make sure there is no other instance of this server running already.
[Appium] Could not configure Appium server. It's possible that a driver or plugin tried to update the server and failed. Original error: listen EADDRINUSE: address already in use 0.0.0.0:4723
[Appium] Error: listen EADDRINUSE: address already in use 0.0.0.0:4723
at Server.setupListenHandle [as _listen2] (node:net:1751:16)
at listenInCluster (node:net:1799:12)
at doListen (node:net:1948:7)
at processTicksAndRejections (node:internal/process/task_queues:83:21)
PS C:\Windows\system32>
此时,见端口已经被占用,需要指定appium启动端口号
appium --port 4724
启动成功
PS C:\Windows\system32> appium --port 4724
[Appium] Welcome to Appium v2.12.1
[Appium] Non-default server args:
[Appium] {
port: 4724
}
[Appium] The autodetected Appium home path: C:\Users\liyd\.appium
[Appium] Attempting to load driver uiautomator2...
[Appium] Requiring driver at C:\Users\liyd\.appium\node_modules\appium-uiautomator2-driver\build\index.js
[Appium] AndroidUiautomator2Driver has been successfully loaded in 0.626s
[Appium] Appium REST http interface listener started on http://0.0.0.0:4724
[Appium] You can provide the following URLs in your client code to connect to this server:
http://192.168.17.76:4724/
http://192.168.42.60:4724/
http://127.0.0.1:4724/ (only accessible from the same host)
http://172.28.224.1:4724/
[Appium] Available drivers:
[Appium] - uiautomator2@3.8.1 (automationName 'UiAutomator2')
[Appium] No plugins have been installed. Use the "appium plugin" command to install the one(s) you want to use.
appium安装driver到电脑
appium driver install uiautomator2
PS C:\Windows\system32> appium driver install uiautomator2
√ Checking if 'appium-uiautomator2-driver' is compatible
√ Installing 'uiautomator2' using NPM install spec 'appium-uiautomator2-driver'
i Driver uiautomator2@3.8.1 successfully installed
- automationName: UiAutomator2
- platformNames: ["Android"]
appium将驱动安装到手机
appium setup
PS C:\Windows\system32> appium setup
info Appium uiautomator2 (3.8.1) is already installed. Skipping the installation.
√ Checking if 'appium-espresso-driver' is compatible
√ Installing 'espresso' using NPM install spec 'appium-espresso-driver'
i Driver espresso@3.5.0 successfully installed
- automationName: Espresso
- platformNames: ["Android"]
√ Checking if '@appium/images-plugin' is compatible
√ Installing 'images' using NPM install spec '@appium/images-plugin'
i Plugin images@3.0.21 successfully installed
检查配置是否正确
appium driver doctor uiautomator2
PS C:\Users\liyd> appium driver doctor uiautomator2
Running 7 doctor checks for the "uiautomator2" driver
info Doctor ### Starting doctor diagnostics ###
info Doctor ✔ ANDROID_HOME is set to: E:\sdk
info Doctor Checking adb, emulator, apkanalyzer.bat
info Doctor 'adb' exists in E:\sdk\platform-tools\adb.exe
info Doctor 'emulator' exists in E:\sdk\emulator\emulator.exe
info Doctor 'apkanalyzer.bat' exists in E:\sdk\cmdline-tools\latest\bin\apkanalyzer.bat
info Doctor ✔ adb, emulator, apkanalyzer.bat exist in 'E:\sdk'
info Doctor ✔ JAVA_HOME is set to: C:\Users\liyd\.jdks\corretto-11.0.21
info Doctor ✔ 'bin\java.exe' exists under 'C:\Users\liyd\.jdks\corretto-11.0.21'
WARN Doctor ✖ bundletool.jar cannot be found
WARN Doctor ✖ ffmpeg.exe cannot be found
WARN Doctor ✖ gst-launch-1.0.exe and/or gst-inspect-1.0.exe cannot be found
info Doctor ### Diagnostic completed, 0 required fixes needed, 3 optional fixes possible. ###
info Doctor
info Doctor ### Optional Manual Fixes ###
info Doctor To fix these optional issues, please do the following manually:
WARN Doctor ➜ bundletool.jar is used to handle Android App bundles. Please download the binary from https://github.com/google/bundletool/releases/ and store it to any folder listed in the PATH environment variable. Folders that are currently present in PATH: C:\Users\liyd\.jdks\corretto-11.0.21\bin;C:\Users\liyd\.jdks\corretto-11.0.21\jre\bin;C:\Python312\Scripts\;C:\Python312\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Git\bin;C:\Program Files\Git;C:\ProgramData\chocolatey\bin;C:\Program Files (x86)\dotnet\;C:\Users\liyd\Desktop\1\dex2jar-2.0\dex2jar-2.0C:\Program Files\nodejs;E:\apktool;E:\software\ant\apache-ant-1.9.16\bin;E:\work\tkbackground\jjchannelpackage\ToolConfigPath\tools\gradle\gradle-6.1.1\jre\bin;E:\software\ant\apache-ant-1.9.16\lib;C:\Windows\System32\OpenSSH\;E:\work\tkbackground\jjchannelpackage\ToolConfigPath\tools\gradle\gradle-6.1.1\bin;C:\Users\liyd\.gradle;E:\sdk\bin;C:\Program Files\MySQL\MySQL Server 8.0\bin;E:\sdk\platform-tools;C:\Program Files\WinRAR;E:\sdk\build-tools\30.0.0;E:\software\dex2jar-2.0;C:\Program Files\apache-maven-3.8.8-bin\apache-maven-3.8.8\bin;C:\Program Files\Git\cmd;C:\Program Files\Huawei\DevEco Studio\sdk\default\openharmony\toolchains;C:\Users\liyd\AppData\Roaming\nvm;C:\Program Files\nodejs;C:\Users\liyd\AppData\Local\Programs\Python\Python38\Scripts\;C:\Users\liyd\AppData\Local\Programs\Python\Python38\;C:\Users\liyd\AppData\Local\Microsoft\WindowsApps;C:\Program Files\JetBrains\WebStorm 2023.2.5\bin;;C:\Program Files\JetBrains\PyCharm 2023.2.5\bin;;C:\Users\liyd\AppData\Roaming\npm;C:\Program Files\Huawei\DevEco Studio\bin;;C:\Users\liyd\AppData\Roaming\nvm;C:\Program Files\nodejs
WARN Doctor ➜ ffmpeg.exe is used to capture screen recordings from the device under test. Please read https://www.ffmpeg.org/download.html.
WARN Doctor ➜ gst-launch-1.0.exe and gst-inspect-1.0.exe are used to stream the screen of the device under test. Please read https://gstreamer.freedesktop.org/documentation/installing/index.html?gi-language=c.
info Doctor
info Doctor Bye! All issues have been fixed!
info Doctor