运行在外网服务器上的appium如何访问连接到本机上的手机?

fabbymee 2021-05-17 10:59:14
因为服务器用的是阿里云,运行了appium。
我手机又没法USB到服务器。
手机就只是接到我自己的电脑上。这样手机和这个服务器怎么建立连接?
...全文
287 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
fabbymee 2021-05-27
  • 打赏
  • 举报
回复
https://stackoverflow.com/questions/67563538/how-can-appium-which-is-run-on-wan-servercloud-server-connect-to-phone-devices/67713119#67713119 Architecture: Credit Github: https://github.com/appium/appium/issues/10503 Here we are running scripts from a remote/local Appium server while the devices are connected to another system in the network. Setup: Start adb server in the system in which devices are connected: Just run the below command in cmd (given adb is available in path)
adb kill-server
adb -a -P 5037 server nodaemon
Appium capabilities: Now to run appium tests we need to add the below capability: Try appium inspector from the remote system with below capability (edit all other fields according to your setup except remoteAdbHost,systemport and adbPort) here remoteadbhost is the remote system which has connected devices change 192.168.0.7 to correct addres, system port is the uiautomator2 server port which is 8021 by default and finally adbport This will allow you to inspect the remote devices from your local system
{
 “platformName”: “Android”,
 “appium:platformVersion”: “11”,
 “appium:deviceName”: “sr”,
 “appium:app”: “C:\\Users\\Downloads\\ApiDemos-debug.apk”,
 “appium:automationName”: “UiAutomator2”,
 "remoteAdbHost":"192:168.0.7",
 "systemPort":8021,
 "adbPort":5037
}
Note: when using webdriverio 7 add appium: infront of all the capabilities as its the new syntax for w3c.

80,360

社区成员

发帖
与我相关
我的任务
社区描述
移动平台 Android
androidandroid-studioandroidx 技术论坛(原bbs)
社区管理员
  • Android
  • yechaoa
  • 失落夏天
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧