Closed hfutxqd closed 3 years ago
已经有forward这个功能了
已经有forward这个功能了
forward需要占用一个本地端口
不好意思现在才处理这个问题,我本地测试了一下。有点不好使
f = adbutils.adb.open_local("CTN5T20410005246", "/sdcard/tmp.txt")
报这个异常
----> 1 f = adbutils.adb.open_local("CTN5T20410005246", "/sdcard/tmq.jar")
~/OpenProjects/adbutils/adbutils/__init__.py in open_local(self, serial, path, mode)
316 else:
317 c.send_command('localfilesystem:' + path)
--> 318 c.check_okay()
319 return c.conn.makefile(mode)
320
~/OpenProjects/adbutils/adbutils/__init__.py in check_okay(self)
150 data = self.read_string(4)
151 if data == _FAIL:
--> 152 raise AdbError(self.read_string_block())
153 elif data == _OKAY:
154 return
AdbError: closed
这里的path不能打开真正的文件,只能打开socket
要打开本地文件,应该使用
dev:
add open_local function(get file-like stream object directly instead of tcp forward)
example:
get a minitouch writable stream:
adb.open_local('localabstract:minitouch', 'wb')