Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add open_local function(get file-like stream object directly instead … #27

Closed
wants to merge 1 commit into from

Conversation

hfutxqd
Copy link
Contributor

@hfutxqd hfutxqd commented Jul 24, 2020

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')

@codeskyblue
Copy link
Member

已经有forward这个功能了

@codeskyblue codeskyblue added the invalid This doesn't seem right label Aug 5, 2020
@hfutxqd
Copy link
Contributor Author

hfutxqd commented Aug 5, 2020

已经有forward这个功能了

forward需要占用一个本地端口

@codeskyblue
Copy link
Member

不好意思现在才处理这个问题,我本地测试了一下。有点不好使

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

@hfutxqd
Copy link
Contributor Author

hfutxqd commented Mar 26, 2021

@hfutxqd
Copy link
Contributor Author

hfutxqd commented Mar 26, 2021

这里的path不能打开真正的文件,只能打开socket
要打开本地文件,应该使用
dev:

@codeskyblue
Copy link
Member

Manually merged in a1ea667

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid This doesn't seem right
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants