NativeDevice
public
class
NativeDevice
extends Object
implements
IManagedTestDevice,
IConfigurationReceiver
| java.lang.Object | |
| ↳ | com.android.tradefed.device.NativeDevice |
ITestDevice フルスタック以外の Android デバイスのデフォルト実装。
概要
ネストされたクラス | |
|---|---|
class |
NativeDevice.AdbAction
OS の「adb ....」コマンドを実行するための |
class |
NativeDevice.AdbShellAction
|
class |
NativeDevice.RebootDeviceAction
|
enum |
NativeDevice.RebootMode
再起動モード。 |
定数 | |
|---|---|
int |
INVALID_USER_ID
無効なユーザー ID または見つからないユーザー 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)
|
|
パブリック メソッド | |
|---|---|
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()
すべての |
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)
ルート以外のパスから |
|
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 root の後、デバイスがオンラインに戻る前に、デバイスで特定のアクションを実行する必要がある場合は、オーバーライドします。 |
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,
|
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,
|
boolean
|
runInstrumentationTestsAsUser(IRemoteAndroidTestRunner runner, int userId, ITestLifeCycleReceiver... listeners)
|
boolean
|
runInstrumentationTestsAsUser(IRemoteAndroidTestRunner runner, int userId,
|
void
|
setConfiguration(IConfiguration configuration)
使用中の |
void
|
setDate(Date date)
|
boolean
|
setDeviceOwner(String componentName, int userId)
|
void
|
setDeviceState(TestDeviceState deviceState)
|
void
|
setEmulatorOutputStream(SizeLimitedOutputStream output)
エミュレータの場合は、 |
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)
再起動アクションの実行時に使用する |
void
|
doAdbReboot(NativeDevice.RebootMode rebootMode, String reason)
adb で再起動します。 |
void
|
ensureRuntimePermissionSupported()
ランタイム権限がサポートされていない場合に例外をスローするヘルパー メソッド |
InputStreamSource
|
getBugreportInternal()
|
File
|
getBugreportzInternal()
bugreportz zip ファイルを |
IRunUtil
|
getRunUtil()
使用する |
String
|
internalGetProperty(String propName, String fastbootVar, String description)
デフォルトでは ddmlib キャッシュからデバイス プロパティを取得し、デバイスが Fastboot モードかどうかに応じて「adb shell getprop」または「fastboot getvar」にフォールバックします。 |
boolean
|
isNewer(File localFile, IFileEntry entry)
ローカル ファイルがリモート ファイルより新しい場合は |
boolean
|
performDeviceAction(String actionDescription, com.android.tradefed.device.NativeDevice.DeviceAction action, int retryAttempts)
このデバイスでアクションを実行します。 |
void
|
postAdbReboot()
再起動後に行うことができる追加の操作。 |
void
|
prePostBootSetup()
各デバイスタイプ(AndroidNativeDevice、TestDevice)が、起動後の特定の設定のためにこのメソッドをオーバーライドできるようにします。 |
void
|
setClock(Clock clock)
使用する Clock インスタンスを設定します。 |
void
|
setLogStartDelay(int delay)
オンライン デバイスの logcat キャプチャを開始する前に待機する時間をミリ秒単位で設定します。 |
void
|
waitForDeviceNotAvailable(String operationDesc, long time)
|
定数
INVALID_USER_ID
public static final int INVALID_USER_ID
無効なユーザー 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。null の場合もあります |
パブリック メソッド
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
publicgetActiveApexes ()
| 戻り値 | |
|---|---|
|
|
| 例外 | |
|---|---|
DeviceNotAvailableException |
|
getAllSettings
publicgetAllSettings (String namespace)
| パラメータ | |
|---|---|
namespace |
String |
| 戻り値 | |
|---|---|
|
|
| 例外 | |
|---|---|
DeviceNotAvailableException |
|
getAllocationState
public DeviceAllocationState getAllocationState ()
| 戻り値 | |
|---|---|
DeviceAllocationState |
|
getAndroidId
public String getAndroidId (int userId)
| パラメータ | |
|---|---|
userId |
int |
| 戻り値 | |
|---|---|
String |
|
| 例外 | |
|---|---|
DeviceNotAvailableException |
|
getAndroidIds
publicgetAndroidIds ()
| 戻り値 | |
|---|---|
|
|
| 例外 | |
|---|---|
DeviceNotAvailableException |
|
getApiLevel
public int getApiLevel ()
| 戻り値 | |
|---|---|
int |
|
| 例外 | |
|---|---|
DeviceNotAvailableException |
|
getAppPackageInfo
public PackageInfo getAppPackageInfo (String packageName)
| パラメータ | |
|---|---|
packageName |
String |
| 戻り値 | |
|---|---|
PackageInfo |
|
| 例外 | |
|---|---|
DeviceNotAvailableException |
|
getAppPackageInfos
publicgetAppPackageInfos ()
| 戻り値 | |
|---|---|
|
|
| 例外 | |
|---|---|
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
publicgetBootHistory ()
| 戻り値 | |
|---|---|
|
|
| 例外 | |
|---|---|
DeviceNotAvailableException |
|
getBootHistorySince
publicgetBootHistorySince (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 システムをリファクタリングします。(root でない場合でも)。
| パラメータ | |
|---|---|
entry |
FileListingService.FileEntry: Ddmlib で必要とされる root とは限らない FileEntry。 |
| 戻り値 | |
|---|---|
IFileEntry |
FileEntry を表す FileEntryWrapper。 |
| 例外 | |
|---|---|
DeviceNotAvailableException |
|
getFoldableStates
publicgetFoldableStates ()
| 戻り値 | |
|---|---|
|
|
| 例外 | |
|---|---|
DeviceNotAvailableException |
|
getIDevice
public IDevice getIDevice ()
| 戻り値 | |
|---|---|
IDevice |
|
getInstalledPackageNames
publicgetInstalledPackageNames ()
| 戻り値 | |
|---|---|
|
|
| 例外 | |
|---|---|
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
publicgetMainlineModuleInfo ()
| 戻り値 | |
|---|---|
|
|
| 例外 | |
|---|---|
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
publicgetMountPointInfo ()
| 戻り値 | |
|---|---|
|
|
| 例外 | |
|---|---|
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
publicgetTombstones ()
| 戻り値 | |
|---|---|
|
|
| 例外 | |
|---|---|
DeviceNotAvailableException |
|
getTotalMemory
public long getTotalMemory ()
| 戻り値 | |
|---|---|
long |
|
getUninstallablePackageNames
publicgetUninstallablePackageNames ()
| 戻り値 | |
|---|---|
|
|
| 例外 | |
|---|---|
DeviceNotAvailableException |
|
getUseFastbootErase
public boolean getUseFastbootErase ()
| 戻り値 | |
|---|---|
boolean |
|
getUserFlags
public int getUserFlags (int userId)
| パラメータ | |
|---|---|
userId |
int |
| 戻り値 | |
|---|---|
int |
|
| 例外 | |
|---|---|
DeviceNotAvailableException |
|
getUserInfos
publicgetUserInfos ()
| 戻り値 | |
|---|---|
|
|
| 例外 | |
|---|---|
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: デバイスで adb ルートを有効にする必要があるかどうか |
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
publiclistDisplayIds ()
| 戻り値 | |
|---|---|
|
|
| 例外 | |
|---|---|
DeviceNotAvailableException |
|
listUsers
publiclistUsers ()
| 戻り値 | |
|---|---|
|
|
| 例外 | |
|---|---|
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 root の後、デバイスがオンラインに戻る前に、デバイスで特定のアクションを実行する必要がある場合は、オーバーライドします。デフォルトの実装には追加アクションは含まれません。この段階で 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 ()
bugreportz ZIP ファイルを ERROR(/File) として取得する内部ヘルパー メソッド。
| 戻り値 | |
|---|---|
File |
|
internalGetProperty
protected String internalGetProperty (String propName,
String fastbootVar,
String description)デフォルトでは ddmlib キャッシュからデバイス プロパティを取得し、デバイスが Fastboot モードかどうかに応じて「adb shell getprop」または「fastboot getvar」にフォールバックします。
| パラメータ | |
|---|---|
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 |
復元の試行が失敗した場合、または最大回数の試行を行ったにもかかわらず成功しなかった場合 |
postAdbReboot
protected void postAdbReboot ()
再起動後に実行できる追加のアクション。
| 例外 | |
|---|---|
DeviceNotAvailableException |
|
prePostBootSetup
protected void prePostBootSetup ()
各デバイスタイプ(AndroidNativeDevice、TestDevice)が、起動後の特定の設定のためにこのメソッドをオーバーライドできるようにします。
| 例外 | |
|---|---|
DeviceNotAvailableException |
|
setClock
protected void setClock (Clock 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 |