Add support for push --sync.
Test: nose2 in system/core/adb Bug: None Change-Id: I6dcea2ff38a721f941c4abeba2949a319ea8c75f
This commit is contained in:
@@ -415,8 +415,23 @@ class AndroidDevice(object):
|
|||||||
cmd.append(filename)
|
cmd.append(filename)
|
||||||
return self._simple_call(cmd)
|
return self._simple_call(cmd)
|
||||||
|
|
||||||
def push(self, local, remote):
|
def push(self, local, remote, sync=False):
|
||||||
return self._simple_call(['push', local, remote])
|
"""Transfer a local file or directory to the device.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
local: The local file or directory to transfer.
|
||||||
|
remote: The remote path to which local should be transferred.
|
||||||
|
sync: If True, only transfers files that are newer on the host than
|
||||||
|
those on the device. If False, transfers all files.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
Exit status of the push command.
|
||||||
|
"""
|
||||||
|
cmd = ['push']
|
||||||
|
if sync:
|
||||||
|
cmd.append('--sync')
|
||||||
|
cmd.extend([local, remote])
|
||||||
|
return self._simple_call(cmd)
|
||||||
|
|
||||||
def pull(self, remote, local):
|
def pull(self, remote, local):
|
||||||
return self._simple_call(['pull', remote, local])
|
return self._simple_call(['pull', remote, local])
|
||||||
|
|||||||
Reference in New Issue
Block a user