RemoteSshUtil

public class RemoteSshUtil
extends Object

java.lang.Object
   ↳ com.android.tradefed.util.RemoteSshUtil


Tiện ích để thực thi các lệnh ssh trên các phiên bản từ xa.

Tóm tắt

Hàm khởi tạo công khai

RemoteSshUtil()

Phương thức công khai

static CommandResult remoteSshCommandExec(String host, String user, File sshPrivateKey, IRunUtil runUtil, long timeoutMs, String... command)

Thực thi một lệnh trên phiên bản từ xa bằng ssh.

static CommandResult remoteSshCommandExec(String host, String user, File sshPrivateKey, IRunUtil runUtil, long timeoutMs, OutputStream stdout, OutputStream stderr, String... command)

Thực thi một lệnh trên phiên bản từ xa bằng ssh.

Hàm khởi tạo công khai

RemoteSshUtil

public RemoteSshUtil ()

Phương thức công khai

remoteSshCommandExec

public static CommandResult remoteSshCommandExec (String host, 
                String user, 
                File sshPrivateKey, 
                IRunUtil runUtil, 
                long timeoutMs, 
                String... command)

Thực thi một lệnh trên phiên bản từ xa bằng ssh.

Tham số
host String

user String

sshPrivateKey File

runUtil IRunUtil: một IRunUtil để thực thi các lệnh.

timeoutMs long: tính bằng mili giây để quá trình tìm nạp hoàn tất

command String: Lệnh sẽ được thực thi.

Giá trị trả về
CommandResult CommandResult chứa trạng thái và nhật ký.

remoteSshCommandExec

public static CommandResult remoteSshCommandExec (String host, 
                String user, 
                File sshPrivateKey, 
                IRunUtil runUtil, 
                long timeoutMs, 
                OutputStream stdout, 
                OutputStream stderr, 
                String... command)

Thực thi một lệnh trên phiên bản từ xa bằng ssh.

Tham số
host String

user String

sshPrivateKey File

runUtil IRunUtil: một IRunUtil để thực thi các lệnh.

timeoutMs long: tính bằng mili giây để quá trình tìm nạp hoàn tất

stdout OutputStream: Một OutputStream nơi stdout sẽ được ghi lại.

stderr OutputStream: Một OutputStream nơi stderr sẽ được ghi nhật ký.

command String: Lệnh sẽ được thực thi.

Giá trị trả về
CommandResult Một CommandResult chứa trạng thái và nhật ký.