คลาสที่ซ้อนกัน class
NativeDevice.AdbAction
DeviceAction
สำหรับการรันคำสั่ง 'adb ....' ของระบบปฏิบัติการ
class
NativeDevice.AdbShellAction
class
NativeDevice.RebootDeviceAction
DeviceAction
สำหรับการรีบูตอุปกรณ์
enum
NativeDevice.RebootMode
โหมดการรีบูต
วิธีการสาธารณะ 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)
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)
runInstrumentationTests (IRemoteAndroidTestRunner runner, listeners)
boolean
runInstrumentationTestsAsUser (IRemoteAndroidTestRunner runner, int userId, ITestLifeCycleReceiver... listeners)
boolean
runInstrumentationTestsAsUser (IRemoteAndroidTestRunner runner, int userId, listeners)
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 ()
เมธอด Internal 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 ค่าที่ส่งคืนสำหรับ 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
ขว้าง DeviceNotAvailableException
ตรวจสอบการเชื่อมต่อ
public boolean checkConnectivity ()
ขว้าง DeviceNotAvailableException
clearErrorDialogs
public boolean clearErrorDialogs ()
ขว้าง DeviceNotAvailableException
clearLastConnectedWifiNetwork
public void clearLastConnectedWifiNetwork ()
clearLogcat
public void clearLogcat ()
connectToWifiNetwork
public boolean connectToWifiNetwork (String wifiSsid,
String wifiPsk)
พารามิเตอร์ wifiSsid
String
wifiPsk
String
ขว้าง DeviceNotAvailableException
connectToWifiNetwork
public boolean connectToWifiNetwork (String wifiSsid,
String wifiPsk,
boolean scanSsid)
พารามิเตอร์ wifiSsid
String
wifiPsk
String
scanSsid
boolean
ขว้าง DeviceNotAvailableException
connectToWifiNetworkIfNeeded
public boolean connectToWifiNetworkIfNeeded (String wifiSsid,
String wifiPsk,
boolean scanSsid)
พารามิเตอร์ wifiSsid
String
wifiPsk
String
scanSsid
boolean
ขว้าง DeviceNotAvailableException
connectToWifiNetworkIfNeeded
public boolean connectToWifiNetworkIfNeeded (String wifiSsid,
String wifiPsk)
พารามิเตอร์ wifiSsid
String
wifiPsk
String
ขว้าง DeviceNotAvailableException
createUser
public int createUser (String name,
boolean guest,
boolean ephemeral)
พารามิเตอร์ name
String
guest
boolean
ephemeral
boolean
ขว้าง DeviceNotAvailableException
createUser
public int createUser (String name)
ขว้าง DeviceNotAvailableException
createUserNoThrow
public int createUserNoThrow (String name)
ขว้าง DeviceNotAvailableException
ลบไฟล์
public void deleteFile (String deviceFilePath)
พารามิเตอร์ deviceFilePath
String
ขว้าง DeviceNotAvailableException
อุปกรณ์SoftRestarted
public boolean deviceSoftRestarted (ProcessInfo prevSystemServerProcess)
พารามิเตอร์ prevSystemServerProcess
ProcessInfo
ขว้าง DeviceNotAvailableException
อุปกรณ์SoftRestartedตั้งแต่
public boolean deviceSoftRestartedSince (long utcEpochTime,
TimeUnit timeUnit)
พารามิเตอร์ utcEpochTime
long
timeUnit
TimeUnit
ขว้าง DeviceNotAvailableException
ปิดการใช้งานAdbRoot
public boolean disableAdbRoot ()
ขว้าง DeviceNotAvailableException
ปิดการใช้งานKeyguard
public void disableKeyguard ()
ขว้าง DeviceNotAvailableException
ปิดใช้งานNetworkMonitor
public boolean disableNetworkMonitor ()
ขว้าง DeviceNotAvailableException
ตัดการเชื่อมต่อจากWifi
public boolean disconnectFromWifi ()
ขว้าง DeviceNotAvailableException
ไม่FileExist
public boolean doesFileExist (String deviceFilePath)
พารามิเตอร์ deviceFilePath
String
ขว้าง DeviceNotAvailableException
dumpHeap
public File dumpHeap (String process,
String devicePath)
พารามิเตอร์ process
String
devicePath
String
ขว้าง DeviceNotAvailableException
เปิดใช้งานAdbRoot
public boolean enableAdbRoot ()
ขว้าง DeviceNotAvailableException
enableNetworkMonitor
public boolean enableNetworkMonitor ()
ขว้าง DeviceNotAvailableException
เข้ารหัสอุปกรณ์
public boolean encryptDevice (boolean inplace)
พารามิเตอร์ inplace
boolean
ขว้าง DeviceNotAvailableException
รันAdbCommand
public String executeAdbCommand (long timeout,
String... cmdArgs)
พารามิเตอร์ timeout
long
cmdArgs
String
ขว้าง DeviceNotAvailableException
รันAdbCommand
public String executeAdbCommand (String... cmdArgs)
พารามิเตอร์ cmdArgs
String
ขว้าง DeviceNotAvailableException
ดำเนินการFastbootCommand
public CommandResult executeFastbootCommand (String... cmdArgs)
พารามิเตอร์ cmdArgs
String
ขว้าง DeviceNotAvailableException
ดำเนินการFastbootCommand
public CommandResult executeFastbootCommand (long timeout,
String... cmdArgs)
พารามิเตอร์ timeout
long
cmdArgs
String
ขว้าง DeviceNotAvailableException
รันLongFastbootCommand
public CommandResult executeLongFastbootCommand (String... cmdArgs)
พารามิเตอร์ cmdArgs
String
ขว้าง DeviceNotAvailableException
executeShellCommand
public String executeShellCommand (String command)
พารามิเตอร์ command
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)
ขว้าง DeviceNotAvailableException
executeShellV2Command
public CommandResult executeShellV2Command (String cmd,
OutputStream pipeToOutput)
พารามิเตอร์ cmd
String
pipeToOutput
OutputStream
ขว้าง DeviceNotAvailableException
executeShellV2Command
public CommandResult executeShellV2Command (String cmd,
File pipeAsInput)
พารามิเตอร์ cmd
String
pipeAsInput
File
ขว้าง DeviceNotAvailableException
executeShellV2Command
public CommandResult executeShellV2Command (String cmd,
long maxTimeoutForCommand,
TimeUnit timeUnit,
int retryAttempts)
พารามิเตอร์ cmd
String
maxTimeoutForCommand
long
timeUnit
TimeUnit
retryAttempts
int
ขว้าง DeviceNotAvailableException
executeShellV2Command
public CommandResult executeShellV2Command (String cmd,
long maxTimeoutForCommand,
TimeUnit timeUnit)
พารามิเตอร์ cmd
String
maxTimeoutForCommand
long
timeUnit
TimeUnit
ขว้าง 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
ขว้าง 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
ขว้าง DeviceNotAvailableException
fastbootWipePartition
public CommandResult fastbootWipePartition (String partition)
พารามิเตอร์ partition
String
ขว้าง DeviceNotAvailableException
getActiveApexes
public getActiveApexes ()
ขว้าง DeviceNotAvailableException
getAllSettings
public getAllSettings (String namespace)
พารามิเตอร์ namespace
String
ขว้าง DeviceNotAvailableException
getAllocationState
public DeviceAllocationState getAllocationState ()
คืนสินค้า DeviceAllocationState
getAndroidId
public String getAndroidId (int userId)
ขว้าง DeviceNotAvailableException
getAndroidIds
public getAndroidIds ()
ขว้าง DeviceNotAvailableException
getApiLevel
public int getApiLevel ()
ขว้าง DeviceNotAvailableException
getAppPackageInfo
public PackageInfo getAppPackageInfo (String packageName)
พารามิเตอร์ packageName
String
ขว้าง DeviceNotAvailableException
getAppPackageInfos
public getAppPackageInfos ()
ขว้าง DeviceNotAvailableException
getBasebandVersion
public String getBasebandVersion ()
ขว้าง DeviceNotAvailableException
รับแบตเตอรี่
public Integer getBattery ()
getBooleanProperty
public boolean getBooleanProperty (String name,
boolean defaultValue)
พารามิเตอร์ name
String
defaultValue
boolean
ขว้าง DeviceNotAvailableException
getBootHistory
public getBootHistory ()
ขว้าง DeviceNotAvailableException
getBootHistoryตั้งแต่
public getBootHistorySince (long utcEpochTime,
TimeUnit timeUnit)
พารามิเตอร์ utcEpochTime
long
timeUnit
TimeUnit
ขว้าง DeviceNotAvailableException
getBootloaderVersion
public String getBootloaderVersion ()
ขว้าง DeviceNotAvailableException
getBugreport
public InputStreamSource getBugreport ()
คืนสินค้า InputStreamSource
getBugreportz
public InputStreamSource getBugreportz ()
คืนสินค้า InputStreamSource
getBuildAlias
public String getBuildAlias ()
ขว้าง DeviceNotAvailableException
getBuildFlavor
public String getBuildFlavor ()
ขว้าง DeviceNotAvailableException
getBuildId
public String getBuildId ()
ขว้าง DeviceNotAvailableException
getBuildSigningKeys
public String getBuildSigningKeys ()
ขว้าง DeviceNotAvailableException
getCachedDeviceDescriptor
public DeviceDescriptor getCachedDeviceDescriptor ()
คืนสินค้า DeviceDescriptor
รับเด็ก
public String[] getChildren (String path)
ขว้าง DeviceNotAvailableException
getCurrentFoldableState
public DeviceFoldableState getCurrentFoldableState ()
คืนสินค้า DeviceFoldableState
ขว้าง DeviceNotAvailableException
getCurrentUser
public int getCurrentUser ()
ขว้าง DeviceNotAvailableException
getDeviceClass
public String getDeviceClass ()
getDeviceDate
public long getDeviceDate ()
ขว้าง DeviceNotAvailableException
getDeviceDescriptor
public DeviceDescriptor getDeviceDescriptor ()
คืนสินค้า DeviceDescriptor
getDeviceState
public TestDeviceState getDeviceState ()
คืนสินค้า TestDeviceState
getDeviceTimeOffset
public long getDeviceTimeOffset (Date date)
ขว้าง DeviceNotAvailableException
getEmulatorOutput
public InputStreamSource getEmulatorOutput ()
คืนสินค้า InputStreamSource
getEmulatorProcess
public Process getEmulatorProcess ()
getExternalStoreFreeSpace
public long getExternalStoreFreeSpace ()
ขว้าง DeviceNotAvailableException
getFastbootPath
public String getFastbootPath ()
getFastbootProductType
public String getFastbootProductType ()
ขว้าง DeviceNotAvailableException
getFastbootProductVariant
public String getFastbootProductVariant ()
ขว้าง DeviceNotAvailableException
getFastbootSerialNumber
public String getFastbootSerialNumber ()
getFastbootVariable
public String getFastbootVariable (String variableName)
พารามิเตอร์ variableName
String
ขว้าง DeviceNotAvailableException
getFastbootVersion
public String getFastbootVersion ()
getFileEntry
public IFileEntry getFileEntry (String path)
ขว้าง DeviceNotAvailableException
getFileEntry
public IFileEntry getFileEntry (FileListingService.FileEntry entry) ผู้ช่วยที่ไม่เป็นทางการเพื่อรับ FileEntry
จากเส้นทางที่ไม่ใช่รูท แก้ไข: ปรับโครงสร้างระบบ FileEntry ใหม่เพื่อให้พร้อมใช้งานจากเส้นทางใดก็ได้ (แม้จะไม่ใช่รูทก็ตาม)
พารามิเตอร์ entry
FileEntry
FileListingService.FileEntry
จำเป็นต้องรูทตามที่ Ddmlib ต้องการ
ขว้าง DeviceNotAvailableException
getFoldableStates
public getFoldableStates ()
ขว้าง DeviceNotAvailableException
getIDevice
public IDevice getIDevice ()
getInstalledPackageNames
public getInstalledPackageNames ()
ขว้าง DeviceNotAvailableException
getIntProperty
public long getIntProperty (String name,
long defaultValue)
พารามิเตอร์ name
String
defaultValue
long
ขว้าง DeviceNotAvailableException
getIpAddress
public String getIpAddress ()
ขว้าง DeviceNotAvailableException
getKeyguardState
public KeyguardControllerState getKeyguardState ()
คืนสินค้า KeyguardControllerState
ขว้าง DeviceNotAvailableException
getLastExpectedRebootTimeMillis
public long getLastExpectedRebootTimeMillis ()
getLaunchApiLevel
public int getLaunchApiLevel ()
ขว้าง DeviceNotAvailableException
getLogcat
public InputStreamSource getLogcat ()
คืนสินค้า InputStreamSource
getLogcat
public InputStreamSource getLogcat (int maxBytes)
คืนสินค้า InputStreamSource
getLogcatDump
public InputStreamSource getLogcatDump ()
คืนสินค้า InputStreamSource
getLogcatตั้งแต่
public InputStreamSource getLogcatSince (long date)
คืนสินค้า InputStreamSource
getMacAddress
public String getMacAddress ()
getMainlineModuleInfo
public getMainlineModuleInfo ()
ขว้าง DeviceNotAvailableException
public int getMaxNumberOfRunningUsersSupported ()
ขว้าง DeviceNotAvailableException
public int getMaxNumberOfUsersSupported ()
ขว้าง DeviceNotAvailableException
getMonitor
public IDeviceStateMonitor getMonitor ()
คืนสินค้า IDeviceStateMonitor
getMountPoint
public String getMountPoint (String mountName)
พารามิเตอร์ mountName
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
ขว้าง DeviceNotAvailableException
getPrimaryUserId
public Integer getPrimaryUserId ()
ขว้าง DeviceNotAvailableException
getProcessByName
public ProcessInfo getProcessByName (String processName)
พารามิเตอร์ processName
String
ขว้าง DeviceNotAvailableException
getProcessPid
public String getProcessPid (String process)
พารามิเตอร์ process
String
ขว้าง DeviceNotAvailableException
getProductType
public String getProductType ()
ขว้าง DeviceNotAvailableException
getProductVariant
public String getProductVariant ()
ขว้าง DeviceNotAvailableException
getProperty
public String getProperty (String name)
ขว้าง DeviceNotAvailableException
getRecoveryMode
public ITestDevice.RecoveryMode getRecoveryMode ()
คืนสินค้า ITestDevice.RecoveryMode
รับสกรีนช็อต
public InputStreamSource getScreenshot (String format)
พารามิเตอร์ format
String
คืนสินค้า InputStreamSource
ขว้าง DeviceNotAvailableException
รับสกรีนช็อต
public InputStreamSource getScreenshot (long displayId)
พารามิเตอร์ displayId
long
คืนสินค้า InputStreamSource
ขว้าง DeviceNotAvailableException
รับสกรีนช็อต
public InputStreamSource getScreenshot (String format,
boolean rescale)
พารามิเตอร์ format
String
rescale
boolean
คืนสินค้า InputStreamSource
ขว้าง DeviceNotAvailableException
รับสกรีนช็อต
public InputStreamSource getScreenshot ()
คืนสินค้า InputStreamSource
ขว้าง DeviceNotAvailableException
getSerialNumber
public String getSerialNumber ()
รับการตั้งค่า
public String getSetting (int userId,
String namespace,
String key)
พารามิเตอร์ userId
int
namespace
String
key
String
ขว้าง DeviceNotAvailableException
รับการตั้งค่า
public String getSetting (String namespace,
String key)
พารามิเตอร์ namespace
String
key
String
ขว้าง DeviceNotAvailableException
getSimOperator
public String getSimOperator ()
getSimState
public String getSimState ()
getTombstones
public getTombstones ()
ขว้าง DeviceNotAvailableException
getTotalMemory
public long getTotalMemory ()
getUninstallablePackageNames
public getUninstallablePackageNames ()
ขว้าง DeviceNotAvailableException
getUseFastbootErase
public boolean getUseFastbootErase ()
getUserFlags
public int getUserFlags (int userId)
ขว้าง DeviceNotAvailableException
getUserInfos
public getUserInfos ()
ขว้าง DeviceNotAvailableException
getUserSerialNumber
public int getUserSerialNumber (int userId)
ขว้าง DeviceNotAvailableException
จัดการAllocationEvent
public IManagedTestDevice.DeviceEventResponse handleAllocationEvent (DeviceEvent event)
ประมวลผล DeviceEvent ซึ่งอาจหรือไม่อาจเปลี่ยนอุปกรณ์นี้เป็นสถานะการจัดสรรใหม่
พารามิเตอร์ event
DeviceEvent
คืนสินค้า IManagedTestDevice.DeviceEventResponse
มีคุณสมบัติ
public boolean hasFeature (String feature)
พารามิเตอร์ feature
String
ขว้าง DeviceNotAvailableException
ติดตั้งแพ็คเกจ
public String installPackage (File packageFile,
boolean reinstall,
String... extraArgs)
พารามิเตอร์ packageFile
File
reinstall
boolean
extraArgs
String
ขว้าง DeviceNotAvailableException
ติดตั้งแพ็คเกจ
public String installPackage (File packageFile,
boolean reinstall,
boolean grantPermissions,
String... extraArgs)
พารามิเตอร์ packageFile
File
reinstall
boolean
grantPermissions
boolean
extraArgs
String
ขว้าง DeviceNotAvailableException
installPackageForUser
public String installPackageForUser (File packageFile,
boolean reinstall,
int userId,
String... extraArgs)
พารามิเตอร์ packageFile
File
reinstall
boolean
userId
int
extraArgs
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
ขว้าง DeviceNotAvailableException
isAdbRoot
public boolean isAdbRoot ()
ขว้าง DeviceNotAvailableException
isAdbTcp
public boolean isAdbTcp ()
isAppEnumerationได้รับการสนับสนุน
public boolean isAppEnumerationSupported ()
ขว้าง DeviceNotAvailableException
isDeviceEncrypted
public boolean isDeviceEncrypted ()
ขว้าง DeviceNotAvailableException
isDirectory
public boolean isDirectory (String path)
ขว้าง DeviceNotAvailableException
isEnableAdbRoot
public boolean isEnableAdbRoot ()
คืนสินค้า boolean
true
หากควรเปิดใช้งานรูท adb บนอุปกรณ์
isEncryptionSupported
public boolean isEncryptionSupported ()
ขว้าง DeviceNotAvailableException
isExecutable
public boolean isExecutable (String fullPath)
พารามิเตอร์ fullPath
String
ขว้าง DeviceNotAvailableException
isFastbootEnabled
public boolean isFastbootEnabled ()
เป็นหัวขาด
public boolean isHeadless ()
ขว้าง DeviceNotAvailableException
isMultiUserSupported
public boolean isMultiUserSupported ()
ขว้าง DeviceNotAvailableException
isPackageInstalled
public boolean isPackageInstalled (String packageName,
String userId)
พารามิเตอร์ packageName
String
userId
String
ขว้าง DeviceNotAvailableException
isPackageInstalled
public boolean isPackageInstalled (String packageName)
พารามิเตอร์ packageName
String
ขว้าง DeviceNotAvailableException
isRuntimePermissionSupported
public boolean isRuntimePermissionSupported ()
ขว้าง DeviceNotAvailableException
isStateBootloaderOrFastbootd
public boolean isStateBootloaderOrFastbootd ()
isUserRunning
public boolean isUserRunning (int userId)
ขว้าง DeviceNotAvailableException
isUserSecondary
public boolean isUserSecondary (int userId)
ขว้าง DeviceNotAvailableException
isWifiEnabled
public boolean isWifiEnabled ()
ขว้าง DeviceNotAvailableException
listDisplayIds
public listDisplayIds ()
ขว้าง DeviceNotAvailableException
รายการผู้ใช้
public listUsers ()
ขว้าง DeviceNotAvailableException
logBugreport
public boolean logBugreport (String dataName,
ITestLogger listener)
พารามิเตอร์ dataName
String
listener
ITestLogger
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
ดึงDir
public boolean pullDir (String deviceFilePath,
File localDir)
พารามิเตอร์ deviceFilePath
String
localDir
File
ขว้าง DeviceNotAvailableException
pullFile
public boolean pullFile (String remoteFilePath,
File localFile)
พารามิเตอร์ remoteFilePath
String
localFile
File
ขว้าง DeviceNotAvailableException
pullFile
public File pullFile (String remoteFilePath)
พารามิเตอร์ remoteFilePath
String
ขว้าง DeviceNotAvailableException
pullFileContents
public String pullFileContents (String remoteFilePath)
พารามิเตอร์ remoteFilePath
String
ขว้าง DeviceNotAvailableException
pullFileFromExternal
public File pullFileFromExternal (String remoteFilePath)
พารามิเตอร์ remoteFilePath
String
ขว้าง DeviceNotAvailableException
pushDir
public boolean pushDir (File localFileDir,
String deviceFilePath,
excludedDirectories)
พารามิเตอร์ localFileDir
File
deviceFilePath
String
excludedDirectories
ขว้าง DeviceNotAvailableException
pushDir
public boolean pushDir (File localFileDir,
String deviceFilePath)
พารามิเตอร์ localFileDir
File
deviceFilePath
String
ขว้าง DeviceNotAvailableException
pushFile
public boolean pushFile (File localFile,
String remoteFilePath)
พารามิเตอร์ localFile
File
remoteFilePath
String
ขว้าง DeviceNotAvailableException
pushString
public boolean pushString (String contents,
String remoteFilePath)
พารามิเตอร์ contents
String
remoteFilePath
String
ขว้าง DeviceNotAvailableException
รีบูต
public void reboot (String reason)
พารามิเตอร์ reason
String
ขว้าง DeviceNotAvailableException
รีบูต
public void reboot ()
ขว้าง DeviceNotAvailableException
rebootIntoBootloader
public void rebootIntoBootloader ()
ขว้าง DeviceNotAvailableException
rebootIntoFastbootd
public void rebootIntoFastbootd ()
ขว้าง DeviceNotAvailableException
รีบูตเข้าสู่การกู้คืน
public void rebootIntoRecovery ()
ขว้าง DeviceNotAvailableException
rebootIntoSideload
public void rebootIntoSideload ()
ขว้าง DeviceNotAvailableException
rebootIntoSideload
public void rebootIntoSideload (boolean autoReboot)
พารามิเตอร์ autoReboot
boolean
ขว้าง DeviceNotAvailableException
รีบูตจนกว่าจะออนไลน์
public void rebootUntilOnline ()
ขว้าง DeviceNotAvailableException
รีบูตจนกว่าจะออนไลน์
public void rebootUntilOnline (String reason)
พารามิเตอร์ reason
String
ขว้าง DeviceNotAvailableException
รีบูตUserspace
public void rebootUserspace ()
ขว้าง DeviceNotAvailableException
rebootUserspaceUntilOnline
public void rebootUserspaceUntilOnline ()
ขว้าง DeviceNotAvailableException
กู้คืนอุปกรณ์
public void recoverDevice () ความพยายามที่จะกู้คืนการสื่อสารของอุปกรณ์
ขว้าง DeviceNotAvailableException
หากอุปกรณ์ไม่พร้อมใช้งานอีกต่อไป
remountSystemWritable
public void remountSystemWritable ()
ขว้าง DeviceNotAvailableException
remountVendorเขียนได้
public void remountVendorWritable ()
ขว้าง DeviceNotAvailableException
ลบผู้ดูแลระบบ
public boolean removeAdmin (String componentName,
int userId)
พารามิเตอร์ componentName
String
userId
int
ขว้าง DeviceNotAvailableException
ลบเจ้าของ
public void removeOwners ()
ขว้าง DeviceNotAvailableException
ลบUser
public boolean removeUser (int userId)
ขว้าง DeviceNotAvailableException
resetContentProviderSetup
public void resetContentProviderSetup () รีเซ็ตการตั้งค่าสถานะสำหรับการตั้งค่าผู้ให้บริการเนื้อหาเพื่อทริกเกอร์อีกครั้ง
runInstrumentationTests
public boolean runInstrumentationTests (IRemoteAndroidTestRunner runner,
ITestLifeCycleReceiver... listeners)
พารามิเตอร์ runner
IRemoteAndroidTestRunner
listeners
ITestLifeCycleReceiver
ขว้าง DeviceNotAvailableException
runInstrumentationTests
public boolean runInstrumentationTests (IRemoteAndroidTestRunner runner,
listeners)
พารามิเตอร์ runner
IRemoteAndroidTestRunner
listeners
ขว้าง DeviceNotAvailableException
runInstrumentationTestsAsUser
public boolean runInstrumentationTestsAsUser (IRemoteAndroidTestRunner runner,
int userId,
ITestLifeCycleReceiver... listeners)
พารามิเตอร์ runner
IRemoteAndroidTestRunner
userId
int
listeners
ITestLifeCycleReceiver
ขว้าง DeviceNotAvailableException
runInstrumentationTestsAsUser
public boolean runInstrumentationTestsAsUser (IRemoteAndroidTestRunner runner,
int userId,
listeners)
พารามิเตอร์ runner
IRemoteAndroidTestRunner
userId
int
listeners
ขว้าง DeviceNotAvailableException
setConfiguration
public void setConfiguration (IConfiguration configuration) IConfiguration
ที่ใช้งานอยู่
พารามิเตอร์ configuration
IConfiguration
setDate
public void setDate (Date date)
ขว้าง DeviceNotAvailableException
setDeviceOwner
public boolean setDeviceOwner (String componentName,
int userId)
พารามิเตอร์ componentName
String
userId
int
ขว้าง DeviceNotAvailableException
setDeviceState
public void setDeviceState (TestDeviceState deviceState)
พารามิเตอร์ deviceState
TestDeviceState
setEmulatorProcess
public void setEmulatorProcess (Process p)
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
ขว้าง 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)
ขว้าง DeviceNotAvailableException
startUser
public boolean startUser (int userId,
boolean waitFlag)
พารามิเตอร์ userId
int
waitFlag
boolean
ขว้าง DeviceNotAvailableException
stopEmulatorOutput
public void stopEmulatorOutput ()
หยุดLogcat
public void stopLogcat ()
หยุดผู้ใช้
public boolean stopUser (int userId)
ขว้าง DeviceNotAvailableException
หยุดผู้ใช้
public boolean stopUser (int userId,
boolean waitFlag,
boolean forceFlag)
พารามิเตอร์ userId
int
waitFlag
boolean
forceFlag
boolean
ขว้าง DeviceNotAvailableException
switchToAdbTcp
public String switchToAdbTcp ()
ขว้าง DeviceNotAvailableException
switchToAdbUsb
public boolean switchToAdbUsb ()
ขว้าง DeviceNotAvailableException
เปลี่ยนผู้ใช้
public boolean switchUser (int userId)
ขว้าง DeviceNotAvailableException
เปลี่ยนผู้ใช้
public boolean switchUser (int userId,
long timeout)
พารามิเตอร์ userId
int
timeout
long
ขว้าง DeviceNotAvailableException
syncFiles
public boolean syncFiles (File localFileDir,
String deviceFilePath)
พารามิเตอร์ localFileDir
File
deviceFilePath
String
ขว้าง DeviceNotAvailableException
takeBugreport
public Bugreport takeBugreport ()
unencryptDevice
public boolean unencryptDevice ()
ขว้าง DeviceNotAvailableException
ถอนการติดตั้งPackage
public String uninstallPackage (String packageName)
พารามิเตอร์ packageName
String
ขว้าง DeviceNotAvailableException
ถอนการติดตั้งPackageForUser
public String uninstallPackageForUser (String packageName,
int userId)
พารามิเตอร์ packageName
String
userId
int
ขว้าง DeviceNotAvailableException
ปลดล็อคอุปกรณ์
public boolean unlockDevice ()
ขว้าง DeviceNotAvailableException
waitForBootComplete
public boolean waitForBootComplete (long timeOut)
ขว้าง DeviceNotAvailableException
waitForDeviceAvailable
public void waitForDeviceAvailable ()
ขว้าง DeviceNotAvailableException
waitForDeviceAvailable
public void waitForDeviceAvailable (long waitTime)
พารามิเตอร์ waitTime
long
ขว้าง DeviceNotAvailableException
waitForDeviceInRecovery
public boolean waitForDeviceInRecovery (long waitTime)
พารามิเตอร์ waitTime
long
waitForDeviceInSideload
public boolean waitForDeviceInSideload (long waitTime)
พารามิเตอร์ waitTime
long
waitForDeviceNotAvailable
public boolean waitForDeviceNotAvailable (long waitTime)
พารามิเตอร์ waitTime
long
waitForDeviceOnline
public void waitForDeviceOnline ()
ขว้าง DeviceNotAvailableException
waitForDeviceOnline
public void waitForDeviceOnline (long waitTime)
พารามิเตอร์ waitTime
long
ขว้าง DeviceNotAvailableException
waitForDeviceShell
public boolean waitForDeviceShell (long waitTime)
พารามิเตอร์ waitTime
long
วิธีการป้องกัน checkApiLevelAgainst
protected void checkApiLevelAgainst (String feature,
int strictMinLevel)
พารามิเตอร์ feature
String
strictMinLevel
int
doAdbReboot
protected void doAdbReboot (NativeDevice.RebootMode rebootMode,
String reason) ทำการรีบูต adb
พารามิเตอร์ rebootMode
NativeDevice.RebootMode
: โหมดของการรีบูตนี้ reason
String
: สำหรับการรีบูตครั้งนี้
ขว้าง DeviceNotAvailableException
sureRuntimePermissionSupported
protected void ensureRuntimePermissionSupported () วิธีตัวช่วยเพื่อส่งข้อยกเว้นหากไม่รองรับการอนุญาตรันไทม์
ขว้าง DeviceNotAvailableException
getBugreportInternal
protected InputStreamSource getBugreportInternal ()
คืนสินค้า InputStreamSource
getBugreportzInternal
protected File getBugreportzInternal () เมธอด Internal Helper เพื่อรับไฟล์ zip bugreportz เป็น ERROR(/File)
getRunUtil
protected IRunUtil getRunUtil () รับอินสแตนซ์ RunUtil
เพื่อใช้งาน
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
ใหม่กว่า
protected boolean isNewer (File localFile,
IFileEntry entry) คืน true
หากไฟล์ในเครื่องใหม่กว่าไฟล์ระยะไกล IFileEntry
ถูกต้องเป็นนาที ในกรณีที่เท่ากัน ไฟล์จะถือว่าใหม่กว่า
พารามิเตอร์ localFile
File
entry
IFileEntry
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
หากความพยายามในการกู้คืนล้มเหลวหรือความพยายามสูงสุดที่ทำไม่สำเร็จ
postAdbReboot
protected void postAdbReboot () การดำเนินการเพิ่มเติมที่เป็นไปได้ที่สามารถทำได้หลังจากรีบูต
ขว้าง DeviceNotAvailableException
prePostBootSetup
protected void prePostBootSetup () อนุญาตให้อุปกรณ์แต่ละประเภท (AndroidNativeDevice, TestDevice) แทนที่วิธีนี้สำหรับการตั้งค่าการบูตเฉพาะ
ขว้าง DeviceNotAvailableException
setClock
protected void setClock (Clock clock) ตั้งค่าอินสแตนซ์นาฬิกาที่จะใช้
setLogStartDelay
protected void setLogStartDelay (int delay) ตั้งเวลาเป็นมิลลิวินาทีที่จะรอก่อนที่จะเริ่มการดักจับ logcat สำหรับอุปกรณ์ออนไลน์
พารามิเตอร์ delay
int
: ความล่าช้าใน ms
waitForDeviceNotAvailable
protected void waitForDeviceNotAvailable (String operationDesc,
long time)
พารามิเตอร์ operationDesc
String
time
long
ส่งความคิดเห็น
Content and code samples on this page are subject to the licenses described in the Content License . Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2022-07-06 UTC.
[{
"type": "thumb-down",
"id": "missingTheInformationINeed",
"label":"ไม่มีข้อมูลที่ฉันต้องการ"
},{
"type": "thumb-down",
"id": "tooComplicatedTooManySteps",
"label":"ซับซ้อนเกินไป/มีหลายขั้นตอนมากเกินไป"
},{
"type": "thumb-down",
"id": "outOfDate",
"label":"ล้าสมัย"
},{
"type": "thumb-down",
"id": "translationIssue",
"label":"ปัญหาเกี่ยวกับการแปล"
},{
"type": "thumb-down",
"id": "samplesCodeIssue",
"label":"ตัวอย่าง/ปัญหาเกี่ยวกับโค้ด"
},{
"type": "thumb-down",
"id": "otherDown",
"label":"อื่นๆ"
}]
[{
"type": "thumb-up",
"id": "easyToUnderstand",
"label":"เข้าใจง่าย"
},{
"type": "thumb-up",
"id": "solvedMyProblem",
"label":"แก้ปัญหาของฉันได้"
},{
"type": "thumb-up",
"id": "otherUp",
"label":"อื่นๆ"
}]
หากต้องการบอกให้เราทราบเพิ่มเติม