Skip to content
This repository was archived by the owner on Jan 10, 2023. It is now read-only.

Protocol: AttributeError: 'NoneType' object has no attribute 'ReadUntilClose' #59

Description

@eismog

Hi,

I will get an error, when I run two error command:

Like this:

importos.pathasopfromadbimportadb_commandsfromadbimportsign_m2crypto# KitKat+ devices require authenticationsigner=sign_m2crypto.M2CryptoSigner(
op.expanduser('~/.android/adbkey'))
# Connect to the devicedevice=adb_commands.AdbCommands.ConnectDevice(
rsa_keys=[signer])
# Now we can use Shell, Pull, Push, etc!# for i in xrange(10):# print device.Shell('echo %d' % i)printdevice.Shell('ls 333')
printdevice.Shell('ls 222')
printdevice.Shell('ls 111')
device.Close()

result:

/usr/bin/python2.7/home/ligf/PycharmProjects/test-adb/tmp.pyls: 333: NosuchfileordirectoryTraceback (mostrecentcalllast):
File"/home/ligf/PycharmProjects/test-adb/tmp.py", line18, in<module>printdevice.Shell('ls 222')
File"build/bdist.linux-x86_64/egg/adb/adb_commands.py", line227, inShellFile"build/bdist.linux-x86_64/egg/adb/adb_protocol.py", line377, inCommandFile"build/bdist.linux-x86_64/egg/adb/adb_protocol.py", line405, inStreamingCommandAttributeError: 'NoneType'objecthasnoattribute'ReadUntilClose'Processfinishedwithexitcode1

It may be a bug at here:
adb_protocol.py

ifcmd==b'CLSE':
# Device doesn't support this service.returnNoneifcmd!=b'OKAY':
raiseInvalidCommandError('Expected a ready response, got %s'%cmd,
cmd, (remote_id, their_local_id))
return_AdbConnection(usb, local_id, remote_id, timeout_ms)

BRs
/Eismog

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions