INativeDevice

public interface INativeDevice

com.android.tradefed.device.INativeDevice


ddmlib IDevice に信頼性が高く、少し高レベルの API を提供します。

設定可能な回数だけデバイス コマンドを再試行し、応答しないデバイスにデバイス復元インターフェースを提供します。

概要

定数

int UNKNOWN_API_LEVEL

API レベルを検出できない場合のデフォルト値

パブリック メソッド

abstract boolean checkApiLevelAgainstNextRelease(int strictMinLevel)

サポートされている最小レベルで、機能が現在サポートされているかどうかを確認します。

abstract void clearLogcat()

蓄積された logcat データを削除します。

abstract void deleteFile(String deviceFilePath)

デバイス上のファイルまたはディレクトリを削除するヘルパー メソッド。

abstract void deleteFile(String deviceFilePath, int userId)

デバイス上のファイルまたはディレクトリを削除するヘルパー メソッド。

abstract boolean deviceSoftRestarted(ProcessInfo prevSystemServerProcess)

現在の system_server と以前の system_server ProcessInfo を比較して、デバイスがソフトリブートされたかどうかを確認するヘルパー メソッド。

abstract boolean deviceSoftRestartedSince(long utcEpochTime, TimeUnit timeUnit)

デバイスのエポックからの UTC 時刻とその ERROR(/TimeUnit) 以降にデバイスがソフトリブートされたかどうかを確認するヘルパー メソッド。

abstract boolean disableAdbRoot()

adb root をオフにします。

abstract boolean doesFileExist(String deviceFilePath)

デバイス上のファイルが存在するかどうかを判断するヘルパー メソッド。

abstract boolean enableAdbRoot()

adb root をオンにします。

abstract String executeAdbCommand(long timeout, String... commandArgs)

指定されたタイムアウトで adb コマンドをシステム コマンドとして実行するヘルパー メソッド。

abstract String executeAdbCommand(String... commandArgs)

adb コマンドをシステム コマンドとして実行するヘルパー メソッド。

abstract String executeAdbCommand(long timeout, envMap, String... commandArgs)

指定されたタイムアウトで adb コマンドをシステム コマンドとして実行するヘルパー メソッド。

abstract CommandResult executeFastbootCommand(long timeout, String... commandArgs)

fastboot コマンドをシステム コマンドとして実行するヘルパー メソッド。

abstract CommandResult executeFastbootCommand(String... commandArgs)

デフォルトのタイムアウトが 2 分間のシステム コマンドとして fastboot コマンドを実行するヘルパー メソッド。

abstract CommandResult executeLongFastbootCommand(String... commandArgs)

長時間実行される fastboot コマンドをシステム コマンドとして実行するヘルパー メソッド。

abstract CommandResult executeLongFastbootCommand( envVarMap, String... commandArgs)

長時間実行される fastboot コマンドを、システム環境変数を使用してシステム コマンドとして実行するヘルパー メソッド。

abstract String executeShellCommand(String command)

adb シェルコマンドを実行し、出力を String として返すヘルパー メソッド。

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

コマンドの動作を制御するための追加のパラメータを使用して、adb シェルコマンドを実行します。

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

コマンドの動作を制御するための追加のパラメータを使用して、adb シェルコマンドを実行します。

abstract void executeShellCommand(String command, IShellOutputReceiver receiver)

指定された adb シェルコマンドを実行し、コマンドが失敗した場合は複数回再試行します。

abstract CommandResult executeShellV2Command(String command)

adb シェルコマンドを実行し、コマンド ステータス出力、stdout、stderr が適切に入力された CommandResult として結果を返すヘルパー メソッドです。

abstract CommandResult executeShellV2Command(String command, OutputStream pipeToOutput)

adb シェルコマンドを実行し、コマンド ステータス出力と stderr が適切に入力された CommandResult として結果を返すヘルパー メソッドです。

abstract CommandResult executeShellV2Command(String command, File pipeAsInput)

adb シェルコマンドを実行し、コマンド ステータス出力、stdout、stderr が適切に入力された CommandResult として結果を返すヘルパー メソッドです。

abstract CommandResult executeShellV2Command(String command, long maxTimeoutForCommand, TimeUnit timeUnit, int retryAttempts)

コマンドの動作を制御するための追加のパラメータを使用して、adb シェルコマンドを実行します。

abstract CommandResult executeShellV2Command(String command, long maxTimeoutForCommand, TimeUnit timeUnit)

コマンドの動作を制御するための追加のパラメータを使用して、adb シェルコマンドを実行します。

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

コマンドの動作を制御するための追加のパラメータを使用して、adb シェルコマンドを実行します。

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

コマンドの動作を制御するための追加のパラメータを使用して、adb シェルコマンドを実行します。

abstract CommandResult fastbootWipePartition(String partition)

デバイスのパーティションをワイプするヘルパー メソッド。

abstract int getApiLevel()

デバイスの API レベルを取得します。

abstract String getBasebandVersion()

このデバイスのベースバンド(無線)バージョンを取得する便利なメソッド。

abstract Integer getBattery()

デバイスの現在のバッテリー残量を返します。バッテリー残量が取得できない場合は null を返します。

abstract boolean getBooleanProperty(String name, boolean defaultValue)

指定されたプロパティのブール値を返します。

abstract getBootHistory()

ヘルパー メソッドは、起動時間と起動理由を含む起動履歴マップを収集します。

abstract getBootHistorySince(long utcEpochTime, TimeUnit timeUnit)

ヘルパー メソッドは、デバイスから指定されたエポックからの時間と指定された時間単位以降の起動時間と起動理由を含む起動履歴マップを収集します。

abstract String getBootloaderVersion()

このデバイスのブートローダーのバージョンを取得する便利なメソッドです。

abstract String getBuildAlias()

デバイスで現在実行されているビルドのエイリアスを取得します。

abstract String getBuildFlavor()

デバイスのビルドフレーバーを取得します。

abstract String getBuildId()

デバイスで現在実行されているビルドを取得します。

abstract String getBuildSigningKeys()

デバイス イメージの署名に使用される鍵の種類を返します。

通常、Android デバイスはテストキー(AOSP など)またはリリースキー(個々のデバイス メーカーが管理)で署名されます。

abstract DeviceDescriptor getCachedDeviceDescriptor()

デバイスが割り当てられている場合はキャッシュに保存された DeviceDescriptor を返し、そうでない場合は現在の DeviceDescriptor を返します。

abstract DeviceDescriptor getCachedDeviceDescriptor(boolean shortDescriptor)

デバイスが割り当てられている場合はキャッシュに保存された DeviceDescriptor を返し、そうでない場合は現在の DeviceDescriptor を返します。

abstract String[] getChildren(String deviceFilePath)

IFileEntry を使用する代わりに、権限が原因で機能しないことがあります。

abstract AbstractConnection getConnection()

デバイスに関連付けられている接続を返します。

abstract String getDeviceClass()

デバイスクラスを取得します。

abstract long getDeviceDate()

デバイスの日付をエポックからのミリ秒単位で返します。

abstract DeviceDescriptor getDeviceDescriptor()

デバイス情報から DeviceDescriptor を返して、実際のデバイス オブジェクトを渡さずにデバイスに関する情報を取得します。

abstract DeviceDescriptor getDeviceDescriptor(boolean shortDescriptor)

デバイス情報から DeviceDescriptor を返して、実際のデバイス オブジェクトを渡さずにデバイスに関する情報を取得します。

abstract TestDeviceState getDeviceState()

デバイスの状態を取得します。

abstract long getDeviceTimeOffset(Date date)

デバイスと指定された ERROR(/Date) の時差を取得するヘルパー。

abstract InputStreamSource getEmulatorOutput()

エミュレータの stdout と stderr のストリームを取得します。

abstract long getExternalStoreFreeSpace()

デバイスの外部ストレージの空き容量を判断するヘルパー メソッド。

abstract String getFastbootProductType()

fastboot モードでこのデバイスのプロダクト タイプを取得する便利なメソッドです。

abstract String getFastbootProductVariant()

fastboot モードでこのデバイスのプロダクト タイプを取得する便利なメソッドです。

abstract String getFastbootSerialNumber()

Fastboot モードのシリアル番号を返します。

abstract String getFastbootVariable(String variableName)

デバイスから指定された fastboot 変数の値を取得します。

abstract IFileEntry getFileEntry(String path)

デバイス上のリモート ファイルへの参照を取得します。

abstract IDevice getIDevice()

関連する ddmlib IDevice への参照を返します。

abstract long getIntProperty(String name, long defaultValue)

デバイスから指定されたプロパティの整数値を返します。

abstract long getLastExpectedRebootTimeMillis()

Tradefed API が最後に再起動をトリガーした時刻(エポックからのミリ秒単位)を System.currentTimeMillis() によって返します。

abstract int getLaunchApiLevel()

デバイスが最初にリリースされた API レベルを取得します。

abstract InputStreamSource getLogcat()

logcat データのスナップショット ストリームを取得します。

abstract InputStreamSource getLogcat(int maxBytes)

キャプチャされた logcat データの最後の maxBytes のスナップショット ストリームを取得します。

abstract InputStreamSource getLogcatDump()

デバイスの現在の logcat ダンプを取得します。

abstract InputStreamSource getLogcatSince(long date)

指定された日付からキャプチャされた logcat データのスナップショット ストリームを取得します。

abstract String getMountPoint(String mountName)

マウント ポイントを返します。

abstract ITestDevice.MountPointInfo getMountPointInfo(String mountpoint)

指定されたマウントポイント パスに対応する MountPointInfo を返します。そのパスにマウントされたものがない場合、または /proc/mounts にマウントポイントとして表示されない場合は null を返します。

abstract getMountPointInfo()

デバイスの /proc/mounts にある情報を解析したバージョンを返します。

abstract long getPartitionFreeSpace(String partition)

デバイス パーティションの空き容量を判断するヘルパー メソッド。

abstract ProcessInfo getProcessByName(String processName)

ヘルパー メソッドは「pidof」コマンドと「stat」コマンドを実行し、指定されたプロセスの PID とプロセス開始時間を示す ProcessInfo オブジェクトを返します。

abstract String getProcessPid(String process)

サービスの pid を返します。エラーが発生した場合は null を返します。

abstract String getProductType()

このデバイスのプロダクト タイプを取得する便利なメソッド。

abstract String getProductVariant()

このデバイスの商品バリエーションを取得するための便利なメソッド。

abstract String getProperty(String name)

デバイスから指定されたプロパティ値を取得します。

abstract ITestDevice.RecoveryMode getRecoveryMode()

デバイスで使用されている現在のリカバリモードを取得します。

abstract String getSerialNumber()

このデバイスのシリアル番号を取得する便利なメソッド。

abstract getTombstones()

デバイスから墓石のリストを取得して返します。

abstract long getTotalMemory()

物理メモリの合計サイズをバイト単位で返します。内部エラーの場合は -1 を返します。

default String getTrackingSerial()

デバイス管理の目的で、デバイスの追跡に使用されるシリアル番号を取得します。

abstract boolean getUseFastbootErase()

fastboot erase と fastboot format のどちらを使用してデバイスのパーティションをワイプするかを取得します。

abstract boolean isAdbRoot()
abstract boolean isAdbTcp()
abstract boolean isAppEnumerationSupported()

デバイス上のプラットフォームがアプリの列挙をサポートしているかどうかを確認します。

abstract boolean isBypassLowTargetSdkBlockSupported()

デバイス上のプラットフォームが、アプリのインストール時に低いターゲット SDK ブロックのバイパスをサポートしているかどうかを確認します。

abstract boolean isDebugfsMounted()

debugfs がマウントされているかどうかを確認します。

abstract boolean isDeviceEncrypted()

デバイスが暗号化されているかどうかを返します。

abstract boolean isDirectory(String deviceFilePath)

デバイス上のパスがディレクトリである場合は true、そうでない場合は false を返します。

abstract boolean isEncryptionSupported()

デバイスで暗号化がサポートされているかどうかを返します。

abstract boolean isExecutable(String fullPath)

デバイス上のファイルパスが実行可能ファイルである場合は true を返し、そうでない場合は false を返します。

abstract boolean isHeadless()

デバイスがヘッドレス(画面なし)の場合は true、それ以外の場合は false を返します。

abstract boolean isRuntimePermissionSupported()

デバイス上のプラットフォームがランタイム権限の付与をサポートしているかどうかを確認します。

abstract boolean isStateBootloaderOrFastbootd()

デバイスが TestDeviceState.FASTBOOT または