在按照指引安装好环境后,执行test.py
提示报错信息如下:
` File "D:\test.py", line 5, in
d.screenshot('screen.png') # 截图
File "C:\Python27\lib\site-packages\atx\drivers\mixin.py", line 62, in _inner
_retval = fn(*args, **kwargs)
File "C:\Python27\lib\site-packages\atx\drivers\mixin.py", line 387, in screenshot
screen = self._take_screenshot()
File "C:\Python27\lib\site-packages\atx\drivers\android.py", line 279, in _take_screenshot
screen = self._screenshot_minicap()
File "C:\Python27\lib\site-packages\atx\drivers\android.py", line 231, in _screenshot_minicap
self._minicap_params(), phone_tmp_file)
File "C:\Python27\lib\site-packages\atx\drivers\android.py", line 215, in _minicap_params
rotation = self.rotation
File "C:\Python27\lib\site-packages\atx\drivers\android.py", line 202, in rotation
return self.adb_device.rotation() or self.info['displayRotation']
File "C:\Python27\lib\site-packages\uiautomator__init.py", line 616, in info
return self.server.jsonrpc.deviceInfo()
File "C:\Python27\lib\site-packages\uiautomator\init.py", line 408, in jsonrpc
return self.jsonrpc_wrap(timeout=int(os.environ.get("jsonrpc_timeout", 90)))
File "C:\Python27\lib\site-packages\uiautomator\init.py", line 446, in jsonrpc_wrap
return JsonRPCClient(self.rpc_uri,
File "C:\Python27\lib\site-packages\uiautomator\init.py", line 549, in rpc_uri
return "http://%s:%d/jsonrpc/0" % (self.adb.adb_server_host, self.local_port)
File "C:\Python27\lib\site-packages\uiautomator\init__.py", line 381, in local_port
raise RuntimeError("Error run: adb forward tcp: tcp:%d" % self.device_port)
RuntimeError: Error run: adb forward tcp: tcp:9008```
Version information
在按照指引安装好环境后,执行test.py 提示报错信息如下: ` File "D:\test.py", line 5, in
d.screenshot('screen.png') # 截图
File "C:\Python27\lib\site-packages\atx\drivers\mixin.py", line 62, in _inner
_retval = fn(*args, **kwargs)
File "C:\Python27\lib\site-packages\atx\drivers\mixin.py", line 387, in screenshot
screen = self._take_screenshot()
File "C:\Python27\lib\site-packages\atx\drivers\android.py", line 279, in _take_screenshot
screen = self._screenshot_minicap()
File "C:\Python27\lib\site-packages\atx\drivers\android.py", line 231, in _screenshot_minicap
self._minicap_params(), phone_tmp_file)
File "C:\Python27\lib\site-packages\atx\drivers\android.py", line 215, in _minicap_params
rotation = self.rotation
File "C:\Python27\lib\site-packages\atx\drivers\android.py", line 202, in rotation
return self.adb_device.rotation() or self.info['displayRotation']
File "C:\Python27\lib\site-packages\uiautomator__init.py", line 616, in info
return self.server.jsonrpc.deviceInfo()
File "C:\Python27\lib\site-packages\uiautomator\init.py", line 408, in jsonrpc
return self.jsonrpc_wrap(timeout=int(os.environ.get("jsonrpc_timeout", 90)))
File "C:\Python27\lib\site-packages\uiautomator\init.py", line 446, in jsonrpc_wrap
return JsonRPCClient(self.rpc_uri,
File "C:\Python27\lib\site-packages\uiautomator\init.py", line 549, in rpc_uri
return "http://%s:%d/jsonrpc/0" % (self.adb.adb_server_host, self.local_port)
File "C:\Python27\lib\site-packages\uiautomator\init__.py", line 381, in local_port
raise RuntimeError("Error run: adb forward tcp: tcp:%d" % self.device_port)
RuntimeError: Error run: adb forward tcp: tcp:9008```