NativeDevice

public class NativeDevice
extends Object implements IManagedTestDevice, IConfigurationReceiver

java.lang.Object
   ↳ com.android.tradefed.device.NativeDevice


การติดตั้งใช้งานเริ่มต้นของITestDevice อุปกรณ์ Android ที่ไม่ใช้สแต็กแบบสมบูรณ์

สรุป

ชั้นเรียนที่ซ้อนกัน

class NativeDevice.AdbAction

DeviceAction สำหรับเรียกใช้คำสั่ง "adb ...." ของ OS 

class NativeDevice.AdbShellAction

 

class NativeDevice.RebootDeviceAction

DeviceAction เพื่อรีบูตอุปกรณ์ 

enum NativeDevice.RebootMode

โหมดการรีบูต 

ค่าคงที่

int INVALID_USER_ID

ค่าที่แสดงผลสำหรับรหัสผู้ใช้ที่ไม่ถูกต้อง/ไม่พบ: UserHandle กำหนดค่า -10000

long MAX_HOST_DEVICE_TIME_OFFSET

int MAX_RETRY_ATTEMPTS

จำนวนเริ่มต้นของการพยายามดำเนินการคำสั่งอีกครั้ง

ช่อง

protected static final String SD_CARD

protected static final String STORAGE_EMULATED

protected TestDeviceOptions mOptions

protected final IDeviceStateMonitor mStateMonitor

ตัวสร้างแบบสาธารณะ

NativeDevice(IDevice device, IDeviceStateMonitor stateMonitor, IDeviceMonitor allocationMonitor)

สร้าง TestDevice

เมธอดสาธารณะ

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

บันทึกที่มีบันทึก executeShellCommand(String) ทั้งหมด

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)

เครื่องมือช่วยที่ไม่เป็นทางการสำหรับรับ FileEntry จากเส้นทางที่ไม่ใช่รูท

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)

ประมวลผล DeviceEvent ซึ่งอาจเปลี่ยนสถานะอุปกรณ์นี้เป็นสถานะการจัดสรรใหม่หรือไม่ก็ได้

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

ลบล้างหากอุปกรณ์ต้องดำเนินการบางอย่างหลังจากการรูท adb และก่อนที่อุปกรณ์จะกลับมาออนไลน์อีกครั้ง

void postAdbUnrootAction()

ลบล้างหากอุปกรณ์ต้องดำเนินการบางอย่างหลังจาก adb ยกเลิกการรูทและก่อนที่อุปกรณ์จะกลับมาออนไลน์อีกครั้ง

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, excludedDirectories)

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

พยายามกู้คืนการสื่อสารของอุปกรณ์

void remountSystemWritable()

void remountVendorWritable()

boolean removeAdmin(String componentName, int userId)

void removeOwners()

boolean removeUser(int userId)

void resetContentProviderSetup()

รีเซ็ตการตั้งค่าผู้ให้บริการเนื้อหาเพื่อเรียกให้การตั้งค่าทำงานอีกครั้ง

boolean runInstrumentationTests(IRemoteAndroidTestRunner runner, ITestLifeCycleReceiver... listeners)

boolean runInstrumentationTests(IRemoteAndroidTestRunner runner, listeners)

boolean runInstrumentationTestsAsUser(IRemoteAndroidTestRunner runner, int userId, ITestLifeCycleReceiver... listeners)

boolean runInstrumentationTestsAsUser(IRemoteAndroidTestRunner runner, int userId, listeners)

void setConfiguration(IConfiguration configuration)

แทรก IConfiguration ที่ใช้อยู่

void setDate(Date date)

boolean setDeviceOwner(String componentName, int userId)

void setDeviceState(TestDeviceState deviceState)

void setEmulatorOutputStream(SizeLimitedOutputStream output)

สําหรับโปรแกรมจําลอง ให้ตั้งค่า SizeLimitedOutputStream เพื่อบันทึกเอาต์พุต

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)

วิธีการที่มีการป้องกัน

void checkApiLevelAgainst(String feature, int strictMinLevel)
NativeDevice.RebootDeviceAction createRebootDeviceAction(NativeDevice.RebootMode rebootMode, String reason)

สร้าง RebootDeviceAction เพื่อใช้เมื่อดำเนินการรีบูต

void doAdbReboot(NativeDevice.RebootMode rebootMode, String reason)

รีบูต adb

void ensureRuntimePermissionSupported()

เมธอดตัวช่วยที่จะแสดงข้อยกเว้นหากระบบไม่รองรับสิทธิ์รันไทม์

InputStreamSource getBugreportInternal()
File getBugreportzInternal()

วิธีการ Helper ภายในเพื่อรับไฟล์ ZIP ของ bugreportz เป็น ERROR(/File)

IRunUtil getRunUtil()

รับอินสแตนซ์ RunUtil เพื่อใช้งาน

String internalGetProperty(String propName, String fastbootVar, String description)

ดึงข้อมูลพร็อพเพอร์ตี้ของอุปกรณ์จากแคช ddmlib โดยค่าเริ่มต้น และเปลี่ยนไปใช้ `adb shell getprop` หรือ `fastboot getvar` ขึ้นอยู่กับว่าอุปกรณ์อยู่ใน Fastboot หรือไม่

boolean isNewer(File localFile, IFileEntry entry)

แสดงผล true หากไฟล์ในเครื่องใหม่กว่าไฟล์ระยะไกล

boolean performDeviceAction(String actionDescription, com.android.tradefed.device.NativeDevice.DeviceAction action, int retryAttempts)

ดำเนินการในอุปกรณ์นี้

void postAdbReboot()

การดำเนินการเพิ่มเติมที่ทำได้หลังจากรีบูต

void prePostBootSetup()

อนุญาตให้อุปกรณ์แต่ละประเภท (AndroidNativeDevice, TestDevice) ลบล้างวิธีการนี้สำหรับการตั้งค่าหลังการบูตที่เฉพาะเจาะจง

void setClock(Clock clock)

ตั้งค่าอินสแตนซ์นาฬิกาที่จะใช้

void setLogStartDelay(int delay)

ตั้งค่าเวลาเป็นมิลลิวินาทีที่จะรอก่อนที่จะเริ่มการบันทึก Logcat สําหรับอุปกรณ์ออนไลน์

void waitForDeviceNotAvailable(String operationDesc, long time)

ค่าคงที่

INVALID_USER_ID

public static final int INVALID_USER_ID

ค่าที่แสดงผลสำหรับรหัสผู้ใช้ที่ไม่ถูกต้อง/ไม่พบ: UserHandle กำหนดค่า -10000

ค่าคงที่: -10000 (0xffffd8f0)

MAX_HOST_DEVICE_TIME_OFFSET

protected static final long MAX_HOST_DEVICE_TIME_OFFSET

ค่าคงที่: 5000 (0x0000000000001388)

MAX_RETRY_ATTEMPTS

protected static final int MAX_RETRY_ATTEMPTS

จำนวนเริ่มต้นของการพยายามดำเนินการคำสั่งอีกครั้ง

ค่าคงที่: 2 (0x00000002)

ช่อง

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

ตัวสร้างแบบสาธารณะ

NativeDevice

public NativeDevice (IDevice device, 
                IDeviceStateMonitor stateMonitor, 
                IDeviceMonitor allocationMonitor)

สร้าง TestDevice

พารามิเตอร์
device IDevice: IDevice ที่เชื่อมโยง

stateMonitor IDeviceStateMonitor: กลไก IDeviceStateMonitor ที่จะใช้

allocationMonitor IDeviceMonitor: IDeviceMonitor เพื่อแจ้งให้ทราบถึงการเปลี่ยนแปลงสถานะการจัดสรร อาจเป็นค่าว่าง

เมธอดสาธารณะ

checkApiLevelAgainstNextRelease

public boolean checkApiLevelAgainstNextRelease (int strictMinLevel)

พารามิเตอร์
strictMinLevel int

คิกรีเทิร์น
boolean

การโยน
DeviceNotAvailableException

checkConnectivity

public boolean checkConnectivity ()

คิกรีเทิร์น
boolean

การโยน
DeviceNotAvailableException

clearErrorDialogs

public boolean clearErrorDialogs ()

คิกรีเทิร์น
boolean

การโยน
DeviceNotAvailableException

clearLastConnectedWifiNetwork

public void clearLastConnectedWifiNetwork ()

clearLogcat

public void clearLogcat ()

connectToWifiNetwork

public boolean connectToWifiNetwork (String wifiSsid, 
                String wifiPsk)

พารามิเตอร์
wifiSsid String

wifiPsk String

คิกรีเทิร์น
boolean

การโยน
DeviceNotAvailableException

connectToWifiNetwork

public boolean connectToWifiNetwork (String wifiSsid, 
                String wifiPsk, 
                boolean scanSsid)

พารามิเตอร์
wifiSsid String

wifiPsk String

scanSsid boolean

คิกรีเทิร์น
boolean

การโยน
DeviceNotAvailableException

connectToWifiNetworkIfNeeded

public boolean connectToWifiNetworkIfNeeded (String wifiSsid, 
                String wifiPsk, 
                boolean scanSsid)

พารามิเตอร์
wifiSsid String

wifiPsk String

scanSsid boolean

คิกรีเทิร์น
boolean

การโยน
DeviceNotAvailableException

connectToWifiNetworkIfNeeded

public boolean connectToWifiNetworkIfNeeded (String wifiSsid, 
                String wifiPsk)

พารามิเตอร์
wifiSsid String

wifiPsk String

คิกรีเทิร์น
boolean

การโยน
DeviceNotAvailableException

createUser

public int createUser (String name, 
                boolean guest, 
                boolean ephemeral)

พารามิเตอร์
name String

guest boolean

ephemeral boolean

คิกรีเทิร์น
int

การโยน
DeviceNotAvailableException

createUser

public int createUser (String name)

พารามิเตอร์
name String

คิกรีเทิร์น
int

การโยน
DeviceNotAvailableException

createUserNoThrow

public int createUserNoThrow (String name)

พารามิเตอร์
name String

คิกรีเทิร์น
int

การโยน
DeviceNotAvailableException

deleteFile

public void deleteFile (String deviceFilePath)

พารามิเตอร์
deviceFilePath String

การโยน
DeviceNotAvailableException

deviceSoftRestarted

public boolean deviceSoftRestarted (ProcessInfo prevSystemServerProcess)

พารามิเตอร์
prevSystemServerProcess ProcessInfo

คิกรีเทิร์น
boolean

การโยน
DeviceNotAvailableException

deviceSoftRestartedSince

public boolean deviceSoftRestartedSince (long utcEpochTime, 
                TimeUnit timeUnit)

พารามิเตอร์
utcEpochTime long

timeUnit TimeUnit

คิกรีเทิร์น
boolean

การโยน
DeviceNotAvailableException

disableAdbRoot

public boolean disableAdbRoot ()

คิกรีเทิร์น
boolean

การโยน
DeviceNotAvailableException

disableKeyguard

public void disableKeyguard ()

การโยน
DeviceNotAvailableException

disableNetworkMonitor

public boolean disableNetworkMonitor ()

คิกรีเทิร์น
boolean

การโยน
DeviceNotAvailableException

disconnectFromWifi

public boolean disconnectFromWifi ()

คิกรีเทิร์น
boolean

การโยน
DeviceNotAvailableException

doesFileExist

public boolean doesFileExist (String deviceFilePath)

พารามิเตอร์
deviceFilePath String

คิกรีเทิร์น
boolean

การโยน
DeviceNotAvailableException

dumpHeap

public File dumpHeap (String process, 
                String devicePath)

พารามิเตอร์
process String

devicePath String

คิกรีเทิร์น
File

การโยน
DeviceNotAvailableException

enableAdbRoot

public boolean enableAdbRoot ()

คิกรีเทิร์น
boolean

การโยน
DeviceNotAvailableException

enableNetworkMonitor

public boolean enableNetworkMonitor ()

คิกรีเทิร์น
boolean

การโยน
DeviceNotAvailableException

encryptDevice

public boolean encryptDevice (boolean inplace)

พารามิเตอร์
inplace boolean

คิกรีเทิร์น
boolean

การโยน
DeviceNotAvailableException

executeAdbCommand

public String executeAdbCommand (long timeout, 
                String... cmdArgs)

พารามิเตอร์
timeout long

cmdArgs String

คิกรีเทิร์น
String

การโยน
DeviceNotAvailableException

executeAdbCommand

public String executeAdbCommand (String... cmdArgs)

พารามิเตอร์
cmdArgs String

คิกรีเทิร์น
String

การโยน
DeviceNotAvailableException

executeFastbootCommand

public CommandResult executeFastbootCommand (String... cmdArgs)

พารามิเตอร์
cmdArgs String

คิกรีเทิร์น
CommandResult

การโยน
DeviceNotAvailableException

executeFastbootCommand

public CommandResult executeFastbootCommand (long timeout, 
                String... cmdArgs)

พารามิเตอร์
timeout long

cmdArgs String

คิกรีเทิร์น
CommandResult

การโยน
DeviceNotAvailableException

executeLongFastbootCommand

public CommandResult executeLongFastbootCommand (String... cmdArgs)

พารามิเตอร์
cmdArgs String

คิกรีเทิร์น
CommandResult

การโยน
DeviceNotAvailableException

executeShellCommand

public String executeShellCommand (String command)

พารามิเตอร์
command String

คิกรีเทิร์น
String

การโยน
DeviceNotAvailableException

executeShellCommand

public void executeShellCommand (String command, 
                IShellOutputReceiver receiver, 
                long maxTimeToOutputShellResponse, 
                TimeUnit timeUnit, 
                int retryAttempts)

พารามิเตอร์
command String

receiver IShellOutputReceiver

maxTimeToOutputShellResponse long

timeUnit TimeUnit

retryAttempts int

การโยน
DeviceNotAvailableException

executeShellCommand

public void executeShellCommand (String command, 
                IShellOutputReceiver receiver, 
                long maxTimeoutForCommand, 
                long maxTimeToOutputShellResponse, 
                TimeUnit timeUnit, 
                int retryAttempts)

พารามิเตอร์
command String

receiver IShellOutputReceiver

maxTimeoutForCommand long

maxTimeToOutputShellResponse long

timeUnit TimeUnit

retryAttempts int

การโยน
DeviceNotAvailableException

executeShellCommand

public void executeShellCommand (String command, 
                IShellOutputReceiver receiver)

พารามิเตอร์
command String

receiver IShellOutputReceiver

การโยน
DeviceNotAvailableException

executeShellV2Command

public CommandResult executeShellV2Command (String cmd)

พารามิเตอร์
cmd String

คิกรีเทิร์น
CommandResult

การโยน
DeviceNotAvailableException

executeShellV2Command

public CommandResult executeShellV2Command (String cmd, 
                OutputStream pipeToOutput)

พารามิเตอร์
cmd String

pipeToOutput OutputStream

คิกรีเทิร์น
CommandResult

การโยน
DeviceNotAvailableException

executeShellV2Command

public CommandResult executeShellV2Command (String cmd, 
                File pipeAsInput)

พารามิเตอร์
cmd String

pipeAsInput File

คิกรีเทิร์น
CommandResult

การโยน
DeviceNotAvailableException

executeShellV2Command

public CommandResult executeShellV2Command (String cmd, 
                long maxTimeoutForCommand, 
                TimeUnit timeUnit, 
                int retryAttempts)

พารามิเตอร์
cmd String

maxTimeoutForCommand long

timeUnit TimeUnit

retryAttempts int

คิกรีเทิร์น
CommandResult

การโยน
DeviceNotAvailableException

executeShellV2Command

public CommandResult executeShellV2Command (String cmd, 
                long maxTimeoutForCommand, 
                TimeUnit timeUnit)

พารามิเตอร์
cmd String

maxTimeoutForCommand long

timeUnit TimeUnit

คิกรีเทิร์น
CommandResult

การโยน
DeviceNotAvailableException

executeShellV2Command

public CommandResult executeShellV2Command (String cmd, 
                File pipeAsInput, 
                OutputStream pipeToOutput, 
                long maxTimeoutForCommand, 
                TimeUnit timeUnit, 
                int retryAttempts)

พารามิเตอร์
cmd String

pipeAsInput File

pipeToOutput OutputStream

maxTimeoutForCommand long

timeUnit TimeUnit

retryAttempts int

คิกรีเทิร์น
CommandResult

การโยน
DeviceNotAvailableException

executeShellV2Command

public CommandResult executeShellV2Command (String cmd, 
                File pipeAsInput, 
                OutputStream pipeToOutput, 
                OutputStream pipeToError, 
                long maxTimeoutForCommand, 
                TimeUnit timeUnit, 
                int retryAttempts)

พารามิเตอร์
cmd String

pipeAsInput File

pipeToOutput OutputStream

pipeToError OutputStream

maxTimeoutForCommand long

timeUnit TimeUnit

retryAttempts int

คิกรีเทิร์น
CommandResult

การโยน
DeviceNotAvailableException

fastbootWipePartition

public CommandResult fastbootWipePartition (String partition)

พารามิเตอร์
partition String

คิกรีเทิร์น
CommandResult

การโยน
DeviceNotAvailableException

getActiveApexes

public  getActiveApexes ()

คิกรีเทิร์น

การโยน
DeviceNotAvailableException

getAllSettings

public  getAllSettings (String namespace)

พารามิเตอร์
namespace String

คิกรีเทิร์น

การโยน
DeviceNotAvailableException

getAllocationState

public DeviceAllocationState getAllocationState ()

คิกรีเทิร์น
DeviceAllocationState

getAndroidId

public String getAndroidId (int userId)

พารามิเตอร์
userId int

คิกรีเทิร์น
String

การโยน
DeviceNotAvailableException

getAndroidIds

public  getAndroidIds ()

คิกรีเทิร์น

การโยน
DeviceNotAvailableException

getApiLevel

public int getApiLevel ()

คิกรีเทิร์น
int

การโยน
DeviceNotAvailableException

getAppPackageInfo

public PackageInfo getAppPackageInfo (String packageName)

พารามิเตอร์
packageName String

คิกรีเทิร์น
PackageInfo

การโยน
DeviceNotAvailableException

getAppPackageInfos

public  getAppPackageInfos ()

คิกรีเทิร์น

การโยน
DeviceNotAvailableException

getBasebandVersion

public String getBasebandVersion ()

คิกรีเทิร์น
String

การโยน
DeviceNotAvailableException

getBattery

public Integer getBattery ()

คิกรีเทิร์น
Integer

getBooleanProperty

public boolean getBooleanProperty (String name, 
                boolean defaultValue)

พารามิเตอร์
name String

defaultValue boolean

คิกรีเทิร์น
boolean

การโยน
DeviceNotAvailableException

getBootHistory

public  getBootHistory ()

คิกรีเทิร์น

การโยน
DeviceNotAvailableException

getBootHistorySince

public  getBootHistorySince (long utcEpochTime, 
                TimeUnit timeUnit)

พารามิเตอร์
utcEpochTime long

timeUnit TimeUnit

คิกรีเทิร์น

การโยน
DeviceNotAvailableException

getBootloaderVersion

public String getBootloaderVersion ()

คิกรีเทิร์น
String

การโยน
DeviceNotAvailableException

getBugreport

public InputStreamSource getBugreport ()

คิกรีเทิร์น
InputStreamSource

getBugreportz

public InputStreamSource getBugreportz ()

คิกรีเทิร์น
InputStreamSource

getBuildAlias

public String getBuildAlias ()

คิกรีเทิร์น
String

การโยน
DeviceNotAvailableException

getBuildFlavor

public String getBuildFlavor ()

คิกรีเทิร์น
String

การโยน
DeviceNotAvailableException

getBuildId

public String getBuildId ()

คิกรีเทิร์น
String

การโยน
DeviceNotAvailableException

getBuildSigningKeys

public String getBuildSigningKeys ()

คิกรีเทิร์น
String

การโยน
DeviceNotAvailableException

getCachedDeviceDescriptor

public DeviceDescriptor getCachedDeviceDescriptor ()

คิกรีเทิร์น
DeviceDescriptor

getChildren

public String[] getChildren (String path)

พารามิเตอร์
path String

คิกรีเทิร์น
String[]

การโยน
DeviceNotAvailableException

getCurrentFoldableState

public DeviceFoldableState getCurrentFoldableState ()

คิกรีเทิร์น
DeviceFoldableState

การโยน
DeviceNotAvailableException

getCurrentUser

public int getCurrentUser ()

คิกรีเทิร์น
int

การโยน
DeviceNotAvailableException

getDeviceClass

public String getDeviceClass ()

คิกรีเทิร์น
String

getDeviceDate

public long getDeviceDate ()

คิกรีเทิร์น
long

การโยน
DeviceNotAvailableException

getDeviceDescriptor

public DeviceDescriptor getDeviceDescriptor ()

คิกรีเทิร์น
DeviceDescriptor

getDeviceState

public TestDeviceState getDeviceState ()

คิกรีเทิร์น
TestDeviceState

getDeviceTimeOffset

public long getDeviceTimeOffset (Date date)

พารามิเตอร์
date Date

คิกรีเทิร์น
long

การโยน
DeviceNotAvailableException

getEmulatorOutput

public InputStreamSource getEmulatorOutput ()

คิกรีเทิร์น
InputStreamSource

getEmulatorProcess

public Process getEmulatorProcess ()

คิกรีเทิร์น
Process

getExecuteShellCommandLog

public final File getExecuteShellCommandLog ()

บันทึกที่มีบันทึก executeShellCommand(String) ทั้งหมด

คิกรีเทิร์น
File

getExternalStoreFreeSpace

public long getExternalStoreFreeSpace ()

คิกรีเทิร์น
long

การโยน
DeviceNotAvailableException

getFastbootPath

public String getFastbootPath ()

คิกรีเทิร์น
String

getFastbootProductType

public String getFastbootProductType ()

คิกรีเทิร์น
String

การโยน
DeviceNotAvailableException

getFastbootProductVariant

public String getFastbootProductVariant ()

คิกรีเทิร์น
String

การโยน
DeviceNotAvailableException

getFastbootSerialNumber

public String getFastbootSerialNumber ()

คิกรีเทิร์น
String

getFastbootVariable

public String getFastbootVariable (String variableName)

พารามิเตอร์
variableName String

คิกรีเทิร์น
String

การโยน
DeviceNotAvailableException

getFastbootVersion

public String getFastbootVersion ()

คิกรีเทิร์น
String

getFileEntry

public IFileEntry getFileEntry (String path)

พารามิเตอร์
path String

คิกรีเทิร์น
IFileEntry

การโยน
DeviceNotAvailableException

getFileEntry

public IFileEntry getFileEntry (FileListingService.FileEntry entry)

เครื่องมือช่วยที่ไม่เป็นทางการสำหรับรับ FileEntry จากเส้นทางที่ไม่ใช่รูท FIXME: ปรับโครงสร้างระบบ FileEntry เพื่อให้พร้อมใช้งานจากเส้นทางใดก็ได้ (แม้ไม่ใช่รูท)

พารามิเตอร์
entry FileListingService.FileEntry: FileEntry ไม่จำเป็นต้องเป็นรูทตามที่ Ddmlib กำหนด

คิกรีเทิร์น
IFileEntry FileEntryWrapper ที่แสดง FileEntry

การโยน
DeviceNotAvailableException

getFoldableStates

public  getFoldableStates ()

คิกรีเทิร์น

การโยน
DeviceNotAvailableException

getIDevice

public IDevice getIDevice ()

คิกรีเทิร์น
IDevice

getInstalledPackageNames

public  getInstalledPackageNames ()

คิกรีเทิร์น

การโยน
DeviceNotAvailableException

getIntProperty

public long getIntProperty (String name, 
                long defaultValue)

พารามิเตอร์
name String

defaultValue long

คิกรีเทิร์น
long

การโยน
DeviceNotAvailableException

getIpAddress

public String getIpAddress ()

คิกรีเทิร์น
String

การโยน
DeviceNotAvailableException

getKeyguardState

public KeyguardControllerState getKeyguardState ()

คิกรีเทิร์น
KeyguardControllerState

การโยน
DeviceNotAvailableException

getLastExpectedRebootTimeMillis

public long getLastExpectedRebootTimeMillis ()

คิกรีเทิร์น
long

getLaunchApiLevel

public int getLaunchApiLevel ()

คิกรีเทิร์น
int

การโยน
DeviceNotAvailableException

getLogcat

public InputStreamSource getLogcat ()

คิกรีเทิร์น
InputStreamSource

getLogcat

public InputStreamSource getLogcat (int maxBytes)

พารามิเตอร์
maxBytes int

คิกรีเทิร์น
InputStreamSource

getLogcatDump

public InputStreamSource getLogcatDump ()

คิกรีเทิร์น
InputStreamSource

getLogcatSince

public InputStreamSource getLogcatSince (long date)

พารามิเตอร์
date long

คิกรีเทิร์น
InputStreamSource

getMacAddress

public String getMacAddress ()

คิกรีเทิร์น
String

getMainlineModuleInfo

public  getMainlineModuleInfo ()

คิกรีเทิร์น

การโยน
DeviceNotAvailableException

getMaxNumberOfRunningUsersSupported

public int getMaxNumberOfRunningUsersSupported ()

คิกรีเทิร์น
int

การโยน
DeviceNotAvailableException

getMaxNumberOfUsersSupported

public int getMaxNumberOfUsersSupported ()

คิกรีเทิร์น
int

การโยน
DeviceNotAvailableException

getMonitor

public IDeviceStateMonitor getMonitor ()

คิกรีเทิร์น
IDeviceStateMonitor

getMountPoint

public String getMountPoint (String mountName)

พารามิเตอร์
mountName String

คิกรีเทิร์น
String

getMountPointInfo

public ITestDevice.MountPointInfo getMountPointInfo (String mountpoint)

พารามิเตอร์
mountpoint String

คิกรีเทิร์น
ITestDevice.MountPointInfo

การโยน
DeviceNotAvailableException

getMountPointInfo

public  getMountPointInfo ()

คิกรีเทิร์น

การโยน
DeviceNotAvailableException

getOptions

public TestDeviceOptions getOptions ()

คิกรีเทิร์น
TestDeviceOptions

getPartitionFreeSpace

public long getPartitionFreeSpace (String partition)

พารามิเตอร์
partition String

คิกรีเทิร์น
long

การโยน
DeviceNotAvailableException

getPrimaryUserId

public Integer getPrimaryUserId ()

คิกรีเทิร์น
Integer

การโยน
DeviceNotAvailableException

getProcessByName

public ProcessInfo getProcessByName (String processName)

พารามิเตอร์
processName String

คิกรีเทิร์น
ProcessInfo

การโยน
DeviceNotAvailableException

getProcessPid

public String getProcessPid (String process)

พารามิเตอร์
process String

คิกรีเทิร์น
String

การโยน
DeviceNotAvailableException

getProductType

public String getProductType ()

คิกรีเทิร์น
String

การโยน
DeviceNotAvailableException

getProductVariant

public String getProductVariant ()

คิกรีเทิร์น
String

การโยน
DeviceNotAvailableException

getProperty

public String getProperty (String name)

พารามิเตอร์
name String

คิกรีเทิร์น
String

การโยน
DeviceNotAvailableException

getRecoveryMode

public ITestDevice.RecoveryMode getRecoveryMode ()

คิกรีเทิร์น
ITestDevice.RecoveryMode

getScreenshot

public InputStreamSource getScreenshot (String format)

พารามิเตอร์
format String

คิกรีเทิร์น
InputStreamSource

การโยน
DeviceNotAvailableException

getScreenshot

public InputStreamSource getScreenshot (long displayId)

พารามิเตอร์
displayId long

คิกรีเทิร์น
InputStreamSource

การโยน
DeviceNotAvailableException

getScreenshot

public InputStreamSource getScreenshot (String format, 
                boolean rescale)

พารามิเตอร์
format String

rescale boolean

คิกรีเทิร์น
InputStreamSource

การโยน
DeviceNotAvailableException

getScreenshot

public InputStreamSource getScreenshot ()

คิกรีเทิร์น
InputStreamSource

การโยน
DeviceNotAvailableException

getSerialNumber

public String getSerialNumber ()

คิกรีเทิร์น
String

getSetting

public String getSetting (int userId, 
                String namespace, 
                String key)

พารามิเตอร์
userId int

namespace String

key String

คิกรีเทิร์น
String

การโยน
DeviceNotAvailableException

getSetting

public String getSetting (String namespace, 
                String key)

พารามิเตอร์
namespace String

key String

คิกรีเทิร์น
String

การโยน
DeviceNotAvailableException

getSimOperator

public String getSimOperator ()

คิกรีเทิร์น
String

getSimState

public String getSimState ()

คิกรีเทิร์น
String

getTombstones

public  getTombstones ()

คิกรีเทิร์น

การโยน
DeviceNotAvailableException

getTotalMemory

public long getTotalMemory ()

คิกรีเทิร์น
long

getUninstallablePackageNames

public  getUninstallablePackageNames ()

คิกรีเทิร์น

การโยน
DeviceNotAvailableException

getUseFastbootErase

public boolean getUseFastbootErase ()

คิกรีเทิร์น
boolean

getUserFlags

public int getUserFlags (int userId)

พารามิเตอร์
userId int

คิกรีเทิร์น
int

การโยน
DeviceNotAvailableException

getUserInfos

public  getUserInfos ()

คิกรีเทิร์น

การโยน
DeviceNotAvailableException

getUserSerialNumber

public int getUserSerialNumber (int userId)

พารามิเตอร์
userId int

คิกรีเทิร์น
int

การโยน
DeviceNotAvailableException

handleAllocationEvent

public IManagedTestDevice.DeviceEventResponse handleAllocationEvent (DeviceEvent event)

ประมวลผล DeviceEvent ซึ่งอาจเปลี่ยนสถานะอุปกรณ์นี้เป็นสถานะการจัดสรรใหม่หรือไม่ก็ได้

พารามิเตอร์
event DeviceEvent

คิกรีเทิร์น
IManagedTestDevice.DeviceEventResponse

hasFeature

public boolean hasFeature (String feature)

พารามิเตอร์
feature String

คิกรีเทิร์น
boolean

การโยน
DeviceNotAvailableException

installPackage

public String installPackage (File packageFile, 
                boolean reinstall, 
                String... extraArgs)

พารามิเตอร์
packageFile File

reinstall boolean

extraArgs String

คิกรีเทิร์น
String

การโยน
DeviceNotAvailableException

installPackage

public String installPackage (File packageFile, 
                boolean reinstall, 
                boolean grantPermissions, 
                String... extraArgs)

พารามิเตอร์
packageFile File

reinstall boolean

grantPermissions boolean

extraArgs String

คิกรีเทิร์น
String

การโยน
DeviceNotAvailableException

installPackageForUser

public String installPackageForUser (File packageFile, 
                boolean reinstall, 
                int userId, 
                String... extraArgs)

พารามิเตอร์
packageFile File

reinstall boolean

userId int

extraArgs String

คิกรีเทิร์น
String

การโยน
DeviceNotAvailableException

installPackageForUser

public String installPackageForUser (File packageFile, 
                boolean reinstall, 
                boolean grantPermissions, 
                int userId, 
                String... extraArgs)

พารามิเตอร์
packageFile File

reinstall boolean

grantPermissions boolean

userId int

extraArgs String

คิกรีเทิร์น
String

การโยน
DeviceNotAvailableException

isAdbRoot

public boolean isAdbRoot ()

คิกรีเทิร์น
boolean

การโยน
DeviceNotAvailableException

isAdbTcp

public boolean isAdbTcp ()

คิกรีเทิร์น
boolean

isAppEnumerationSupported

public boolean isAppEnumerationSupported ()

คิกรีเทิร์น
boolean

การโยน
DeviceNotAvailableException

isDeviceEncrypted

public boolean isDeviceEncrypted ()

คิกรีเทิร์น
boolean

การโยน
DeviceNotAvailableException

isDirectory

public boolean isDirectory (String path)

พารามิเตอร์
path String

คิกรีเทิร์น
boolean

การโยน
DeviceNotAvailableException

isEnableAdbRoot

public boolean isEnableAdbRoot ()

คิกรีเทิร์น
boolean true if adb root should be enabled on device

isEncryptionSupported

public boolean isEncryptionSupported ()

คิกรีเทิร์น
boolean

การโยน
DeviceNotAvailableException

isExecutable

public boolean isExecutable (String fullPath)

พารามิเตอร์
fullPath String

คิกรีเทิร์น
boolean

การโยน
DeviceNotAvailableException

isFastbootEnabled

public boolean isFastbootEnabled ()

คิกรีเทิร์น
boolean

isHeadless

public boolean isHeadless ()

คิกรีเทิร์น
boolean

การโยน
DeviceNotAvailableException

isMultiUserSupported

public boolean isMultiUserSupported ()

คิกรีเทิร์น
boolean

การโยน
DeviceNotAvailableException

isPackageInstalled

public boolean isPackageInstalled (String packageName, 
                String userId)

พารามิเตอร์
packageName String

userId String

คิกรีเทิร์น
boolean

การโยน
DeviceNotAvailableException

isPackageInstalled

public boolean isPackageInstalled (String packageName)

พารามิเตอร์
packageName String

คิกรีเทิร์น
boolean

การโยน
DeviceNotAvailableException

isRuntimePermissionSupported

public boolean isRuntimePermissionSupported ()

คิกรีเทิร์น
boolean

การโยน
DeviceNotAvailableException

isStateBootloaderOrFastbootd

public boolean isStateBootloaderOrFastbootd ()

คิกรีเทิร์น
boolean

isUserRunning

public boolean isUserRunning (int userId)

พารามิเตอร์
userId int

คิกรีเทิร์น
boolean

การโยน
DeviceNotAvailableException

isUserSecondary

public boolean isUserSecondary (int userId)

พารามิเตอร์
userId int

คิกรีเทิร์น
boolean

การโยน
DeviceNotAvailableException

isWifiEnabled

public boolean isWifiEnabled ()

คิกรีเทิร์น
boolean

การโยน
DeviceNotAvailableException

listDisplayIds

public  listDisplayIds ()

คิกรีเทิร์น

การโยน
DeviceNotAvailableException

listUsers

public  listUsers ()

คิกรีเทิร์น

การโยน
DeviceNotAvailableException

logBugreport

public boolean logBugreport (String dataName, 
                ITestLogger listener)

พารามิเตอร์
dataName String

listener ITestLogger

คิกรีเทิร์น
boolean

logOnDevice

public void logOnDevice (String tag, 
                Log.LogLevel level, 
                String format, 
                Object... args)

พารามิเตอร์
tag String

level Log.LogLevel

format String

args Object

nonBlockingReboot

public void nonBlockingReboot ()

การโยน
DeviceNotAvailableException

postAdbRootAction

public void postAdbRootAction ()

ลบล้างหากอุปกรณ์ต้องดำเนินการบางอย่างหลังจากการรูท adb และก่อนที่อุปกรณ์จะกลับมาออนไลน์อีกครั้ง การติดตั้งใช้งานเริ่มต้นจะไม่รวมการดำเนินการเพิ่มเติมใดๆ ไม่มีการรับประกันว่า adb root จะเปิดใช้ในขั้นตอนนี้

การโยน
DeviceNotAvailableException

postAdbUnrootAction

public void postAdbUnrootAction ()

ลบล้างหากอุปกรณ์ต้องดำเนินการบางอย่างหลังจาก adb ยกเลิกการรูทและก่อนที่อุปกรณ์จะกลับมาออนไลน์อีกครั้ง การติดตั้งใช้งานเริ่มต้นจะไม่รวมการดำเนินการเพิ่มเติมใดๆ เราไม่รับประกันว่าจะปิดใช้ adb root ในขั้นตอนนี้

การโยน
DeviceNotAvailableException

postBootSetup

public void postBootSetup ()

การโยน
DeviceNotAvailableException

postInvocationTearDown

public void postInvocationTearDown (Throwable exception)

พารามิเตอร์
exception Throwable

preInvocationSetup

public void preInvocationSetup (IBuildInfo info, 
                MultiMap<String, String> attributes)

พารามิเตอร์
info IBuildInfo

attributes MultiMap

การโยน
DeviceNotAvailableException
TargetSetupError

pullDir

public boolean pullDir (String deviceFilePath, 
                File localDir)

พารามิเตอร์
deviceFilePath String

localDir File

คิกรีเทิร์น
boolean

การโยน
DeviceNotAvailableException

pullFile

public boolean pullFile (String remoteFilePath, 
                File localFile)

พารามิเตอร์
remoteFilePath String

localFile File

คิกรีเทิร์น
boolean

การโยน
DeviceNotAvailableException

pullFile

public File pullFile (String remoteFilePath)

พารามิเตอร์
remoteFilePath String

คิกรีเทิร์น
File

การโยน
DeviceNotAvailableException

pullFileContents

public String pullFileContents (String remoteFilePath)

พารามิเตอร์
remoteFilePath String

คิกรีเทิร์น
String

การโยน
DeviceNotAvailableException

pullFileFromExternal

public File pullFileFromExternal (String remoteFilePath)

พารามิเตอร์
remoteFilePath String

คิกรีเทิร์น
File

การโยน
DeviceNotAvailableException

pushDir

public boolean pushDir (File localFileDir, 
                String deviceFilePath, 
                 excludedDirectories)

พารามิเตอร์
localFileDir File

deviceFilePath String

excludedDirectories

คิกรีเทิร์น
boolean

การโยน
DeviceNotAvailableException

pushDir

public boolean pushDir (File localFileDir, 
                String deviceFilePath)

พารามิเตอร์
localFileDir File

deviceFilePath String

คิกรีเทิร์น
boolean

การโยน
DeviceNotAvailableException

pushFile

public boolean pushFile (File localFile, 
                String remoteFilePath)

พารามิเตอร์
localFile File

remoteFilePath String

คิกรีเทิร์น
boolean

การโยน
DeviceNotAvailableException

pushString

public boolean pushString (String contents, 
                String remoteFilePath)

พารามิเตอร์
contents String

remoteFilePath String

คิกรีเทิร์น
boolean

การโยน
DeviceNotAvailableException

รีบูต

public void reboot (String reason)

พารามิเตอร์
reason String

การโยน
DeviceNotAvailableException

รีบูต

public void reboot ()

การโยน
DeviceNotAvailableException

rebootIntoBootloader

public void rebootIntoBootloader ()

การโยน
DeviceNotAvailableException

rebootIntoFastbootd

public void rebootIntoFastbootd ()

การโยน
DeviceNotAvailableException

rebootIntoRecovery

public void rebootIntoRecovery ()

การโยน
DeviceNotAvailableException

rebootIntoSideload

public void rebootIntoSideload ()

การโยน
DeviceNotAvailableException

rebootIntoSideload

public void rebootIntoSideload (boolean autoReboot)

พารามิเตอร์
autoReboot boolean

การโยน
DeviceNotAvailableException

rebootUntilOnline

public void rebootUntilOnline ()

การโยน
DeviceNotAvailableException

rebootUntilOnline

public void rebootUntilOnline (String reason)

พารามิเตอร์
reason String

การโยน
DeviceNotAvailableException

rebootUserspace

public void rebootUserspace ()

การโยน
DeviceNotAvailableException

rebootUserspaceUntilOnline

public void rebootUserspaceUntilOnline ()

การโยน
DeviceNotAvailableException

recoverDevice

public void recoverDevice ()

พยายามกู้คืนการสื่อสารของอุปกรณ์

การโยน
DeviceNotAvailableException หากอุปกรณ์ไม่พร้อมใช้งานแล้ว

remountSystemWritable

public void remountSystemWritable ()

การโยน
DeviceNotAvailableException

remountVendorWritable

public void remountVendorWritable ()

การโยน
DeviceNotAvailableException

removeAdmin

public boolean removeAdmin (String componentName, 
                int userId)

พารามิเตอร์
componentName String

userId int

คิกรีเทิร์น
boolean

การโยน
DeviceNotAvailableException

removeOwners

public void removeOwners ()

การโยน
DeviceNotAvailableException

removeUser

public boolean removeUser (int userId)

พารามิเตอร์
userId int

คิกรีเทิร์น
boolean

การโยน
DeviceNotAvailableException

resetContentProviderSetup

public void resetContentProviderSetup ()

รีเซ็ตการตั้งค่าผู้ให้บริการเนื้อหาเพื่อเรียกให้การตั้งค่าทำงานอีกครั้ง

runInstrumentationTests

public boolean runInstrumentationTests (IRemoteAndroidTestRunner runner, 
                ITestLifeCycleReceiver... listeners)

พารามิเตอร์
runner IRemoteAndroidTestRunner

listeners ITestLifeCycleReceiver

คิกรีเทิร์น
boolean

การโยน
DeviceNotAvailableException

runInstrumentationTests

public boolean runInstrumentationTests (IRemoteAndroidTestRunner runner, 
                 listeners)

พารามิเตอร์
runner IRemoteAndroidTestRunner

listeners

คิกรีเทิร์น
boolean

การโยน
DeviceNotAvailableException

runInstrumentationTestsAsUser

public boolean runInstrumentationTestsAsUser (IRemoteAndroidTestRunner runner, 
                int userId, 
                ITestLifeCycleReceiver... listeners)

พารามิเตอร์
runner IRemoteAndroidTestRunner

userId int

listeners ITestLifeCycleReceiver

คิกรีเทิร์น
boolean

การโยน
DeviceNotAvailableException

runInstrumentationTestsAsUser

public boolean runInstrumentationTestsAsUser (IRemoteAndroidTestRunner runner, 
                int userId, 
                 listeners)

พารามิเตอร์
runner IRemoteAndroidTestRunner

userId int

listeners

คิกรีเทิร์น
boolean

การโยน
DeviceNotAvailableException

setConfiguration

public void setConfiguration (IConfiguration configuration)

แทรก IConfiguration ที่ใช้อยู่

พารามิเตอร์
configuration IConfiguration

setDate

public void setDate (Date date)

พารามิเตอร์
date Date

การโยน
DeviceNotAvailableException

setDeviceOwner

public boolean setDeviceOwner (String componentName, 
                int userId)

พารามิเตอร์
componentName String

userId int

คิกรีเทิร์น
boolean

การโยน
DeviceNotAvailableException

setDeviceState

public void setDeviceState (TestDeviceState deviceState)

พารามิเตอร์
deviceState TestDeviceState

setEmulatorOutputStream

public void setEmulatorOutputStream (SizeLimitedOutputStream output)

สําหรับโปรแกรมจําลอง ให้ตั้งค่า SizeLimitedOutputStream เพื่อบันทึกเอาต์พุต

พารามิเตอร์
output SizeLimitedOutputStream: เพื่อบันทึกเอาต์พุต

setEmulatorProcess

public void setEmulatorProcess (Process p)

พารามิเตอร์
p Process

setFastbootEnabled

public void setFastbootEnabled (boolean fastbootEnabled)

พารามิเตอร์
fastbootEnabled boolean

setFastbootPath

public void setFastbootPath (String fastbootPath)

พารามิเตอร์
fastbootPath String

setIDevice

public void setIDevice (IDevice newDevice)

พารามิเตอร์
newDevice IDevice

setOptions

public void setOptions (TestDeviceOptions options)

พารามิเตอร์
options TestDeviceOptions

setProperty

public boolean setProperty (String propKey, 
                String propValue)

พารามิเตอร์
propKey String

propValue String

คิกรีเทิร์น
boolean

การโยน
DeviceNotAvailableException

setRecovery

public void setRecovery (IDeviceRecovery recovery)

พารามิเตอร์
recovery IDeviceRecovery

setRecoveryMode

public void setRecoveryMode (ITestDevice.RecoveryMode mode)

พารามิเตอร์
mode ITestDevice.RecoveryMode

setSetting

public void setSetting (String namespace, 
                String key, 
                String value)

พารามิเตอร์
namespace String

key String

value String

การโยน
DeviceNotAvailableException

setSetting

public void setSetting (int userId, 
                String namespace, 
                String key, 
                String value)

พารามิเตอร์
userId int

namespace String

key String

value String

การโยน
DeviceNotAvailableException

setUseFastbootErase

public void setUseFastbootErase (boolean useFastbootErase)

พารามิเตอร์
useFastbootErase boolean

startLogcat

public void startLogcat ()

startUser

public boolean startUser (int userId)

พารามิเตอร์
userId int

คิกรีเทิร์น
boolean

การโยน
DeviceNotAvailableException

startUser

public boolean startUser (int userId, 
                boolean waitFlag)

พารามิเตอร์
userId int

waitFlag boolean

คิกรีเทิร์น
boolean

การโยน
DeviceNotAvailableException

stopEmulatorOutput

public void stopEmulatorOutput ()

stopLogcat

public void stopLogcat ()

stopUser

public boolean stopUser (int userId)

พารามิเตอร์
userId int

คิกรีเทิร์น
boolean

การโยน
DeviceNotAvailableException

stopUser

public boolean stopUser (int userId, 
                boolean waitFlag, 
                boolean forceFlag)

พารามิเตอร์
userId int

waitFlag boolean

forceFlag boolean

คิกรีเทิร์น
boolean

การโยน
DeviceNotAvailableException

switchToAdbTcp

public String switchToAdbTcp ()

คิกรีเทิร์น
String

การโยน
DeviceNotAvailableException

switchToAdbUsb

public boolean switchToAdbUsb ()

คิกรีเทิร์น
boolean

การโยน
DeviceNotAvailableException

switchUser

public boolean switchUser (int userId)

พารามิเตอร์
userId int

คิกรีเทิร์น
boolean

การโยน
DeviceNotAvailableException

switchUser

public boolean switchUser (int userId, 
                long timeout)

พารามิเตอร์
userId int

timeout long

คิกรีเทิร์น
boolean

การโยน
DeviceNotAvailableException

syncFiles

public boolean syncFiles (File localFileDir, 
                String deviceFilePath)

พารามิเตอร์
localFileDir File

deviceFilePath String

คิกรีเทิร์น
boolean

การโยน
DeviceNotAvailableException

takeBugreport

public Bugreport takeBugreport ()

คิกรีเทิร์น
Bugreport

unencryptDevice

public boolean unencryptDevice ()

คิกรีเทิร์น
boolean

การโยน
DeviceNotAvailableException

uninstallPackage

public String uninstallPackage (String packageName)

พารามิเตอร์
packageName String

คิกรีเทิร์น
String

การโยน
DeviceNotAvailableException

uninstallPackageForUser

public String uninstallPackageForUser (String packageName, 
                int userId)

พารามิเตอร์
packageName String

userId int

คิกรีเทิร์น
String

การโยน
DeviceNotAvailableException

unlockDevice

public boolean unlockDevice ()

คิกรีเทิร์น
boolean

การโยน
DeviceNotAvailableException

waitForBootComplete

public boolean waitForBootComplete (long timeOut)

พารามิเตอร์
timeOut long

คิกรีเทิร์น
boolean

การโยน
DeviceNotAvailableException

waitForDeviceAvailable

public void waitForDeviceAvailable ()

การโยน
DeviceNotAvailableException

waitForDeviceAvailable

public void waitForDeviceAvailable (long waitTime)

พารามิเตอร์
waitTime long

การโยน
DeviceNotAvailableException

waitForDeviceInRecovery

public boolean waitForDeviceInRecovery (long waitTime)

พารามิเตอร์
waitTime long

คิกรีเทิร์น
boolean

waitForDeviceInSideload

public boolean waitForDeviceInSideload (long waitTime)

พารามิเตอร์
waitTime long

คิกรีเทิร์น
boolean

waitForDeviceNotAvailable

public boolean waitForDeviceNotAvailable (long waitTime)

พารามิเตอร์
waitTime long

คิกรีเทิร์น
boolean

waitForDeviceOnline

public void waitForDeviceOnline ()

การโยน
DeviceNotAvailableException

waitForDeviceOnline

public void waitForDeviceOnline (long waitTime)

พารามิเตอร์
waitTime long

การโยน
DeviceNotAvailableException

waitForDeviceShell

public boolean waitForDeviceShell (long waitTime)

พารามิเตอร์
waitTime long

คิกรีเทิร์น
boolean

วิธีการที่มีการป้องกัน

checkApiLevelAgainst

protected void checkApiLevelAgainst (String feature, 
                int strictMinLevel)

พารามิเตอร์
feature String

strictMinLevel int

createRebootDeviceAction

protected NativeDevice.RebootDeviceAction createRebootDeviceAction (NativeDevice.RebootMode rebootMode, 
                String reason)

สร้าง RebootDeviceAction เพื่อใช้เมื่อดำเนินการรีบูต

พารามิเตอร์
rebootMode NativeDevice.RebootMode: โหมดของการรีบูตนี้

reason String: สำหรับการรีบูตครั้งนี้

คิกรีเทิร์น
NativeDevice.RebootDeviceAction RebootDeviceAction ที่สร้างขึ้น

doAdbReboot

protected void doAdbReboot (NativeDevice.RebootMode rebootMode, 
                String reason)

รีบูต adb

พารามิเตอร์
rebootMode NativeDevice.RebootMode: โหมดของการรีบูตนี้

reason String: สำหรับการรีบูตครั้งนี้

การโยน
DeviceNotAvailableException

ensureRuntimePermissionSupported

protected void ensureRuntimePermissionSupported ()

เมธอดตัวช่วยที่จะแสดงข้อยกเว้นหากระบบไม่รองรับสิทธิ์รันไทม์

การโยน
DeviceNotAvailableException

getBugreportInternal

protected InputStreamSource getBugreportInternal ()

คิกรีเทิร์น
InputStreamSource

getBugreportzInternal

protected File getBugreportzInternal ()

วิธีการ Helper ภายในเพื่อรับไฟล์ ZIP ของ bugreportz เป็น ERROR(/File)

คิกรีเทิร์น
File

getRunUtil

protected IRunUtil getRunUtil ()

รับอินสแตนซ์ RunUtil เพื่อใช้งาน

คิกรีเทิร์น
IRunUtil

internalGetProperty

protected String internalGetProperty (String propName, 
                String fastbootVar, 
                String description)

ดึงข้อมูลพร็อพเพอร์ตี้ของอุปกรณ์จากแคช ddmlib โดยค่าเริ่มต้น และเปลี่ยนไปใช้ `adb shell getprop` หรือ `fastboot getvar` ขึ้นอยู่กับว่าอุปกรณ์อยู่ใน Fastboot หรือไม่

พารามิเตอร์
propName String: ชื่อพร็อพเพอร์ตี้ของอุปกรณ์ที่แสดงผลโดย `adb shell getprop`

fastbootVar String: ชื่อตัวแปร fastboot ที่เทียบเท่าที่จะค้นหา หากเป็น null ระบบจะไม่พยายามค้นหา fastboot

description String: คำอธิบายตัวแปรอย่างง่าย ใช้อักษรตัวพิมพ์ใหญ่กับอักษรตัวแรก

คิกรีเทิร์น
String สตริงที่อาจเป็น null หรือว่างเปล่าซึ่งมีค่าของพร็อพเพอร์ตี้ที่ระบุ

การโยน
DeviceNotAvailableException

isNewer

protected boolean isNewer (File localFile, 
                IFileEntry entry)

แสดงผล true หากไฟล์ในเครื่องใหม่กว่าไฟล์ระยะไกล IFileEntry ถูกต้องจนถึงนาที หากมีเวลาเท่ากัน ระบบจะถือว่าไฟล์ใหม่กว่า

พารามิเตอร์
localFile File

entry IFileEntry

คิกรีเทิร์น
boolean

performDeviceAction

protected boolean performDeviceAction (String actionDescription, 
                com.android.tradefed.device.NativeDevice.DeviceAction action, 
                int retryAttempts)

ดำเนินการในอุปกรณ์นี้ พยายามกู้คืนอุปกรณ์และอาจลองใช้คำสั่งอีกครั้งหากการดำเนินการไม่สำเร็จ

พารามิเตอร์
actionDescription String: คำอธิบายสั้นๆ ของการดำเนินการที่จะทำ ใช้เพื่อวัตถุประสงค์ในการบันทึกเท่านั้น

action com.android.tradefed.device.NativeDevice.DeviceAction: การดำเนินการที่จะทำ

retryAttempts int: การพยายามดำเนินการอีกครั้งหากการดำเนินการไม่สำเร็จแต่การกู้คืนสำเร็จ

คิกรีเทิร์น
boolean true หากดำเนินการสำเร็จ

การโยน
DeviceNotAvailableException if recovery attempt fails or max attempts done without success

postAdbReboot

protected void postAdbReboot ()

การดำเนินการเพิ่มเติมที่ทำได้หลังจากรีบูต

การโยน
DeviceNotAvailableException

prePostBootSetup

protected void prePostBootSetup ()

อนุญาตให้อุปกรณ์แต่ละประเภท (AndroidNativeDevice, TestDevice) ลบล้างวิธีการนี้สำหรับการตั้งค่าหลังการบูตที่เฉพาะเจาะจง

การโยน
DeviceNotAvailableException

setClock

protected void setClock (Clock clock)

ตั้งค่าอินสแตนซ์นาฬิกาที่จะใช้

พารามิเตอร์
clock Clock

setLogStartDelay

protected void setLogStartDelay (int delay)

ตั้งค่าเวลาเป็นมิลลิวินาทีที่จะรอก่อนที่จะเริ่มการบันทึก Logcat สําหรับอุปกรณ์ออนไลน์

พารามิเตอร์
delay int: การหน่วงเวลาเป็นมิลลิวินาที

waitForDeviceNotAvailable

protected void waitForDeviceNotAvailable (String operationDesc, 
                long time)

พารามิเตอร์
operationDesc String

time long