NativeDevice
public
class
NativeDevice
extends Object
implements
IManagedTestDevice,
IConfigurationReceiver
java.lang.Object | |
↳ | com.android.tradefed.device.NativeDevice |
Cách triển khai mặc định của ITestDevice
Thiết bị Android không có ngăn xếp đầy đủ.
Tóm tắt
Lớp lồng ghép | |
---|---|
class |
NativeDevice.AdbAction
|
class |
NativeDevice.AdbShellAction
|
class |
NativeDevice.RebootDeviceAction
|
enum |
NativeDevice.RebootMode
Chế độ khởi động lại. |
Hằng số | |
---|---|
int |
INVALID_USER_ID
Giá trị được trả về cho mọi mã nhận dạng người dùng không hợp lệ/không tìm thấy: UserHandle đã xác định giá trị -10000 |
long |
MAX_HOST_DEVICE_TIME_OFFSET
|
int |
MAX_RETRY_ATTEMPTS
số lần thử lại lệnh mặc định cần thực hiện |
Trường | |
---|---|
protected
static
final
String |
SD_CARD
|
protected
static
final
String |
STORAGE_EMULATED
|
protected
TestDeviceOptions |
mOptions
|
protected
final
IDeviceStateMonitor |
mStateMonitor
|
Hàm khởi tạo công khai | |
---|---|
NativeDevice(IDevice device, IDeviceStateMonitor stateMonitor, IDeviceMonitor allocationMonitor)
Tạo |
Phương thức công khai | |
---|---|
boolean
|
checkApiLevelAgainstNextRelease(int strictMinLevel)
|
boolean
|
checkConnectivity()
|
boolean
|
clearErrorDialogs()
|
void
|
clearLastConnectedWifiNetwork()
|
void
|
clearLogcat()
|
boolean
|
connectToWifiNetwork(String wifiSsid, String wifiPsk)
|
boolean
|
connectToWifiNetwork(String wifiSsid, String wifiPsk, boolean scanSsid)
|
boolean
|
connectToWifiNetworkIfNeeded(String wifiSsid, String wifiPsk, boolean scanSsid)
|
boolean
|
connectToWifiNetworkIfNeeded(String wifiSsid, String wifiPsk)
|
int
|
createUser(String name, boolean guest, boolean ephemeral)
|
int
|
createUser(String name)
|
int
|
createUserNoThrow(String name)
|
void
|
deleteFile(String deviceFilePath)
|
boolean
|
deviceSoftRestarted(ProcessInfo prevSystemServerProcess)
|
boolean
|
deviceSoftRestartedSince(long utcEpochTime, TimeUnit timeUnit)
|
boolean
|
disableAdbRoot()
|
void
|
disableKeyguard()
|
boolean
|
disableNetworkMonitor()
|
boolean
|
disconnectFromWifi()
|
boolean
|
doesFileExist(String deviceFilePath)
|
File
|
dumpHeap(String process, String devicePath)
|
boolean
|
enableAdbRoot()
|
boolean
|
enableNetworkMonitor()
|
boolean
|
encryptDevice(boolean inplace)
|
String
|
executeAdbCommand(long timeout, String... cmdArgs)
|
String
|
executeAdbCommand(String... cmdArgs)
|
CommandResult
|
executeFastbootCommand(String... cmdArgs)
|
CommandResult
|
executeFastbootCommand(long timeout, String... cmdArgs)
|
CommandResult
|
executeLongFastbootCommand(String... cmdArgs)
|
String
|
executeShellCommand(String command)
|
void
|
executeShellCommand(String command, IShellOutputReceiver receiver, long maxTimeToOutputShellResponse, TimeUnit timeUnit, int retryAttempts)
|
void
|
executeShellCommand(String command, IShellOutputReceiver receiver, long maxTimeoutForCommand, long maxTimeToOutputShellResponse, TimeUnit timeUnit, int retryAttempts)
|
void
|
executeShellCommand(String command, IShellOutputReceiver receiver)
|
CommandResult
|
executeShellV2Command(String cmd)
|
CommandResult
|
executeShellV2Command(String cmd, OutputStream pipeToOutput)
|
CommandResult
|
executeShellV2Command(String cmd, File pipeAsInput)
|
CommandResult
|
executeShellV2Command(String cmd, long maxTimeoutForCommand, TimeUnit timeUnit, int retryAttempts)
|
CommandResult
|
executeShellV2Command(String cmd, long maxTimeoutForCommand, TimeUnit timeUnit)
|
CommandResult
|
executeShellV2Command(String cmd, File pipeAsInput, OutputStream pipeToOutput, long maxTimeoutForCommand, TimeUnit timeUnit, int retryAttempts)
|
CommandResult
|
executeShellV2Command(String cmd, File pipeAsInput, OutputStream pipeToOutput, OutputStream pipeToError, long maxTimeoutForCommand, TimeUnit timeUnit, int retryAttempts)
|
CommandResult
|
fastbootWipePartition(String partition)
|
|
getActiveApexes()
|
|
getAllSettings(String namespace)
|
DeviceAllocationState
|
getAllocationState()
|
String
|
getAndroidId(int userId)
|
|
getAndroidIds()
|
int
|
getApiLevel()
|
PackageInfo
|
getAppPackageInfo(String packageName)
|
|
getAppPackageInfos()
|
String
|
getBasebandVersion()
|
Integer
|
getBattery()
|
boolean
|
getBooleanProperty(String name, boolean defaultValue)
|
|
getBootHistory()
|
|
getBootHistorySince(long utcEpochTime, TimeUnit timeUnit)
|
String
|
getBootloaderVersion()
|
InputStreamSource
|
getBugreport()
|
InputStreamSource
|
getBugreportz()
|
String
|
getBuildAlias()
|
String
|
getBuildFlavor()
|
String
|
getBuildId()
|
String
|
getBuildSigningKeys()
|
DeviceDescriptor
|
getCachedDeviceDescriptor()
|
String[]
|
getChildren(String path)
|
DeviceFoldableState
|
getCurrentFoldableState()
|
int
|
getCurrentUser()
|
String
|
getDeviceClass()
|
long
|
getDeviceDate()
|
DeviceDescriptor
|
getDeviceDescriptor()
|
TestDeviceState
|
getDeviceState()
|
long
|
getDeviceTimeOffset(Date date)
|
InputStreamSource
|
getEmulatorOutput()
|
Process
|
getEmulatorProcess()
|
final
File
|
getExecuteShellCommandLog()
Nhật ký chứa tất cả nhật ký |
long
|
getExternalStoreFreeSpace()
|
String
|
getFastbootPath()
|
String
|
getFastbootProductType()
|
String
|
getFastbootProductVariant()
|
String
|
getFastbootSerialNumber()
|
String
|
getFastbootVariable(String variableName)
|
String
|
getFastbootVersion()
|
IFileEntry
|
getFileEntry(String path)
|
IFileEntry
|
getFileEntry(FileListingService.FileEntry entry)
Trình trợ giúp không chính thức để lấy |
|
getFoldableStates()
|
IDevice
|
getIDevice()
|
|
getInstalledPackageNames()
|
long
|
getIntProperty(String name, long defaultValue)
|
String
|
getIpAddress()
|
KeyguardControllerState
|
getKeyguardState()
|
long
|
getLastExpectedRebootTimeMillis()
|
int
|
getLaunchApiLevel()
|
InputStreamSource
|
getLogcat()
|
InputStreamSource
|
getLogcat(int maxBytes)
|
InputStreamSource
|
getLogcatDump()
|
InputStreamSource
|
getLogcatSince(long date)
|
String
|
getMacAddress()
|
|
getMainlineModuleInfo()
|
int
|
getMaxNumberOfRunningUsersSupported()
|
int
|
getMaxNumberOfUsersSupported()
|
IDeviceStateMonitor
|
getMonitor()
|
String
|
getMountPoint(String mountName)
|
ITestDevice.MountPointInfo
|
getMountPointInfo(String mountpoint)
|
|
getMountPointInfo()
|
TestDeviceOptions
|
getOptions()
|
long
|
getPartitionFreeSpace(String partition)
|
Integer
|
getPrimaryUserId()
|
ProcessInfo
|
getProcessByName(String processName)
|
String
|
getProcessPid(String process)
|
String
|
getProductType()
|
String
|
getProductVariant()
|
String
|
getProperty(String name)
|
ITestDevice.RecoveryMode
|
getRecoveryMode()
|
InputStreamSource
|
getScreenshot(String format)
|
InputStreamSource
|
getScreenshot(long displayId)
|
InputStreamSource
|
getScreenshot(String format, boolean rescale)
|
InputStreamSource
|
getScreenshot()
|
String
|
getSerialNumber()
|
String
|
getSetting(int userId, String namespace, String key)
|
String
|
getSetting(String namespace, String key)
|
String
|
getSimOperator()
|
String
|
getSimState()
|
|
getTombstones()
|
long
|
getTotalMemory()
|
|
getUninstallablePackageNames()
|
boolean
|
getUseFastbootErase()
|
int
|
getUserFlags(int userId)
|
|
getUserInfos()
|
int
|
getUserSerialNumber(int userId)
|
IManagedTestDevice.DeviceEventResponse
|
handleAllocationEvent(DeviceEvent event)
Xử lý DeviceEvent, có thể chuyển đổi thiết bị này sang trạng thái phân bổ mới hoặc không. |
boolean
|
hasFeature(String feature)
|
String
|
installPackage(File packageFile, boolean reinstall, String... extraArgs)
|
String
|
installPackage(File packageFile, boolean reinstall, boolean grantPermissions, String... extraArgs)
|
String
|
installPackageForUser(File packageFile, boolean reinstall, int userId, String... extraArgs)
|
String
|
installPackageForUser(File packageFile, boolean reinstall, boolean grantPermissions, int userId, String... extraArgs)
|
boolean
|
isAdbRoot()
|
boolean
|
isAdbTcp()
|
boolean
|
isAppEnumerationSupported()
|
boolean
|
isDeviceEncrypted()
|
boolean
|
isDirectory(String path)
|
boolean
|
isEnableAdbRoot()
|
boolean
|
isEncryptionSupported()
|
boolean
|
isExecutable(String fullPath)
|
boolean
|
isFastbootEnabled()
|
boolean
|
isHeadless()
|
boolean
|
isMultiUserSupported()
|
boolean
|
isPackageInstalled(String packageName, String userId)
|
boolean
|
isPackageInstalled(String packageName)
|
boolean
|
isRuntimePermissionSupported()
|
boolean
|
isStateBootloaderOrFastbootd()
|
boolean
|
isUserRunning(int userId)
|
boolean
|
isUserSecondary(int userId)
|
boolean
|
isWifiEnabled()
|
|
listDisplayIds()
|
|
listUsers()
|
boolean
|
logBugreport(String dataName, ITestLogger listener)
|
void
|
logOnDevice(String tag, Log.LogLevel level, String format, Object... args)
|
void
|
nonBlockingReboot()
|
void
|
postAdbRootAction()
Ghi đè nếu thiết bị cần thực hiện một số thao tác cụ thể sau khi thiết bị gốc adb và trước khi thiết bị kết nối lại với mạng. |
void
|
postAdbUnrootAction()
Ghi đè nếu thiết bị cần thực hiện một số thao tác cụ thể sau khi adb huỷ bỏ quyền truy cập gốc và trước khi thiết bị kết nối lại với mạng. |
void
|
postBootSetup()
|
void
|
postInvocationTearDown(Throwable exception)
|
void
|
preInvocationSetup(IBuildInfo info, MultiMap<String, String> attributes)
|
boolean
|
pullDir(String deviceFilePath, File localDir)
|
boolean
|
pullFile(String remoteFilePath, File localFile)
|
File
|
pullFile(String remoteFilePath)
|
String
|
pullFileContents(String remoteFilePath)
|
File
|
pullFileFromExternal(String remoteFilePath)
|
boolean
|
pushDir(File localFileDir, String deviceFilePath,
|
boolean
|
pushDir(File localFileDir, String deviceFilePath)
|
boolean
|
pushFile(File localFile, String remoteFilePath)
|
boolean
|
pushString(String contents, String remoteFilePath)
|
void
|
reboot(String reason)
|
void
|
reboot()
|
void
|
rebootIntoBootloader()
|
void
|
rebootIntoFastbootd()
|
void
|
rebootIntoRecovery()
|
void
|
rebootIntoSideload()
|
void
|
rebootIntoSideload(boolean autoReboot)
|
void
|
rebootUntilOnline()
|
void
|
rebootUntilOnline(String reason)
|
void
|
rebootUserspace()
|
void
|
rebootUserspaceUntilOnline()
|
void
|
recoverDevice()
Cố gắng khôi phục khả năng giao tiếp của thiết bị. |
void
|
remountSystemWritable()
|
void
|
remountVendorWritable()
|
boolean
|
removeAdmin(String componentName, int userId)
|
void
|
removeOwners()
|
boolean
|
removeUser(int userId)
|
void
|
resetContentProviderSetup()
Đặt lại cờ cho chế độ thiết lập nhà cung cấp nội dung để kích hoạt lại chế độ này. |
boolean
|
runInstrumentationTests(IRemoteAndroidTestRunner runner, ITestLifeCycleReceiver... listeners)
|
boolean
|
runInstrumentationTests(IRemoteAndroidTestRunner runner,
|
boolean
|
runInstrumentationTestsAsUser(IRemoteAndroidTestRunner runner, int userId, ITestLifeCycleReceiver... listeners)
|
boolean
|
runInstrumentationTestsAsUser(IRemoteAndroidTestRunner runner, int userId,
|
void
|
setConfiguration(IConfiguration configuration)
Chèn |
void
|
setDate(Date date)
|
boolean
|
setDeviceOwner(String componentName, int userId)
|
void
|
setDeviceState(TestDeviceState deviceState)
|
void
|
setEmulatorOutputStream(SizeLimitedOutputStream output)
Đối với trình mô phỏng, hãy đặt |
void
|
setEmulatorProcess(Process p)
|
void
|
setFastbootEnabled(boolean fastbootEnabled)
|
void
|
setFastbootPath(String fastbootPath)
|
void
|
setIDevice(IDevice newDevice)
|
void
|
setOptions(TestDeviceOptions options)
|
boolean
|
setProperty(String propKey, String propValue)
|
void
|
setRecovery(IDeviceRecovery recovery)
|
void
|
setRecoveryMode(ITestDevice.RecoveryMode mode)
|
void
|
setSetting(String namespace, String key, String value)
|
void
|
setSetting(int userId, String namespace, String key, String value)
|
void
|
setUseFastbootErase(boolean useFastbootErase)
|
void
|
startLogcat()
|
boolean
|
startUser(int userId)
|
boolean
|
startUser(int userId, boolean waitFlag)
|
void
|
stopEmulatorOutput()
|
void
|
stopLogcat()
|
boolean
|
stopUser(int userId)
|
boolean
|
stopUser(int userId, boolean waitFlag, boolean forceFlag)
|
String
|
switchToAdbTcp()
|
boolean
|
switchToAdbUsb()
|
boolean
|
switchUser(int userId)
|
boolean
|
switchUser(int userId, long timeout)
|
boolean
|
syncFiles(File localFileDir, String deviceFilePath)
|
Bugreport
|
takeBugreport()
|
boolean
|
unencryptDevice()
|
String
|
uninstallPackage(String packageName)
|
String
|
uninstallPackageForUser(String packageName, int userId)
|
boolean
|
unlockDevice()
|
boolean
|
waitForBootComplete(long timeOut)
|
void
|
waitForDeviceAvailable()
|
void
|
waitForDeviceAvailable(long waitTime)
|
boolean
|
waitForDeviceInRecovery(long waitTime)
|
boolean
|
waitForDeviceInSideload(long waitTime)
|
boolean
|
waitForDeviceNotAvailable(long waitTime)
|
void
|
waitForDeviceOnline()
|
void
|
waitForDeviceOnline(long waitTime)
|
boolean
|
waitForDeviceShell(long waitTime)
|
Phương thức được bảo vệ | |
---|---|
void
|
checkApiLevelAgainst(String feature, int strictMinLevel)
|
NativeDevice.RebootDeviceAction
|
createRebootDeviceAction(NativeDevice.RebootMode rebootMode, String reason)
Tạo |
void
|
doAdbReboot(NativeDevice.RebootMode rebootMode, String reason)
Khởi động lại adb. |
void
|
ensureRuntimePermissionSupported()
phương thức trợ giúp để gửi ngoại lệ nếu không hỗ trợ quyền khi bắt đầu chạy |
InputStreamSource
|
getBugreportInternal()
|
File
|
getBugreportzInternal()
Phương thức Trợ giúp nội bộ để lấy tệp zip bugreportz dưới dạng |
IRunUtil
|
getRunUtil()
Lấy thực thể |
String
|
internalGetProperty(String propName, String fastbootVar, String description)
Tìm nạp một thuộc tính thiết bị, từ bộ nhớ đệm ddmlib theo mặc định và quay lại `adb shell getprop` hoặc `fastboot getvar` tuỳ thuộc vào việc thiết bị có ở chế độ Khởi động nhanh hay không. |
boolean
|
isNewer(File localFile, IFileEntry entry)
Trả về |
boolean
|
performDeviceAction(String actionDescription, com.android.tradefed.device.NativeDevice.DeviceAction action, int retryAttempts)
Thực hiện một hành động trên thiết bị này. |
void
|
postAdbReboot()
Các hành động bổ sung có thể thực hiện sau khi khởi động lại. |
void
|
prePostBootSetup()
Cho phép mỗi loại thiết bị (AndroidNativeDevice, TestDevice) ghi đè phương thức này để thiết lập cụ thể sau khi khởi động. |
void
|
setClock(Clock clock)
Đặt thực thể Đồng hồ để sử dụng. |
void
|
setLogStartDelay(int delay)
Đặt thời gian chờ tính bằng mili giây trước khi bắt đầu ghi logcat cho một thiết bị trực tuyến. |
void
|
waitForDeviceNotAvailable(String operationDesc, long time)
|
Hằng số
INVALID_USER_ID
public static final int INVALID_USER_ID
Giá trị được trả về cho mọi mã nhận dạng người dùng không hợp lệ/không tìm thấy: UserHandle đã xác định giá trị -10000
Giá trị hằng số: -10000 (0xffffd8f0)
MAX_HOST_DEVICE_TIME_OFFSET
protected static final long MAX_HOST_DEVICE_TIME_OFFSET
Giá trị không đổi: 5000 (0x0000000000001388)
MAX_RETRY_ATTEMPTS
protected static final int MAX_RETRY_ATTEMPTS
số lần thử lại lệnh mặc định cần thực hiện
Giá trị không đổi: 2 (0x00000002)
Trường
SD_CARD
protected static final String SD_CARD
STORAGE_EMULATED
protected static final String STORAGE_EMULATED
mOptions
protected TestDeviceOptions mOptions
mStateMonitor
protected final IDeviceStateMonitor mStateMonitor
Hàm khởi tạo công khai
NativeDevice
public NativeDevice (IDevice device, IDeviceStateMonitor stateMonitor, IDeviceMonitor allocationMonitor)
Tạo TestDevice
.
Tham số | |
---|---|
device |
IDevice : IDevice được liên kết |
stateMonitor |
IDeviceStateMonitor : cơ chế IDeviceStateMonitor cần sử dụng |
allocationMonitor |
IDeviceMonitor : IDeviceMonitor để thông báo về các thay đổi trạng thái phân bổ.
Có thể là giá trị rỗng
|
Phương thức công khai
checkApiLevelAgainstNextRelease
public boolean checkApiLevelAgainstNextRelease (int strictMinLevel)
Tham số | |
---|---|
strictMinLevel |
int |
Giá trị trả về | |
---|---|
boolean |
Gửi | |
---|---|
DeviceNotAvailableException |
checkConnectivity
public boolean checkConnectivity ()
Giá trị trả về | |
---|---|
boolean |
Gửi | |
---|---|
DeviceNotAvailableException |
clearErrorDialogs
public boolean clearErrorDialogs ()
Giá trị trả về | |
---|---|
boolean |
Gửi | |
---|---|
DeviceNotAvailableException |
clearLastConnectedWifiNetwork
public void clearLastConnectedWifiNetwork ()
clearLogcat
public void clearLogcat ()
connectToWifiNetwork
public boolean connectToWifiNetwork (String wifiSsid, String wifiPsk)
Tham số | |
---|---|
wifiSsid |
String |
wifiPsk |
String |
Giá trị trả về | |
---|---|
boolean |
Gửi | |
---|---|
DeviceNotAvailableException |
connectToWifiNetwork
public boolean connectToWifiNetwork (String wifiSsid, String wifiPsk, boolean scanSsid)
Tham số | |
---|---|
wifiSsid |
String |
wifiPsk |
String |
scanSsid |
boolean |
Giá trị trả về | |
---|---|
boolean |
Gửi | |
---|---|
DeviceNotAvailableException |
connectToWifiNetworkIfNeeded
public boolean connectToWifiNetworkIfNeeded (String wifiSsid, String wifiPsk, boolean scanSsid)
Tham số | |
---|---|
wifiSsid |
String |
wifiPsk |
String |
scanSsid |
boolean |
Giá trị trả về | |
---|---|
boolean |
Gửi | |
---|---|
DeviceNotAvailableException |
connectToWifiNetworkIfNeeded
public boolean connectToWifiNetworkIfNeeded (String wifiSsid, String wifiPsk)
Tham số | |
---|---|
wifiSsid |
String |
wifiPsk |
String |
Giá trị trả về | |
---|---|
boolean |
Gửi | |
---|---|
DeviceNotAvailableException |
createUser
public int createUser (String name, boolean guest, boolean ephemeral)
Tham số | |
---|---|
name |
String |
guest |
boolean |
ephemeral |
boolean |
Giá trị trả về | |
---|---|
int |
Gửi | |
---|---|
DeviceNotAvailableException |
createUser
public int createUser (String name)
Tham số | |
---|---|
name |
String |
Giá trị trả về | |
---|---|
int |
Gửi | |
---|---|
DeviceNotAvailableException |
createUserNoThrow
public int createUserNoThrow (String name)
Tham số | |
---|---|
name |
String |
Giá trị trả về | |
---|---|
int |
Gửi | |
---|---|
DeviceNotAvailableException |
deleteFile
public void deleteFile (String deviceFilePath)
Tham số | |
---|---|
deviceFilePath |
String |
Gửi | |
---|---|
DeviceNotAvailableException |
deviceSoftRestarted
public boolean deviceSoftRestarted (ProcessInfo prevSystemServerProcess)
Tham số | |
---|---|
prevSystemServerProcess |
ProcessInfo |
Giá trị trả về | |
---|---|
boolean |
Gửi | |
---|---|
DeviceNotAvailableException |
deviceSoftRestartedSince
public boolean deviceSoftRestartedSince (long utcEpochTime, TimeUnit timeUnit)
Tham số | |
---|---|
utcEpochTime |
long |
timeUnit |
TimeUnit |
Giá trị trả về | |
---|---|
boolean |
Gửi | |
---|---|
DeviceNotAvailableException |
disableAdbRoot
public boolean disableAdbRoot ()
Giá trị trả về | |
---|---|
boolean |
Gửi | |
---|---|
DeviceNotAvailableException |
disableKeyguard
public void disableKeyguard ()
Gửi | |
---|---|
DeviceNotAvailableException |
disableNetworkMonitor
public boolean disableNetworkMonitor ()
Giá trị trả về | |
---|---|
boolean |
Gửi | |
---|---|
DeviceNotAvailableException |
disconnectFromWifi
public boolean disconnectFromWifi ()
Giá trị trả về | |
---|---|
boolean |
Gửi | |
---|---|
DeviceNotAvailableException |
doesFileExist
public boolean doesFileExist (String deviceFilePath)
Tham số | |
---|---|
deviceFilePath |
String |
Giá trị trả về | |
---|---|
boolean |
Gửi | |
---|---|
DeviceNotAvailableException |
dumpHeap
public File dumpHeap (String process, String devicePath)
Tham số | |
---|---|
process |
String |
devicePath |
String |
Giá trị trả về | |
---|---|
File |
Gửi | |
---|---|
DeviceNotAvailableException |
enableAdbRoot
public boolean enableAdbRoot ()
Giá trị trả về | |
---|---|
boolean |
Gửi | |
---|---|
DeviceNotAvailableException |
enableNetworkMonitor
public boolean enableNetworkMonitor ()
Giá trị trả về | |
---|---|
boolean |
Gửi | |
---|---|
DeviceNotAvailableException |
encryptDevice
public boolean encryptDevice (boolean inplace)
Tham số | |
---|---|
inplace |
boolean |
Giá trị trả về | |
---|---|
boolean |
Gửi | |
---|---|
DeviceNotAvailableException |
executeAdbCommand
public String executeAdbCommand (long timeout, String... cmdArgs)
Tham số | |
---|---|
timeout |
long |
cmdArgs |
String |
Giá trị trả về | |
---|---|
String |
Gửi | |
---|---|
DeviceNotAvailableException |
executeAdbCommand
public String executeAdbCommand (String... cmdArgs)
Tham số | |
---|---|
cmdArgs |
String |
Giá trị trả về | |
---|---|
String |
Gửi | |
---|---|
DeviceNotAvailableException |
executeFastbootCommand
public CommandResult executeFastbootCommand (String... cmdArgs)
Tham số | |
---|---|
cmdArgs |
String |
Giá trị trả về | |
---|---|
CommandResult |
Gửi | |
---|---|
DeviceNotAvailableException |
executeFastbootCommand
public CommandResult executeFastbootCommand (long timeout, String... cmdArgs)
Tham số | |
---|---|
timeout |
long |
cmdArgs |
String |
Giá trị trả về | |
---|---|
CommandResult |
Gửi | |
---|---|
DeviceNotAvailableException |
executeLongFastbootCommand
public CommandResult executeLongFastbootCommand (String... cmdArgs)
Tham số | |
---|---|
cmdArgs |
String |
Giá trị trả về | |
---|---|
CommandResult |
Gửi | |
---|---|
DeviceNotAvailableException |
executeShellCommand
public String executeShellCommand (String command)
Tham số | |
---|---|
command |
String |
Giá trị trả về | |
---|---|
String |
Gửi | |
---|---|
DeviceNotAvailableException |
executeShellCommand
public void executeShellCommand (String command, IShellOutputReceiver receiver, long maxTimeToOutputShellResponse, TimeUnit timeUnit, int retryAttempts)
Tham số | |
---|---|
command |
String |
receiver |
IShellOutputReceiver |
maxTimeToOutputShellResponse |
long |
timeUnit |
TimeUnit |
retryAttempts |
int |
Gửi | |
---|---|
DeviceNotAvailableException |
executeShellCommand
public void executeShellCommand (String command, IShellOutputReceiver receiver, long maxTimeoutForCommand, long maxTimeToOutputShellResponse, TimeUnit timeUnit, int retryAttempts)
Tham số | |
---|---|
command |
String |
receiver |
IShellOutputReceiver |
maxTimeoutForCommand |
long |
maxTimeToOutputShellResponse |
long |
timeUnit |
TimeUnit |
retryAttempts |
int |
Gửi | |
---|---|
DeviceNotAvailableException |
executeShellCommand
public void executeShellCommand (String command, IShellOutputReceiver receiver)
Tham số | |
---|---|
command |
String |
receiver |
IShellOutputReceiver |
Gửi | |
---|---|
DeviceNotAvailableException |
executeShellV2Command
public CommandResult executeShellV2Command (String cmd)
Tham số | |
---|---|
cmd |
String |
Giá trị trả về | |
---|---|
CommandResult |
Gửi | |
---|---|
DeviceNotAvailableException |
executeShellV2Command
public CommandResult executeShellV2Command (String cmd, OutputStream pipeToOutput)
Tham số | |
---|---|
cmd |
String |
pipeToOutput |
OutputStream |
Giá trị trả về | |
---|---|
CommandResult |
Gửi | |
---|---|
DeviceNotAvailableException |
executeShellV2Command
public CommandResult executeShellV2Command (String cmd, File pipeAsInput)
Tham số | |
---|---|
cmd |
String |
pipeAsInput |
File |
Giá trị trả về | |
---|---|
CommandResult |
Gửi | |
---|---|
DeviceNotAvailableException |
executeShellV2Command
public CommandResult executeShellV2Command (String cmd, long maxTimeoutForCommand, TimeUnit timeUnit, int retryAttempts)
Tham số | |
---|---|
cmd |
String |
maxTimeoutForCommand |
long |
timeUnit |
TimeUnit |
retryAttempts |
int |
Giá trị trả về | |
---|---|
CommandResult |
Gửi | |
---|---|
DeviceNotAvailableException |
executeShellV2Command
public CommandResult executeShellV2Command (String cmd, long maxTimeoutForCommand, TimeUnit timeUnit)
Tham số | |
---|---|
cmd |
String |
maxTimeoutForCommand |
long |
timeUnit |
TimeUnit |
Giá trị trả về | |
---|---|
CommandResult |
Gửi | |
---|---|
DeviceNotAvailableException |
executeShellV2Command
public CommandResult executeShellV2Command (String cmd, File pipeAsInput, OutputStream pipeToOutput, long maxTimeoutForCommand, TimeUnit timeUnit, int retryAttempts)
Tham số | |
---|---|
cmd |
String |
pipeAsInput |
File |
pipeToOutput |
OutputStream |
maxTimeoutForCommand |
long |
timeUnit |
TimeUnit |
retryAttempts |
int |
Giá trị trả về | |
---|---|
CommandResult |
Gửi | |
---|---|
DeviceNotAvailableException |
executeShellV2Command
public CommandResult executeShellV2Command (String cmd, File pipeAsInput, OutputStream pipeToOutput, OutputStream pipeToError, long maxTimeoutForCommand, TimeUnit timeUnit, int retryAttempts)
Tham số | |
---|---|
cmd |
String |
pipeAsInput |
File |
pipeToOutput |
OutputStream |
pipeToError |
OutputStream |
maxTimeoutForCommand |
long |
timeUnit |
TimeUnit |
retryAttempts |
int |
Giá trị trả về | |
---|---|
CommandResult |
Gửi | |
---|---|
DeviceNotAvailableException |
fastbootWipePartition
public CommandResult fastbootWipePartition (String partition)
Tham số | |
---|---|
partition |
String |
Giá trị trả về | |
---|---|
CommandResult |
Gửi | |
---|---|
DeviceNotAvailableException |
getActiveApexes
publicgetActiveApexes ()
Giá trị trả về | |
---|---|
|
Gửi | |
---|---|
DeviceNotAvailableException |
getAllSettings
publicgetAllSettings (String namespace)
Tham số | |
---|---|
namespace |
String |
Giá trị trả về | |
---|---|
|
Gửi | |
---|---|
DeviceNotAvailableException |
getAllocationState
public DeviceAllocationState getAllocationState ()
Giá trị trả về | |
---|---|
DeviceAllocationState |
getAndroidId
public String getAndroidId (int userId)
Tham số | |
---|---|
userId |
int |
Giá trị trả về | |
---|---|
String |
Gửi | |
---|---|
DeviceNotAvailableException |
getAndroidIds
publicgetAndroidIds ()
Giá trị trả về | |
---|---|
|
Gửi | |
---|---|
DeviceNotAvailableException |
getApiLevel
public int getApiLevel ()
Giá trị trả về | |
---|---|
int |
Gửi | |
---|---|
DeviceNotAvailableException |
getAppPackageInfo
public PackageInfo getAppPackageInfo (String packageName)
Tham số | |
---|---|
packageName |
String |
Giá trị trả về | |
---|---|
PackageInfo |
Gửi | |
---|---|
DeviceNotAvailableException |
getAppPackageInfos
publicgetAppPackageInfos ()
Giá trị trả về | |
---|---|
|
Gửi | |
---|---|
DeviceNotAvailableException |
getBasebandVersion
public String getBasebandVersion ()
Giá trị trả về | |
---|---|
String |
Gửi | |
---|---|
DeviceNotAvailableException |
getBattery
public Integer getBattery ()
Giá trị trả về | |
---|---|
Integer |
getBooleanProperty
public boolean getBooleanProperty (String name, boolean defaultValue)
Tham số | |
---|---|
name |
String |
defaultValue |
boolean |
Giá trị trả về | |
---|---|
boolean |
Gửi | |
---|---|
DeviceNotAvailableException |
getBootHistory
publicgetBootHistory ()
Giá trị trả về | |
---|---|
|
Gửi | |
---|---|
DeviceNotAvailableException |
getBootHistorySince
publicgetBootHistorySince (long utcEpochTime, TimeUnit timeUnit)
Tham số | |
---|---|
utcEpochTime |
long |
timeUnit |
TimeUnit |
Giá trị trả về | |
---|---|
|
Gửi | |
---|---|
DeviceNotAvailableException |
getBootloaderVersion
public String getBootloaderVersion ()
Giá trị trả về | |
---|---|
String |
Gửi | |
---|---|
DeviceNotAvailableException |
getBugreport
public InputStreamSource getBugreport ()
Giá trị trả về | |
---|---|
InputStreamSource |
getBugreportz
public InputStreamSource getBugreportz ()
Giá trị trả về | |
---|---|
InputStreamSource |
getBuildAlias
public String getBuildAlias ()
Giá trị trả về | |
---|---|
String |
Gửi | |
---|---|
DeviceNotAvailableException |
getBuildFlavor
public String getBuildFlavor ()
Giá trị trả về | |
---|---|
String |
Gửi | |
---|---|
DeviceNotAvailableException |
getBuildId
public String getBuildId ()
Giá trị trả về | |
---|---|
String |
Gửi | |
---|---|
DeviceNotAvailableException |
getBuildSigningKeys
public String getBuildSigningKeys ()
Giá trị trả về | |
---|---|
String |
Gửi | |
---|---|
DeviceNotAvailableException |
getCachedDeviceDescriptor
public DeviceDescriptor getCachedDeviceDescriptor ()
Giá trị trả về | |
---|---|
DeviceDescriptor |
getChildren
public String[] getChildren (String path)
Tham số | |
---|---|
path |
String |
Giá trị trả về | |
---|---|
String[] |
Gửi | |
---|---|
DeviceNotAvailableException |
getCurrentFoldableState
public DeviceFoldableState getCurrentFoldableState ()
Giá trị trả về | |
---|---|
DeviceFoldableState |
Gửi | |
---|---|
DeviceNotAvailableException |
getCurrentUser
public int getCurrentUser ()
Giá trị trả về | |
---|---|
int |
Gửi | |
---|---|
DeviceNotAvailableException |
getDeviceClass
public String getDeviceClass ()
Giá trị trả về | |
---|---|
String |
getDeviceDate
public long getDeviceDate ()
Giá trị trả về | |
---|---|
long |
Gửi | |
---|---|
DeviceNotAvailableException |
getDeviceDescriptor
public DeviceDescriptor getDeviceDescriptor ()
Giá trị trả về | |
---|---|
DeviceDescriptor |
getDeviceState
public TestDeviceState getDeviceState ()
Giá trị trả về | |
---|---|
TestDeviceState |
getDeviceTimeOffset
public long getDeviceTimeOffset (Date date)
Tham số | |
---|---|
date |
Date |
Giá trị trả về | |
---|---|
long |
Gửi | |
---|---|
DeviceNotAvailableException |
getEmulatorOutput
public InputStreamSource getEmulatorOutput ()
Giá trị trả về | |
---|---|
InputStreamSource |
getEmulatorProcess
public Process getEmulatorProcess ()
Giá trị trả về | |
---|---|
Process |
getExecuteShellCommandLog
public final File getExecuteShellCommandLog ()
Nhật ký chứa tất cả nhật ký executeShellCommand(String)
.
Giá trị trả về | |
---|---|
File |
getExternalStoreFreeSpace
public long getExternalStoreFreeSpace ()
Giá trị trả về | |
---|---|
long |
Gửi | |
---|---|
DeviceNotAvailableException |
getFastbootPath
public String getFastbootPath ()
Giá trị trả về | |
---|---|
String |
getFastbootProductType
public String getFastbootProductType ()
Giá trị trả về | |
---|---|
String |
Gửi | |
---|---|
DeviceNotAvailableException |
getFastbootProductVariant
public String getFastbootProductVariant ()
Giá trị trả về | |
---|---|
String |
Gửi | |
---|---|
DeviceNotAvailableException |
getFastbootSerialNumber
public String getFastbootSerialNumber ()
Giá trị trả về | |
---|---|
String |
getFastbootVariable
public String getFastbootVariable (String variableName)
Tham số | |
---|---|
variableName |
String |
Giá trị trả về | |
---|---|
String |
Gửi | |
---|---|
DeviceNotAvailableException |
getFastbootVersion
public String getFastbootVersion ()
Giá trị trả về | |
---|---|
String |
getFileEntry
public IFileEntry getFileEntry (String path)
Tham số | |
---|---|
path |
String |
Giá trị trả về | |
---|---|
IFileEntry |
Gửi | |
---|---|
DeviceNotAvailableException |
getFileEntry
public IFileEntry getFileEntry (FileListingService.FileEntry entry)
Trình trợ giúp không chính thức để lấy FileEntry
từ một đường dẫn không phải gốc. FIXME: Tái cấu trúc hệ thống FileEntry để có thể sử dụng hệ thống này từ bất kỳ đường dẫn nào. (ngay cả khi không phải là thư mục gốc).
Tham số | |
---|---|
entry |
FileListingService.FileEntry : FileEntry không nhất thiết phải là thư mục gốc như Ddmlib yêu cầu. |
Giá trị trả về | |
---|---|
IFileEntry |
FileEntryWrapper đại diện cho FileEntry. |
Gửi | |
---|---|
DeviceNotAvailableException |
getFoldableStates
publicgetFoldableStates ()
Giá trị trả về | |
---|---|
|
Gửi | |
---|---|
DeviceNotAvailableException |
getIDevice
public IDevice getIDevice ()
Giá trị trả về | |
---|---|
IDevice |
getInstalledPackageNames
publicgetInstalledPackageNames ()
Giá trị trả về | |
---|---|
|
Gửi | |
---|---|
DeviceNotAvailableException |
getIntProperty
public long getIntProperty (String name, long defaultValue)
Tham số | |
---|---|
name |
String |
defaultValue |
long |
Giá trị trả về | |
---|---|
long |
Gửi | |
---|---|
DeviceNotAvailableException |
getIpAddress
public String getIpAddress ()
Giá trị trả về | |
---|---|
String |
Gửi | |
---|---|
DeviceNotAvailableException |
getKeyguardState
public KeyguardControllerState getKeyguardState ()
Giá trị trả về | |
---|---|
KeyguardControllerState |
Gửi | |
---|---|
DeviceNotAvailableException |
getLastExpectedRebootTimeMillis
public long getLastExpectedRebootTimeMillis ()
Giá trị trả về | |
---|---|
long |
getLaunchApiLevel
public int getLaunchApiLevel ()
Giá trị trả về | |
---|---|
int |
Gửi | |
---|---|
DeviceNotAvailableException |
getLogcat
public InputStreamSource getLogcat ()
Giá trị trả về | |
---|---|
InputStreamSource |
getLogcat
public InputStreamSource getLogcat (int maxBytes)
Tham số | |
---|---|
maxBytes |
int |
Giá trị trả về | |
---|---|
InputStreamSource |
getLogcatDump
public InputStreamSource getLogcatDump ()
Giá trị trả về | |
---|---|
InputStreamSource |
getLogcatSince
public InputStreamSource getLogcatSince (long date)
Tham số | |
---|---|
date |
long |
Giá trị trả về | |
---|---|
InputStreamSource |
getMacAddress
public String getMacAddress ()
Giá trị trả về | |
---|---|
String |
getMainlineModuleInfo
publicgetMainlineModuleInfo ()
Giá trị trả về | |
---|---|
|
Gửi | |
---|---|
DeviceNotAvailableException |
getMaxNumberOfRunningUsersSupported
public int getMaxNumberOfRunningUsersSupported ()
Giá trị trả về | |
---|---|
int |
Gửi | |
---|---|
DeviceNotAvailableException |
getMaxNumberOfUsersSupported
public int getMaxNumberOfUsersSupported ()
Giá trị trả về | |
---|---|
int |
Gửi | |
---|---|
DeviceNotAvailableException |
getMonitor
public IDeviceStateMonitor getMonitor ()
Giá trị trả về | |
---|---|
IDeviceStateMonitor |
getMountPoint
public String getMountPoint (String mountName)
Tham số | |
---|---|
mountName |
String |
Giá trị trả về | |
---|---|
String |
getMountPointInfo
public ITestDevice.MountPointInfo getMountPointInfo (String mountpoint)
Tham số | |
---|---|
mountpoint |
String |
Giá trị trả về | |
---|---|
ITestDevice.MountPointInfo |
Gửi | |
---|---|
DeviceNotAvailableException |
getMountPointInfo
publicgetMountPointInfo ()
Giá trị trả về | |
---|---|
|
Gửi | |
---|---|
DeviceNotAvailableException |
getOptions
public TestDeviceOptions getOptions ()
Giá trị trả về | |
---|---|
TestDeviceOptions |
getPartitionFreeSpace
public long getPartitionFreeSpace (String partition)
Tham số | |
---|---|
partition |
String |
Giá trị trả về | |
---|---|
long |
Gửi | |
---|---|
DeviceNotAvailableException |
getPrimaryUserId
public Integer getPrimaryUserId ()
Giá trị trả về | |
---|---|
Integer |
Gửi | |
---|---|
DeviceNotAvailableException |
getProcessByName
public ProcessInfo getProcessByName (String processName)
Tham số | |
---|---|
processName |
String |
Giá trị trả về | |
---|---|
ProcessInfo |
Gửi | |
---|---|
DeviceNotAvailableException |
getProcessPid
public String getProcessPid (String process)
Tham số | |
---|---|
process |
String |
Giá trị trả về | |
---|---|
String |
Gửi | |
---|---|
DeviceNotAvailableException |
getProductType
public String getProductType ()
Giá trị trả về | |
---|---|
String |
Gửi | |
---|---|
DeviceNotAvailableException |
getProductVariant
public String getProductVariant ()
Giá trị trả về | |
---|---|
String |
Gửi | |
---|---|
DeviceNotAvailableException |
getProperty
public String getProperty (String name)
Tham số | |
---|---|
name |
String |
Giá trị trả về | |
---|---|
String |
Gửi | |
---|---|
DeviceNotAvailableException |
getRecoveryMode
public ITestDevice.RecoveryMode getRecoveryMode ()
Giá trị trả về | |
---|---|
ITestDevice.RecoveryMode |
getScreenshot
public InputStreamSource getScreenshot (String format)
Tham số | |
---|---|
format |
String |
Giá trị trả về | |
---|---|
InputStreamSource |
Gửi | |
---|---|
DeviceNotAvailableException |
getScreenshot
public InputStreamSource getScreenshot (long displayId)
Tham số | |
---|---|
displayId |
long |
Giá trị trả về | |
---|---|
InputStreamSource |
Gửi | |
---|---|
DeviceNotAvailableException |
getScreenshot
public InputStreamSource getScreenshot (String format, boolean rescale)
Tham số | |
---|---|
format |
String |
rescale |
boolean |
Giá trị trả về | |
---|---|
InputStreamSource |
Gửi | |
---|---|
DeviceNotAvailableException |
getScreenshot
public InputStreamSource getScreenshot ()
Giá trị trả về | |
---|---|
InputStreamSource |
Gửi | |
---|---|
DeviceNotAvailableException |
getSerialNumber
public String getSerialNumber ()
Giá trị trả về | |
---|---|
String |
getSetting
public String getSetting (int userId, String namespace, String key)
Tham số | |
---|---|
userId |
int |
namespace |
String |
key |
String |
Giá trị trả về | |
---|---|
String |
Gửi | |
---|---|
DeviceNotAvailableException |
getSetting
public String getSetting (String namespace, String key)
Tham số | |
---|---|
namespace |
String |
key |
String |
Giá trị trả về | |
---|---|
String |
Gửi | |
---|---|
DeviceNotAvailableException |
getSimOperator
public String getSimOperator ()
Giá trị trả về | |
---|---|
String |
getSimState
public String getSimState ()
Giá trị trả về | |
---|---|
String |
getTombstones
publicgetTombstones ()
Giá trị trả về | |
---|---|
|
Gửi | |
---|---|
DeviceNotAvailableException |
getTotalMemory
public long getTotalMemory ()
Giá trị trả về | |
---|---|
long |
getUninstallablePackageNames
publicgetUninstallablePackageNames ()
Giá trị trả về | |
---|---|
|
Gửi | |
---|---|
DeviceNotAvailableException |
getUseFastbootErase
public boolean getUseFastbootErase ()
Giá trị trả về | |
---|---|
boolean |
getUserFlags
public int getUserFlags (int userId)
Tham số | |
---|---|
userId |
int |
Giá trị trả về | |
---|---|
int |
Gửi | |
---|---|
DeviceNotAvailableException |
getUserInfos
publicgetUserInfos ()
Giá trị trả về | |
---|---|
|
Gửi | |
---|---|
DeviceNotAvailableException |
getUserSerialNumber
public int getUserSerialNumber (int userId)
Tham số | |
---|---|
userId |
int |
Giá trị trả về | |
---|---|
int |
Gửi | |
---|---|
DeviceNotAvailableException |
handleAllocationEvent
public IManagedTestDevice.DeviceEventResponse handleAllocationEvent (DeviceEvent event)
Xử lý DeviceEvent, có thể chuyển đổi thiết bị này sang trạng thái phân bổ mới hoặc không.
Tham số | |
---|---|
event |
DeviceEvent |
Giá trị trả về | |
---|---|
IManagedTestDevice.DeviceEventResponse |
hasFeature
public boolean hasFeature (String feature)
Tham số | |
---|---|
feature |
String |
Giá trị trả về | |
---|---|
boolean |
Gửi | |
---|---|
DeviceNotAvailableException |
installPackage
public String installPackage (File packageFile, boolean reinstall, String... extraArgs)
Tham số | |
---|---|
packageFile |
File |
reinstall |
boolean |
extraArgs |
String |
Giá trị trả về | |
---|---|
String |
Gửi | |
---|---|
DeviceNotAvailableException |
installPackage
public String installPackage (File packageFile, boolean reinstall, boolean grantPermissions, String... extraArgs)
Tham số | |
---|---|
packageFile |
File |
reinstall |
boolean |
grantPermissions |
boolean |
extraArgs |
String |
Giá trị trả về | |
---|---|
String |
Gửi | |
---|---|
DeviceNotAvailableException |
installPackageForUser
public String installPackageForUser (File packageFile, boolean reinstall, int userId, String... extraArgs)
Tham số | |
---|---|
packageFile |
File |
reinstall |
boolean |
userId |
int |
extraArgs |
String |
Giá trị trả về | |
---|---|
String |
Gửi | |
---|---|
DeviceNotAvailableException |
installPackageForUser
public String installPackageForUser (File packageFile, boolean reinstall, boolean grantPermissions, int userId, String... extraArgs)
Tham số | |
---|---|
packageFile |
File |
reinstall |
boolean |
grantPermissions |
boolean |
userId |
int |
extraArgs |
String |
Giá trị trả về | |
---|---|
String |
Gửi | |
---|---|
DeviceNotAvailableException |
isAdbRoot
public boolean isAdbRoot ()
Giá trị trả về | |
---|---|
boolean |
Gửi | |
---|---|
DeviceNotAvailableException |
isAdbTcp
public boolean isAdbTcp ()
Giá trị trả về | |
---|---|
boolean |
isAppEnumerationSupported
public boolean isAppEnumerationSupported ()
Giá trị trả về | |
---|---|
boolean |
Gửi | |
---|---|
DeviceNotAvailableException |
isDeviceEncrypted
public boolean isDeviceEncrypted ()
Giá trị trả về | |
---|---|
boolean |
Gửi | |
---|---|
DeviceNotAvailableException |
isDirectory
public boolean isDirectory (String path)
Tham số | |
---|---|
path |
String |
Giá trị trả về | |
---|---|
boolean |
Gửi | |
---|---|
DeviceNotAvailableException |
isEnableAdbRoot
public boolean isEnableAdbRoot ()
Giá trị trả về | |
---|---|
boolean |
true nếu cần bật quyền truy cập gốc adb trên thiết bị
|
isEncryptionSupported
public boolean isEncryptionSupported ()
Giá trị trả về | |
---|---|
boolean |
Gửi | |
---|---|
DeviceNotAvailableException |
isExecutable
public boolean isExecutable (String fullPath)
Tham số | |
---|---|
fullPath |
String |
Giá trị trả về | |
---|---|
boolean |
Gửi | |
---|---|
DeviceNotAvailableException |
isFastbootEnabled
public boolean isFastbootEnabled ()
Giá trị trả về | |
---|---|
boolean |
isHeadless
public boolean isHeadless ()
Giá trị trả về | |
---|---|
boolean |
Gửi | |
---|---|
DeviceNotAvailableException |
isMultiUserSupported
public boolean isMultiUserSupported ()
Giá trị trả về | |
---|---|
boolean |
Gửi | |
---|---|
DeviceNotAvailableException |
isPackageInstalled
public boolean isPackageInstalled (String packageName, String userId)
Tham số | |
---|---|
packageName |
String |
userId |
String |
Giá trị trả về | |
---|---|
boolean |
Gửi | |
---|---|
DeviceNotAvailableException |
isPackageInstalled
public boolean isPackageInstalled (String packageName)
Tham số | |
---|---|
packageName |
String |
Giá trị trả về | |
---|---|
boolean |
Gửi | |
---|---|
DeviceNotAvailableException |
isRuntimePermissionSupported
public boolean isRuntimePermissionSupported ()
Giá trị trả về | |
---|---|
boolean |
Gửi | |
---|---|
DeviceNotAvailableException |
isStateBootloaderOrFastbootd
public boolean isStateBootloaderOrFastbootd ()
Giá trị trả về | |
---|---|
boolean |
isUserRunning
public boolean isUserRunning (int userId)
Tham số | |
---|---|
userId |
int |
Giá trị trả về | |
---|---|
boolean |
Gửi | |
---|---|
DeviceNotAvailableException |
isUserSecondary
public boolean isUserSecondary (int userId)
Tham số | |
---|---|
userId |
int |
Giá trị trả về | |
---|---|
boolean |
Gửi | |
---|---|
DeviceNotAvailableException |
isWifiEnabled
public boolean isWifiEnabled ()
Giá trị trả về | |
---|---|
boolean |
Gửi | |
---|---|
DeviceNotAvailableException |
listDisplayIds
publiclistDisplayIds ()
Giá trị trả về | |
---|---|
|
Gửi | |
---|---|
DeviceNotAvailableException |
listUsers
publiclistUsers ()
Giá trị trả về | |
---|---|
|
Gửi | |
---|---|
DeviceNotAvailableException |
logBugreport
public boolean logBugreport (String dataName, ITestLogger listener)
Tham số | |
---|---|
dataName |
String |
listener |
ITestLogger |
Giá trị trả về | |
---|---|
boolean |
logOnDevice
public void logOnDevice (String tag, Log.LogLevel level, String format, Object... args)
Tham số | |
---|---|
tag |
String |
level |
Log.LogLevel |
format |
String |
args |
Object |
nonBlockingReboot
public void nonBlockingReboot ()
Gửi | |
---|---|
DeviceNotAvailableException |
postAdbRootAction
public void postAdbRootAction ()
Ghi đè nếu thiết bị cần thực hiện một số thao tác cụ thể sau khi thiết bị gốc adb và trước khi thiết bị kết nối lại với mạng. Phương thức triển khai mặc định không bao gồm bất kỳ hành động bổ sung nào. Không đảm bảo rằng quyền truy cập gốc adb sẽ được bật ở giai đoạn này.
Gửi | |
---|---|
DeviceNotAvailableException |
postAdbUnrootAction
public void postAdbUnrootAction ()
Ghi đè nếu thiết bị cần thực hiện một số thao tác cụ thể sau khi adb huỷ bỏ quyền truy cập gốc và trước khi thiết bị kết nối lại với mạng. Phương thức triển khai mặc định không bao gồm bất kỳ hành động bổ sung nào. Không đảm bảo rằng quyền truy cập gốc adb sẽ bị tắt ở giai đoạn này.
Gửi | |
---|---|
DeviceNotAvailableException |
postBootSetup
public void postBootSetup ()
Gửi | |
---|---|
DeviceNotAvailableException |
postInvocationTearDown
public void postInvocationTearDown (Throwable exception)
Tham số | |
---|---|
exception |
Throwable |
preInvocationSetup
public void preInvocationSetup (IBuildInfo info, MultiMap<String, String> attributes)
Tham số | |
---|---|
info |
IBuildInfo |
attributes |
MultiMap |
Gửi | |
---|---|
DeviceNotAvailableException |
|
TargetSetupError |
pullDir
public boolean pullDir (String deviceFilePath, File localDir)
Tham số | |
---|---|
deviceFilePath |
String |
localDir |
File |
Giá trị trả về | |
---|---|
boolean |
Gửi | |
---|---|
DeviceNotAvailableException |
pullFile
public boolean pullFile (String remoteFilePath, File localFile)
Tham số | |
---|---|
remoteFilePath |
String |
localFile |
File |
Giá trị trả về | |
---|---|
boolean |
Gửi | |
---|---|
DeviceNotAvailableException |
pullFile
public File pullFile (String remoteFilePath)
Tham số | |
---|---|
remoteFilePath |
String |
Giá trị trả về | |
---|---|
File |
Gửi | |
---|---|
DeviceNotAvailableException |
pullFileContents
public String pullFileContents (String remoteFilePath)
Tham số | |
---|---|
remoteFilePath |
String |
Giá trị trả về | |
---|---|
String |
Gửi | |
---|---|
DeviceNotAvailableException |
pullFileFromExternal
public File pullFileFromExternal (String remoteFilePath)
Tham số | |
---|---|
remoteFilePath |
String |
Giá trị trả về | |
---|---|
File |
Gửi | |
---|---|
DeviceNotAvailableException |
pushDir
public boolean pushDir (File localFileDir, String deviceFilePath,excludedDirectories)
Tham số | |
---|---|
localFileDir |
File |
deviceFilePath |
String |
excludedDirectories |
|
Giá trị trả về | |
---|---|
boolean |
Gửi | |
---|---|
DeviceNotAvailableException |
pushDir
public boolean pushDir (File localFileDir, String deviceFilePath)
Tham số | |
---|---|
localFileDir |
File |
deviceFilePath |
String |
Giá trị trả về | |
---|---|
boolean |
Gửi | |
---|---|
DeviceNotAvailableException |
pushFile
public boolean pushFile (File localFile, String remoteFilePath)
Tham số | |
---|---|
localFile |
File |
remoteFilePath |
String |
Giá trị trả về | |
---|---|
boolean |
Gửi | |
---|---|
DeviceNotAvailableException |
pushString
public boolean pushString (String contents, String remoteFilePath)
Tham số | |
---|---|
contents |
String |
remoteFilePath |
String |
Giá trị trả về | |
---|---|
boolean |
Gửi | |
---|---|
DeviceNotAvailableException |
khởi động lại
public void reboot (String reason)
Tham số | |
---|---|
reason |
String |
Gửi | |
---|---|
DeviceNotAvailableException |
khởi động lại
public void reboot ()
Gửi | |
---|---|
DeviceNotAvailableException |
rebootIntoBootloader
public void rebootIntoBootloader ()
Gửi | |
---|---|
DeviceNotAvailableException |
rebootIntoFastbootd
public void rebootIntoFastbootd ()
Gửi | |
---|---|
DeviceNotAvailableException |
rebootIntoRecovery
public void rebootIntoRecovery ()
Gửi | |
---|---|
DeviceNotAvailableException |
rebootIntoSideload
public void rebootIntoSideload ()
Gửi | |
---|---|
DeviceNotAvailableException |
rebootIntoSideload
public void rebootIntoSideload (boolean autoReboot)
Tham số | |
---|---|
autoReboot |
boolean |
Gửi | |
---|---|
DeviceNotAvailableException |
rebootUntilOnline
public void rebootUntilOnline ()
Gửi | |
---|---|
DeviceNotAvailableException |
rebootUntilOnline
public void rebootUntilOnline (String reason)
Tham số | |
---|---|
reason |
String |
Gửi | |
---|---|
DeviceNotAvailableException |
rebootUserspace
public void rebootUserspace ()
Gửi | |
---|---|
DeviceNotAvailableException |
rebootUserspaceUntilOnline
public void rebootUserspaceUntilOnline ()
Gửi | |
---|---|
DeviceNotAvailableException |
recoverDevice
public void recoverDevice ()
Cố gắng khôi phục khả năng giao tiếp của thiết bị.
Gửi | |
---|---|
DeviceNotAvailableException |
nếu thiết bị không còn hoạt động |
remountSystemWritable
public void remountSystemWritable ()
Gửi | |
---|---|
DeviceNotAvailableException |
remountVendorWritable
public void remountVendorWritable ()
Gửi | |
---|---|
DeviceNotAvailableException |
removeAdmin
public boolean removeAdmin (String componentName, int userId)
Tham số | |
---|---|
componentName |
String |
userId |
int |
Giá trị trả về | |
---|---|
boolean |
Gửi | |
---|---|
DeviceNotAvailableException |
removeOwners
public void removeOwners ()
Gửi | |
---|---|
DeviceNotAvailableException |
removeUser
public boolean removeUser (int userId)
Tham số | |
---|---|
userId |
int |
Giá trị trả về | |
---|---|
boolean |
Gửi | |
---|---|
DeviceNotAvailableException |
resetContentProviderSetup
public void resetContentProviderSetup ()
Đặt lại cờ cho chế độ thiết lập nhà cung cấp nội dung để kích hoạt lại chế độ này.
runInstrumentationTests
public boolean runInstrumentationTests (IRemoteAndroidTestRunner runner, ITestLifeCycleReceiver... listeners)
Tham số | |
---|---|
runner |
IRemoteAndroidTestRunner |
listeners |
ITestLifeCycleReceiver |
Giá trị trả về | |
---|---|
boolean |
Gửi | |
---|---|
DeviceNotAvailableException |
runInstrumentationTests
public boolean runInstrumentationTests (IRemoteAndroidTestRunner runner,listeners)
Tham số | |
---|---|
runner |
IRemoteAndroidTestRunner |
listeners |
|
Giá trị trả về | |
---|---|
boolean |
Gửi | |
---|---|
DeviceNotAvailableException |
runInstrumentationTestsAsUser
public boolean runInstrumentationTestsAsUser (IRemoteAndroidTestRunner runner, int userId, ITestLifeCycleReceiver... listeners)
Tham số | |
---|---|
runner |
IRemoteAndroidTestRunner |
userId |
int |
listeners |
ITestLifeCycleReceiver |
Giá trị trả về | |
---|---|
boolean |
Gửi | |
---|---|
DeviceNotAvailableException |
runInstrumentationTestsAsUser
public boolean runInstrumentationTestsAsUser (IRemoteAndroidTestRunner runner, int userId,listeners)
Tham số | |
---|---|
runner |
IRemoteAndroidTestRunner |
userId |
int |
listeners |
|
Giá trị trả về | |
---|---|
boolean |
Gửi | |
---|---|
DeviceNotAvailableException |
setConfiguration
public void setConfiguration (IConfiguration configuration)
Chèn IConfiguration
đang sử dụng.
Tham số | |
---|---|
configuration |
IConfiguration |
setDate
public void setDate (Date date)
Tham số | |
---|---|
date |
Date |
Gửi | |
---|---|
DeviceNotAvailableException |
setDeviceOwner
public boolean setDeviceOwner (String componentName, int userId)
Tham số | |
---|---|
componentName |
String |
userId |
int |
Giá trị trả về | |
---|---|
boolean |
Gửi | |
---|---|
DeviceNotAvailableException |
setDeviceState
public void setDeviceState (TestDeviceState deviceState)
Tham số | |
---|---|
deviceState |
TestDeviceState |
setEmulatorOutputStream
public void setEmulatorOutputStream (SizeLimitedOutputStream output)
Đối với trình mô phỏng, hãy đặt SizeLimitedOutputStream
để ghi nhật ký đầu ra
Tham số | |
---|---|
output |
SizeLimitedOutputStream : để ghi lại đầu ra
|
setEmulatorProcess
public void setEmulatorProcess (Process p)
Tham số | |
---|---|
p |
Process |
setFastbootEnabled
public void setFastbootEnabled (boolean fastbootEnabled)
Tham số | |
---|---|
fastbootEnabled |
boolean |
setFastbootPath
public void setFastbootPath (String fastbootPath)
Tham số | |
---|---|
fastbootPath |
String |
setIDevice
public void setIDevice (IDevice newDevice)
Tham số | |
---|---|
newDevice |
IDevice |
setOptions
public void setOptions (TestDeviceOptions options)
Tham số | |
---|---|
options |
TestDeviceOptions |
setProperty
public boolean setProperty (String propKey, String propValue)
Tham số | |
---|---|
propKey |
String |
propValue |
String |
Giá trị trả về | |
---|---|
boolean |
Gửi | |
---|---|
DeviceNotAvailableException |
setRecovery
public void setRecovery (IDeviceRecovery recovery)
Tham số | |
---|---|
recovery |
IDeviceRecovery |
setRecoveryMode
public void setRecoveryMode (ITestDevice.RecoveryMode mode)
Tham số | |
---|---|
mode |
ITestDevice.RecoveryMode |
setSetting
public void setSetting (String namespace, String key, String value)
Tham số | |
---|---|
namespace |
String |
key |
String |
value |
String |
Gửi | |
---|---|
DeviceNotAvailableException |
setSetting
public void setSetting (int userId, String namespace, String key, String value)
Tham số | |
---|---|
userId |
int |
namespace |
String |
key |
String |
value |
String |
Gửi | |
---|---|
DeviceNotAvailableException |
setUseFastbootErase
public void setUseFastbootErase (boolean useFastbootErase)
Tham số | |
---|---|
useFastbootErase |
boolean |
startLogcat
public void startLogcat ()
startUser
public boolean startUser (int userId)
Tham số | |
---|---|
userId |
int |
Giá trị trả về | |
---|---|
boolean |
Gửi | |
---|---|
DeviceNotAvailableException |
startUser
public boolean startUser (int userId, boolean waitFlag)
Tham số | |
---|---|
userId |
int |
waitFlag |
boolean |
Giá trị trả về | |
---|---|
boolean |
Gửi | |
---|---|
DeviceNotAvailableException |
stopEmulatorOutput
public void stopEmulatorOutput ()
stopLogcat
public void stopLogcat ()
stopUser
public boolean stopUser (int userId)
Tham số | |
---|---|
userId |
int |
Giá trị trả về | |
---|---|
boolean |
Gửi | |
---|---|
DeviceNotAvailableException |
stopUser
public boolean stopUser (int userId, boolean waitFlag, boolean forceFlag)
Tham số | |
---|---|
userId |
int |
waitFlag |
boolean |
forceFlag |
boolean |
Giá trị trả về | |
---|---|
boolean |
Gửi | |
---|---|
DeviceNotAvailableException |
switchToAdbTcp
public String switchToAdbTcp ()
Giá trị trả về | |
---|---|
String |
Gửi | |
---|---|
DeviceNotAvailableException |
switchToAdbUsb
public boolean switchToAdbUsb ()
Giá trị trả về | |
---|---|
boolean |
Gửi | |
---|---|
DeviceNotAvailableException |
switchUser
public boolean switchUser (int userId)
Tham số | |
---|---|
userId |
int |
Giá trị trả về | |
---|---|
boolean |
Gửi | |
---|---|
DeviceNotAvailableException |
switchUser
public boolean switchUser (int userId, long timeout)
Tham số | |
---|---|
userId |
int |
timeout |
long |
Giá trị trả về | |
---|---|
boolean |
Gửi | |
---|---|
DeviceNotAvailableException |
syncFiles
public boolean syncFiles (File localFileDir, String deviceFilePath)
Tham số | |
---|---|
localFileDir |
File |
deviceFilePath |
String |
Giá trị trả về | |
---|---|
boolean |
Gửi | |
---|---|
DeviceNotAvailableException |
takeBugreport
public Bugreport takeBugreport ()
Giá trị trả về | |
---|---|
Bugreport |
unencryptDevice
public boolean unencryptDevice ()
Giá trị trả về | |
---|---|
boolean |
Gửi | |
---|---|
DeviceNotAvailableException |
uninstallPackage
public String uninstallPackage (String packageName)
Tham số | |
---|---|
packageName |
String |
Giá trị trả về | |
---|---|
String |
Gửi | |
---|---|
DeviceNotAvailableException |
uninstallPackageForUser
public String uninstallPackageForUser (String packageName, int userId)
Tham số | |
---|---|
packageName |
String |
userId |
int |
Giá trị trả về | |
---|---|
String |
Gửi | |
---|---|
DeviceNotAvailableException |
unlockDevice
public boolean unlockDevice ()
Giá trị trả về | |
---|---|
boolean |
Gửi | |
---|---|
DeviceNotAvailableException |
waitForBootComplete
public boolean waitForBootComplete (long timeOut)
Tham số | |
---|---|
timeOut |
long |
Giá trị trả về | |
---|---|
boolean |
Gửi | |
---|---|
DeviceNotAvailableException |
waitForDeviceAvailable
public void waitForDeviceAvailable ()
Gửi | |
---|---|
DeviceNotAvailableException |
waitForDeviceAvailable
public void waitForDeviceAvailable (long waitTime)
Tham số | |
---|---|
waitTime |
long |
Gửi | |
---|---|
DeviceNotAvailableException |
waitForDeviceInRecovery
public boolean waitForDeviceInRecovery (long waitTime)
Tham số | |
---|---|
waitTime |
long |
Giá trị trả về | |
---|---|
boolean |
waitForDeviceInSideload
public boolean waitForDeviceInSideload (long waitTime)
Tham số | |
---|---|
waitTime |
long |
Giá trị trả về | |
---|---|
boolean |
waitForDeviceNotAvailable
public boolean waitForDeviceNotAvailable (long waitTime)
Tham số | |
---|---|
waitTime |
long |
Giá trị trả về | |
---|---|
boolean |
waitForDeviceOnline
public void waitForDeviceOnline ()
Gửi | |
---|---|
DeviceNotAvailableException |
waitForDeviceOnline
public void waitForDeviceOnline (long waitTime)
Tham số | |
---|---|
waitTime |
long |
Gửi | |
---|---|
DeviceNotAvailableException |
waitForDeviceShell
public boolean waitForDeviceShell (long waitTime)
Tham số | |
---|---|
waitTime |
long |
Giá trị trả về | |
---|---|
boolean |
Phương thức được bảo vệ
checkApiLevelAgainst
protected void checkApiLevelAgainst (String feature, int strictMinLevel)
Tham số | |
---|---|
feature |
String |
strictMinLevel |
int |
createRebootDeviceAction
protected NativeDevice.RebootDeviceAction createRebootDeviceAction (NativeDevice.RebootMode rebootMode, String reason)
Tạo RebootDeviceAction
để sử dụng khi thực hiện thao tác khởi động lại.
Tham số | |
---|---|
rebootMode |
NativeDevice.RebootMode : chế độ khởi động lại này. |
reason |
String : cho lần khởi động lại này. |
Giá trị trả về | |
---|---|
NativeDevice.RebootDeviceAction |
RebootDeviceAction đã tạo.
|
doAdbReboot
protected void doAdbReboot (NativeDevice.RebootMode rebootMode, String reason)
Khởi động lại adb.
Tham số | |
---|---|
rebootMode |
NativeDevice.RebootMode : chế độ khởi động lại này. |
reason |
String : cho lần khởi động lại này. |
Gửi | |
---|---|
DeviceNotAvailableException |
ensureRuntimePermissionSupported
protected void ensureRuntimePermissionSupported ()
phương thức trợ giúp để gửi ngoại lệ nếu không hỗ trợ quyền khi bắt đầu chạy
Gửi | |
---|---|
DeviceNotAvailableException |
getBugreportInternal
protected InputStreamSource getBugreportInternal ()
Giá trị trả về | |
---|---|
InputStreamSource |
getBugreportzInternal
protected File getBugreportzInternal ()
Phương thức Trợ giúp nội bộ để lấy tệp zip bugreportz dưới dạng ERROR(/File)
.
Giá trị trả về | |
---|---|
File |
getRunUtil
protected IRunUtil getRunUtil ()
Lấy thực thể RunUtil
để sử dụng.
Giá trị trả về | |
---|---|
IRunUtil |
internalGetProperty
protected String internalGetProperty (String propName, String fastbootVar, String description)
Tìm nạp một thuộc tính thiết bị, từ bộ nhớ đệm ddmlib theo mặc định và quay lại `adb shell getprop` hoặc `fastboot getvar` tuỳ thuộc vào việc thiết bị có ở chế độ Khởi động nhanh hay không.
Tham số | |
---|---|
propName |
String : Tên của thuộc tính thiết bị do lệnh "adb shell getprop" trả về |
fastbootVar |
String : Tên của biến khởi động nhanh tương đương để truy vấn. nếu null , truy vấn khởi động nhanh sẽ không được thực hiện |
description |
String : Nội dung mô tả đơn giản về biến. Chữ cái đầu tiên phải được viết hoa. |
Giá trị trả về | |
---|---|
String |
Một chuỗi, có thể là null hoặc trống, chứa giá trị của thuộc tính đã cho
|
Gửi | |
---|---|
DeviceNotAvailableException |
isNewer
protected boolean isNewer (File localFile, IFileEntry entry)
Trả về true
nếu tệp cục bộ mới hơn tệp từ xa. IFileEntry
chính xác đến phút, trong trường hợp thời gian bằng nhau, tệp sẽ được coi là mới hơn.
Tham số | |
---|---|
localFile |
File |
entry |
IFileEntry |
Giá trị trả về | |
---|---|
boolean |
performDeviceAction
protected boolean performDeviceAction (String actionDescription, com.android.tradefed.device.NativeDevice.DeviceAction action, int retryAttempts)
Thực hiện một hành động trên thiết bị này. Cố gắng khôi phục thiết bị và tuỳ ý thử lại lệnh nếu thao tác không thành công.
Tham số | |
---|---|
actionDescription |
String : nội dung mô tả ngắn về hành động cần thực hiện. Chỉ dùng cho mục đích ghi nhật ký. |
action |
com.android.tradefed.device.NativeDevice.DeviceAction : hành động cần thực hiện |
retryAttempts |
int : thử lại để thực hiện hành động nếu không thành công nhưng quá trình khôi phục thành công |
Giá trị trả về | |
---|---|
boolean |
true nếu hành động được thực hiện thành công |
Gửi | |
---|---|
DeviceNotAvailableException |
nếu không khôi phục được hoặc đã thực hiện số lần khôi phục tối đa mà không thành công |
postAdbReboot
protected void postAdbReboot ()
Các hành động bổ sung có thể thực hiện sau khi khởi động lại.
Gửi | |
---|---|
DeviceNotAvailableException |
prePostBootSetup
protected void prePostBootSetup ()
Cho phép mỗi loại thiết bị (AndroidNativeDevice, TestDevice) ghi đè phương thức này để thiết lập cụ thể sau khi khởi động.
Gửi | |
---|---|
DeviceNotAvailableException |
setClock
protected void setClock (Clock clock)
Đặt thực thể Đồng hồ để sử dụng.
Tham số | |
---|---|
clock |
Clock |
setLogStartDelay
protected void setLogStartDelay (int delay)
Đặt thời gian chờ tính bằng mili giây trước khi bắt đầu ghi logcat cho một thiết bị trực tuyến.
Tham số | |
---|---|
delay |
int : độ trễ tính bằng mili giây
|
waitForDeviceNotAvailable
protected void waitForDeviceNotAvailable (String operationDesc, long time)
Tham số | |
---|---|
operationDesc |
String |
time |
long |