1

我正在尝试学习使用 python 创建 android 应用程序。我正在阅读教程。

当我运行命令时:

adb forward tcp:9999 tcp:4321
set AP_PORT=9999

然后运行代码,

import android
droid = android.Android()
droid.makeToast("Hello from my computer!")

它给了我错误:

Traceback (most recent call last):
  File "<pyshell#5>", line 1, in <module>
    droid.makeToast("Hello from my computer!")
  File "C:\Python27\lib\site-packages\android.py", line 58, in rpc_call
    return self._rpc(name, *args)
  File "C:\Python27\lib\site-packages\android.py", line 47, in _rpc
    response = self.client.readline()
  File "C:\Python27\lib\socket.py", line 447, in readline
data = self._sock.recv(self._rbufsize)
error: [Errno 10053] An established connection was aborted by the software in your host     machine

我该如何解决这个问题?

4

0 回答 0