INativeCihaz
public interface INativeDevice
com.android.tradefed.device.INativeDevice |
Bir ddmlib IDevice
için güvenilir ve biraz daha yüksek seviyeli bir API sağlar.
Özet
sabitler | |
---|---|
int | UNKNOWN_API_LEVEL API Düzeyi algılanamadığında varsayılan değer |
Genel yöntemler | |
---|---|
abstract boolean | checkApiLevelAgainstNextRelease (int strictMinLevel) Minimum düzeyde desteklenen bir düzeyde verilen bir özelliğin şu anda desteklenip desteklenmediğini kontrol edin. |
abstract void | clearLogcat () Birikmiş logcat verilerini siler. |
abstract void | deleteFile (String deviceFilePath) Cihazdaki bir dosyayı veya dizini silmek için yardımcı yöntem. |
abstract boolean | deviceSoftRestarted ( ProcessInfo prevSystemServerProcess) Geçerli system_server'ı önceki system_server |
abstract boolean | deviceSoftRestartedSince (long utcEpochTime, TimeUnit timeUnit) Aygıtın, aygıttan ve onun |
abstract boolean | disableAdbRoot () adb kökünü kapatır. |
abstract boolean | doesFileExist (String deviceFilePath) Cihazda dosya olup olmadığını belirlemek için yardımcı yöntem. |
abstract boolean | enableAdbRoot () adb kökünü açar. |
abstract String | executeAdbCommand (long timeout, String... commandArgs) Adb komutunu belirli bir zaman aşımı ile sistem komutu olarak yürüten yardımcı yöntem. |
abstract String | executeAdbCommand (String... commandArgs) Adb komutunu sistem komutu olarak çalıştıran yardımcı yöntem. |
abstract CommandResult | executeFastbootCommand (String... commandArgs) Bir fastboot komutunu sistem komutu olarak 2 dakikalık varsayılan zaman aşımı süresiyle yürüten yardımcı yöntem. |
abstract CommandResult | executeFastbootCommand (long timeout, String... commandArgs) Bir fastboot komutunu sistem komutu olarak yürüten yardımcı yöntem. |
abstract CommandResult | executeLongFastbootCommand ( envVarMap, String... commandArgs) executeLongFastbootCommand ( envVarMap, String... commandArgs) Sistem ortamı değişkenleriyle sistem komutu olarak uzun süredir çalışan bir fastboot komutunu yürüten yardımcı yöntem. |
abstract CommandResult | executeLongFastbootCommand (String... commandArgs) Sistem komutu olarak uzun süre çalışan bir fastboot komutunu çalıştıran yardımcı yöntem. |
abstract String | executeShellCommand (String command) Bir adb kabuk komutu yürüten ve çıktıyı |
abstract void | executeShellCommand (String command, IShellOutputReceiver receiver, long maxTimeToOutputShellResponse, TimeUnit timeUnit, int retryAttempts) Komut davranışını kontrol etmek için daha fazla parametre içeren bir adb kabuk komutu yürütür. |
abstract void | executeShellCommand (String command, IShellOutputReceiver receiver, long maxTimeoutForCommand, long maxTimeToOutputShellResponse, TimeUnit timeUnit, int retryAttempts) Komut davranışını kontrol etmek için daha fazla parametre içeren bir adb kabuk komutu yürütür. |
abstract void | executeShellCommand (String command, IShellOutputReceiver receiver) Komut başarısız olursa birden çok kez yeniden deneyerek verilen adb kabuk komutunu yürütür. |
abstract CommandResult | executeShellV2Command (String command) Bir adb kabuk komutu yürüten ve sonuçları komut durumu çıktısı, stdout ve stderr ile düzgün şekilde doldurulmuş bir |
abstract CommandResult | executeShellV2Command (String command, OutputStream pipeToOutput) Bir adb kabuk komutu yürüten ve sonuçları komut durumu çıktısı ve stderr ile düzgün şekilde doldurulmuş bir |
abstract CommandResult | executeShellV2Command (String command, File pipeAsInput) Bir adb kabuk komutu yürüten ve sonuçları komut durumu çıktısı, stdout ve stderr ile düzgün şekilde doldurulmuş bir |
abstract CommandResult | executeShellV2Command (String command, long maxTimeoutForCommand, TimeUnit timeUnit, int retryAttempts) Komut davranışını kontrol etmek için daha fazla parametre içeren bir adb kabuk komutu yürütür. |
abstract CommandResult | executeShellV2Command (String command, long maxTimeoutForCommand, TimeUnit timeUnit) Komut davranışını kontrol etmek için daha fazla parametre içeren bir adb kabuk komutu yürütür. |
abstract CommandResult | executeShellV2Command (String command, File pipeAsInput, OutputStream pipeToOutput, long maxTimeoutForCommand, TimeUnit timeUnit, int retryAttempts) Komut davranışını kontrol etmek için daha fazla parametre içeren bir adb kabuk komutu yürütür. |
abstract CommandResult | executeShellV2Command (String command, File pipeAsInput, OutputStream pipeToOutput, OutputStream pipeToError, long maxTimeoutForCommand, TimeUnit timeUnit, int retryAttempts) Komut davranışını kontrol etmek için daha fazla parametre içeren bir adb kabuk komutu yürütür. |
abstract CommandResult | fastbootWipePartition (String partition) Aygıt için bir bölümü silen yardımcı yöntem. |
abstract int | getApiLevel () Cihaz API Düzeyini alın. |
abstract String | getBasebandVersion () Bu cihazın temel bant (radyo) sürümünü elde etmek için kolaylık yöntemi. |
abstract Integer | getBattery () Bir aygıtın mevcut pil düzeyini veya pil düzeyi kullanılamıyorsa Null değerini döndürür. |
abstract boolean | getBooleanProperty (String name, boolean defaultValue) Verilen özelliğin boole değerini döndürür. |
abstract | getBootHistory () Yardımcı yöntem, önyükleme geçmişi haritasını önyükleme zamanı ve önyükleme nedeni ile toplar. |
abstract | getBootHistorySince (long utcEpochTime, TimeUnit timeUnit) Yardımcı yöntem, cihazdan epoch'tan bu yana verilen zamandan ve belirtilen zaman biriminden itibaren önyükleme zamanı ve önyükleme nedeni ile önyükleme geçmişi haritasını toplar. |
abstract String | getBootloaderVersion () Bu aygıtın önyükleyici sürümünü almak için kolaylık yöntemi. |
abstract InputStreamSource | getBugreport () Cihazdan bir hata raporu alır. |
abstract InputStreamSource | getBugreportz () Cihazdan bir hata raporu alır. |
abstract String | getBuildAlias () Aygıtın şu anda çalışmakta olduğu yapının diğer adını alın. |
abstract String | getBuildFlavor () Aygıtın yapı lezzetini alın. |
abstract String | getBuildId () Aygıtın şu anda çalışmakta olduğu yapıyı alın. |
abstract String | getBuildSigningKeys () Aygıt görüntüsünü imzalamak için kullanılan anahtar türünü döndürür Tipik olarak Android cihazlar, test anahtarlarıyla (AOSP'de olduğu gibi) veya serbest bırakma anahtarlarıyla (bireysel cihaz üreticileri tarafından kontrol edilir) imzalanabilir. |
abstract DeviceDescriptor | getCachedDeviceDescriptor () Aygıt tahsis edilmişse önbelleğe alınmış bir |
abstract DeviceDescriptor | getCachedDeviceDescriptor (boolean shortDescriptor) Aygıt tahsis edilmişse önbelleğe alınmış bir |
abstract String[] | getChildren (String deviceFilePath) İzinler nedeniyle bazen çalışmayan |
abstract String | getDeviceClass () Cihaz sınıfını alın. |
abstract long | getDeviceDate () Çağdan bu yana cihazın tarihini milisaniye cinsinden döndür. |
abstract DeviceDescriptor | getDeviceDescriptor () Gerçek cihaz nesnesini geçmeden bilgi almak için cihaz bilgisinden bir |
abstract DeviceDescriptor | getDeviceDescriptor (boolean shortDescriptor) Gerçek cihaz nesnesini geçmeden bilgi almak için cihaz bilgisinden bir |
abstract TestDeviceState | getDeviceState () Cihazın durumunu alın. |
abstract long | getDeviceTimeOffset (Date date) Cihaz ile belirli bir |
abstract InputStreamSource | getEmulatorOutput () Öykünücü stdout ve stderr akışını alın |
abstract long | getExternalStoreFreeSpace () Aygıtın harici deposundaki boş alan miktarını belirlemeye yönelik yardımcı yöntem. |
abstract String | getFastbootProductType () Fastboot modundayken bu cihazın ürün türünü almak için kolaylık yöntemi. |
abstract String | getFastbootProductVariant () Fastboot modundayken bu cihazın ürün türünü almak için kolaylık yöntemi. |
abstract String | getFastbootSerialNumber () Fastboot modu seri numarasını döndürür. |
abstract String | getFastbootVariable (String variableName) Cihazdan verilen fastboot değişken değerini alın. |
abstract IFileEntry | getFileEntry (String path) Cihazdaki uzak bir dosyaya referans alın. |
abstract IDevice | getIDevice () İlişkili ddmlib |
abstract long | getIntProperty (String name, long defaultValue) Aygıttan verilen özelliğin tamsayı değerini döndürür. |
abstract long | getLastExpectedRebootTimeMillis () |
abstract int | getLaunchApiLevel () Cihazın ilk başlatılan API Düzeyini edinin. |
abstract InputStreamSource | getLogcat () Logcat verilerinin anlık görüntü akışını alır. |
abstract InputStreamSource | getLogcat (int maxBytes) Yakalanan logcat verilerinin son |
abstract InputStreamSource | getLogcatDump () Cihaz için geçerli logcat'in dökümünü alın. |
abstract InputStreamSource | getLogcatSince (long date) Sağlanan tarihten başlayarak yakalanan logcat verilerinin anlık görüntüsünü alır. |
abstract String | getMountPoint (String mountName) Bir bağlama noktası döndürür. |
abstract ITestDevice.MountPointInfo | getMountPointInfo (String mountpoint) Belirtilen bağlama noktası yoluna karşılık gelen bir |
abstract | getMountPointInfo () Aygıtta /proc/mounts içindeki bilgilerin ayrıştırılmış bir sürümünü döndürür |
abstract long | getPartitionFreeSpace (String partition) Aygıt bölümündeki boş alan miktarını belirlemek için yardımcı yöntem. |
abstract ProcessInfo | getProcessByName (String processName) Helper metodu "pidof" ve "stat" komutlarını çalıştırır ve verilen prosesin PID ve proses başlangıç zamanı ile |
abstract String | getProcessPid (String process) Hizmetin pid değerini döndürür veya bir şeyler ters giderse null değerini döndürür. |
abstract String | getProductType () Bu cihazın ürün türünü elde etmek için kolaylık yöntemi. |
abstract String | getProductVariant () Bu cihazın ürün çeşidini elde etmek için kolaylık yöntemi. |
abstract String | getProperty (String name) Cihazdan verilen özellik değerini alın. |
abstract ITestDevice.RecoveryMode | getRecoveryMode () Cihaz için kullanılan mevcut kurtarma modunu alın. |
abstract String | getSerialNumber () Bu cihazın seri numarasını almak için kolay yöntem. |
abstract | getTombstones () Cihazlardan mezar taşlarının listesini getir ve iade et. |
abstract long | getTotalMemory () Toplam fiziksel bellek boyutunu bayt olarak veya dahili hata durumunda -1 olarak döndürür |
abstract boolean | getUseFastbootErase () Cihazdaki bir bölümü silmek için fastboot silme veya fastboot formatının kullanılıp kullanılmayacağını öğrenin. |
abstract boolean | isAdbRoot () |
abstract boolean | isAdbTcp () |
abstract boolean | isAppEnumerationSupported () Cihazdaki platformun uygulama numaralandırmasını destekleyip desteklemediğini kontrol edin |
abstract boolean | isDeviceEncrypted () Cihaz şifreliyse döner. |
abstract boolean | isDirectory (String deviceFilePath) Aygıttaki yol bir dizinse True, değilse false döndürün. |
abstract boolean | isEncryptionSupported () Cihazda şifreleme destekleniyorsa döndürür. |
abstract boolean | isExecutable (String fullPath) Aygıttaki dosya yolu yürütülebilir bir dosyaysa True, değilse false döndürür. |
abstract boolean | isHeadless () Cihaz başsızsa (ekransız) true, aksi takdirde false değerini döndürün. |
abstract boolean | isRuntimePermissionSupported () Cihazdaki platformun çalışma zamanı izni vermeyi destekleyip desteklemediğini kontrol edin |
abstract boolean | isStateBootloaderOrFastbootd () Cihaz |
abstract boolean | logAnrs ( ITestLogger logger) Cihazdan ANR'leri toplar ve günlüğe kaydeder. |
abstract boolean | logBugreport (String dataName, ITestLogger listener) Hata raporu almak ve muhabirlere kaydetmek için yardımcı yöntem. |
abstract void | logOnDevice (String tag, Log.LogLevel level, String format, Object... args) Cihazın logcat'ine bir mesaj kaydedin. |
abstract void | nonBlockingReboot () Cihazı yeniden başlatmak için bir komut verir ve komut tamamlandığında ve cihaz artık adb tarafından görülmediğinde geri döner. |
abstract void | postBootSetup () Her önyüklemeden sonra bunu test etmek için cihazı yapılandırmak için talimatları uygulayın. |
default void | postInvocationTearDown () Bu yöntem kullanımdan kaldırılmıştır. Bunun yerine |
abstract void | postInvocationTearDown (Throwable invocationException) Çağrı yapıldıktan sonra yürütülecek cihaza özel gerekli temizlik için ek adımlar. |
default void | preInvocationSetup ( IBuildInfo info, MultiMap <String, String> attributes) Çağırma akışından önce cihazda yürütülecek cihaza özel gerekli kurulum için ek adımlar. |
abstract boolean | pullDir (String deviceFilePath, File localDir) Dizin içeriğini cihazdan yinelemeli olarak çekin. |
abstract File | pullFile (String remoteFilePath, int userId) Aygıttan bir dosyayı alır, yerel bir geçici |
abstract File | pullFile (String remoteFilePath) Aygıttan bir dosyayı alır, yerel bir geçici |
abstract boolean | pullFile (String remoteFilePath, File localFile) Aygıttan bir dosya alır. |
abstract boolean | pullFile (String remoteFilePath, File localFile, int userId) Aygıttan bir dosya alır. |
abstract String | pullFileContents (String remoteFilePath) Aygıttan bir dosya alır ve içeriğini döndürür. |
abstract File | pullFileFromExternal (String remoteFilePath) Aygıtın harici deposundan bir dosya almak, onu yerel bir geçici |
abstract boolean | pushDir (File localDir, String deviceFilePath, excludedDirectories) pushDir (File localDir, String deviceFilePath, excludedDirectories) Filtrelenen bazı dizinleri hariç tutarken dizin içeriğini tekrar tekrar cihaza aktarın. |
abstract boolean | pushDir (File localDir, String deviceFilePath) Dizin içeriğini tekrar tekrar cihaza aktarın. |
abstract boolean | pushFile (File localFile, String deviceFilePath, boolean evaluateContentProviderNeeded) İsteğe bağlı olarak içerik sağlayıcı ihtiyacını değerlendirmeyi düşünebilen |
abstract boolean | pushFile (File localFile, String deviceFilePath) Bir dosyayı cihaza itin. |
abstract boolean | pushString (String contents, String deviceFilePath) Bir dizeden cihaza oluşturulan dosyayı itin |
abstract void | reboot () Cihazı adb modunda yeniden başlatır. |
abstract void | reboot (String reason) Yeniden başlatma sırasında kalıcı olması için belirtilen |
abstract void | rebootIntoBootloader () Aygıtı önyükleyici modunda yeniden başlatır. |
abstract void | rebootIntoFastbootd () Cihazı fastbootd modunda yeniden başlatır. |
abstract void | rebootIntoRecovery () Cihazı adb kurtarma modunda yeniden başlatır. |
abstract void | rebootIntoSideload (boolean autoReboot) Cihazı adb sideload modunda yeniden başlatır (bunun kurtarma aşamasındaki özel bir mod olduğunu unutmayın) Cihaz yandan yükleme moduna girene kadar engeller |
abstract void | rebootIntoSideload () Cihazı adb sideload modunda yeniden başlatır (bunun kurtarma aşamasındaki özel bir mod olduğunu unutmayın) Cihaz yandan yükleme moduna girene kadar engeller |
abstract void | rebootUntilOnline () Yalnızca cihaz çevrimiçi olana kadar yani adb tarafından görülünceye kadar bloke eden |
abstract void | rebootUntilOnline (String reason) Yalnızca cihaz çevrimiçi olana kadar yani adb tarafından görülünceye kadar bloke eden |
abstract void | rebootUserspace () Cihazın yalnızca kullanıcı alanı bölümünü yeniden başlatır. |
abstract void | rebootUserspaceUntilOnline () Yalnızca cihaz çevrimiçi olana kadar yani adb tarafından görülünceye kadar bloke eden |
abstract void | remountSystemWritable () Cihazdaki sistem bölümünü yazılabilir yapın. |
abstract void | remountVendorWritable () Cihazdaki satıcı bölümünü yazılabilir yapın. |
abstract boolean | runInstrumentationTests (IRemoteAndroidTestRunner runner, ITestLifeCycleReceiver... listeners) Parametre olarak geçirilen bir veya daha fazla dinleyiciyle |
abstract boolean | runInstrumentationTests (IRemoteAndroidTestRunner runner, listeners) runInstrumentationTests (IRemoteAndroidTestRunner runner, listeners) Enstrümantasyon testleri çalıştırır ve cihaz kurtarma sağlar. |
abstract boolean | runInstrumentationTestsAsUser (IRemoteAndroidTestRunner runner, int userId, ITestLifeCycleReceiver... listeners) |
abstract boolean | runInstrumentationTestsAsUser (IRemoteAndroidTestRunner runner, int userId, listeners) runInstrumentationTestsAsUser (IRemoteAndroidTestRunner runner, int userId, listeners) |
abstract void | setDate (Date date) Cihazdaki tarihi ayarlar Not: cihazda tarih ayarı root gerektirir |
abstract void | setOptions ( TestDeviceOptions options) Cihaz için |
abstract boolean | setProperty (String propKey, String propValue) Cihazda verilen özellik değerini ayarlar. |
abstract void | setRecovery ( IDeviceRecovery recovery) Bu aygıt için kullanılacak |
abstract void | setRecoveryMode ( ITestDevice.RecoveryMode mode) Cihaz için kullanılacak mevcut kurtarma modunu ayarlayın. |
abstract void | setUseFastbootErase (boolean useFastbootErase) Cihazdaki bir bölümü silmek için fastboot silme veya fastboot formatının kullanılıp kullanılmayacağını ayarlayın. |
abstract void | startLogcat () Arka planda cihazdan logcat çıktısını almaya başlayın. |
abstract void | stopEmulatorOutput () Emülatör çıktısını kapatın ve silin. |
abstract void | stopLogcat () Cihazdan logcat çıktısını yakalamayı durdurun ve halihazırda kayıtlı logcat verilerini atın. |
abstract String | switchToAdbTcp () Cihazı adb-over-tcp moduna geçirin. |
abstract boolean | switchToAdbUsb () Cihazı usb üzerinden adb moduna geçirin. |
abstract boolean | syncFiles (File localFileDir, String deviceFilePath) Yerel bir dosya dizininin içeriğini cihaza aşamalı olarak eşitler. |
abstract Bugreport | takeBugreport () Bir hata raporu alın ve onu işlemek için bir |
abstract boolean | unlockDevice () Cihaz şifreli durumdaysa cihazın kilidini açar. |
abstract boolean | waitForBootComplete (long timeOut) Aygıtın önyükleme tamamlandı bayrağı ayarlanana kadar engeller. |
abstract boolean | waitForDeviceAvailable () Cihazın yanıt vermesini ve test için hazır olmasını bekler. |
abstract boolean | waitForDeviceAvailable (long waitTime) Cihazın yanıt vermesini ve test için hazır olmasını bekler. |
abstract void | waitForDeviceBootloader () Cihaz fastboot üzerinden görünene kadar engeller. |
abstract boolean | waitForDeviceInRecovery (long waitTime) Aygıtın 'adb kurtarma' durumunda olmasını engeller (bunun |
abstract boolean | waitForDeviceInSideload (long waitTime) Cihazın 'adb sideload' durumunda olması için bloklar |
abstract boolean | waitForDeviceNotAvailable (long waitTime) Cihazın kullanılamaması için bloklar, yani adb'den eksik |
abstract void | waitForDeviceOnline () Cihaz adb aracılığıyla görünene kadar engeller. |
abstract void | waitForDeviceOnline (long waitTime) Cihaz adb aracılığıyla görünene kadar engeller. |
abstract boolean | waitForDeviceShell (long waitTime) Cihazın temel bir adb shell komutuna yanıt vermesini bekler. |
sabitler
UNKNOWN_API_LEVEL
public static final int UNKNOWN_API_LEVEL
API Düzeyi algılanamadığında varsayılan değer
Sabit Değer: -1 (0xffffffff)
Genel yöntemler
checkApiLevelAgainstNextRelease
public abstract boolean checkApiLevelAgainstNextRelease (int strictMinLevel)
Minimum düzeyde desteklenen bir düzeyde verilen bir özelliğin şu anda desteklenip desteklenmediğini kontrol edin. Bu yöntem, API düzeyi yükseltilmeden önce henüz yayınlanmamış özellikleri hesaba katar.
parametreler | |
---|---|
strictMinLevel | int : Özelliği destekleyen katı minimum olası düzey. |
İadeler | |
---|---|
boolean | Düzey destekleniyorsa doğrudur. Aksi takdirde yanlış. |
atar | |
---|---|
DeviceNotAvailableException |
temizleLogcat
public abstract void clearLogcat ()
Birikmiş logcat verilerini siler.
Bu,ITestDevice#getLogcat()
yalnızca belirli bir noktadan sonra üretilen günlük verilerini döndürmesini sağlamak istediğiniz durumlar için kullanışlıdır (örneğin, yeni bir aygıt derlemesini açtıktan sonra, vb.). dosyayı sil
public abstract void deleteFile (String deviceFilePath)
Cihazdaki bir dosyayı veya dizini silmek için yardımcı yöntem.
parametreler | |
---|---|
deviceFilePath | String : Dosyanın cihazdaki mutlak yolu. |
atar | |
---|---|
DeviceNotAvailableException |
deviceSoftYeniden başlatıldı
public abstract boolean deviceSoftRestarted (ProcessInfo prevSystemServerProcess)
Geçerli system_server'ı önceki system_server ProcessInfo
ile karşılaştırarak aygıtın yumuşak bir şekilde yeniden başlatılıp başlatılmadığını kontrol etmek için yardımcı yöntem. ProcessInfo
almak için getProcessByName(String)
kullanın.
parametreler | |
---|---|
prevSystemServerProcess | ProcessInfo : önceki system_server işlemi ProcessInfo . |
İadeler | |
---|---|
boolean | cihaz yumuşak yeniden başlatılmışsa true |
atar | |
---|---|
RuntimeException | cihazın anormal önyükleme nedeni varsa |
DeviceNotAvailableException |
deviceSoftRestartedSince
public abstract boolean deviceSoftRestartedSince (long utcEpochTime, TimeUnit timeUnit)
Aygıtın, aygıttan ve onun ERROR(/TimeUnit)
döneminden bu yana UTC zamanından bu yana geçici olarak yeniden başlatılıp başlatılmadığını kontrol etmek için yardımcı yöntem. Yazılımla Yeniden Başlatma, bir aygıtın donanımdan yeniden başlatılması dışında yeniden başlatılan system_server'ı ifade eder (örneğin: istenen yeniden başlatma). Milliseccond'daki geçerli aygıt utcEpochTime, getDeviceDate()
yöntemiyle elde edilebilir.
parametreler | |
---|---|
utcEpochTime | long : çağdan bu yana saniye cinsinden cihaz süresi. |
timeUnit | TimeUnit : verilen TimeUnit için TimeUnit zaman birimi. |
İadeler | |
---|---|
boolean | cihaz yumuşak yeniden başlatılmışsa true |
atar | |
---|---|
RuntimeException | cihazın anormal önyükleme nedeni varsa |
DeviceNotAvailableException |
AdbRoot'u devre dışı bırak
public abstract boolean disableAdbRoot ()
adb kökünü kapatır.
Adb kökünü devre dışı bırakmak, cihazın adb ile bağlantısının kesilmesine neden olabilir. Bu yöntem, cihaz kullanılabilir olana kadar engelleyecektir.İadeler | |
---|---|
boolean | başarılıysa true . |
atar | |
---|---|
DeviceNotAvailableException | cihazla bağlantı kesilirse ve kurtarılamazsa. |
doFileExist
public abstract boolean doesFileExist (String deviceFilePath)
Cihazda dosya olup olmadığını belirlemek için yardımcı yöntem.
parametreler | |
---|---|
deviceFilePath | String : kontrol edilecek cihazdaki dosyanın mutlak yolu |
İadeler | |
---|---|
boolean | dosya varsa true , aksi takdirde false . |
atar | |
---|---|
DeviceNotAvailableException | cihazla bağlantı kesilirse ve kurtarılamazsa. |
etkinleştirmekAdbRoot
public abstract boolean enableAdbRoot ()
adb kökünü açar. "Enable-root" ayarı "false" ise, bir mesaj günlüğe kaydedilir ve root etkinleştirilmeden geri döner.
Adb root'u etkinleştirmek, cihazın adb ile bağlantısının kesilmesine neden olabilir. Bu yöntem, cihaz kullanılabilir olana kadar engelleyecektir.İadeler | |
---|---|
boolean | başarılıysa true . |
atar | |
---|---|
DeviceNotAvailableException | cihazla bağlantı kesilirse ve kurtarılamazsa. |
yürütmekAdbKomut
public abstract String executeAdbCommand (long timeout, String... commandArgs)
Adb komutunu belirli bir zaman aşımı ile sistem komutu olarak yürüten yardımcı yöntem.
Bu yöntem daha iyi hata algılama ve performans sağladığından, mümkün olan her yerde bunun yerine executeShellCommand(String)
kullanılmalıdır.
parametreler | |
---|---|
timeout | long : cihazın yanıt vermediği kabul edilmeden önceki milisaniye cinsinden süre, zaman aşımı olmaması için 0L |
commandArgs | String : adb komutu ve çalıştırılacak argümanlar |
İadeler | |
---|---|
String | komuttan stdout. komut yürütülemediyse null . |
atar | |
---|---|
DeviceNotAvailableException | cihazla bağlantı kesilirse ve kurtarılamazsa. |
yürütmekAdbKomut
public abstract String executeAdbCommand (String... commandArgs)
Adb komutunu sistem komutu olarak çalıştıran yardımcı yöntem.
Bu yöntem daha iyi hata algılama ve performans sağladığından, mümkün olan her yerde bunun yerineexecuteShellCommand(String)
kullanılmalıdır.parametreler | |
---|---|
commandArgs | String : adb komutu ve çalıştırılacak argümanlar |
İadeler | |
---|---|
String | komuttan stdout. komut yürütülemediyse null . |
atar | |
---|---|
DeviceNotAvailableException | cihazla bağlantı kesilirse ve kurtarılamazsa. |
yürütmekFastbootKomut
public abstract CommandResult executeFastbootCommand (String... commandArgs)
Bir fastboot komutunu sistem komutu olarak 2 dakikalık varsayılan zaman aşımı süresiyle yürüten yardımcı yöntem.
Cihaz zaten fastboot modundayken kullanılması bekleniyor.parametreler | |
---|---|
commandArgs | String : fastboot komutu ve çalıştırılacak argümanlar |
İadeler | |
---|---|
CommandResult | komutun çıktısını içeren CommandResult |
atar | |
---|---|
DeviceNotAvailableException | cihazla bağlantı kesilirse ve kurtarılamazsa. |
yürütmekFastbootKomut
public abstract CommandResult executeFastbootCommand (long timeout, String... commandArgs)
Bir fastboot komutunu sistem komutu olarak yürüten yardımcı yöntem.
Cihaz zaten fastboot modundayken kullanılması bekleniyor.parametreler | |
---|---|
timeout | long : komutun sona ermesinden önceki milisaniye cinsinden süre |
commandArgs | String : fastboot komutu ve çalıştırılacak argümanlar |
İadeler | |
---|---|
CommandResult | komutun çıktısını içeren CommandResult |
atar | |
---|---|
DeviceNotAvailableException | cihazla bağlantı kesilirse ve kurtarılamazsa. |
yürütmekLongFastbootKomut
public abstract CommandResult executeLongFastbootCommand (envVarMap, String... commandArgs)
Sistem ortamı değişkenleriyle sistem komutu olarak uzun süredir çalışan bir fastboot komutunu yürüten yardımcı yöntem.
Daha uzun bir zaman aşımı kullanması dışında executeFastbootCommand(String)
ile aynıdır.
parametreler | |
---|---|
envVarMap | |
commandArgs | String : fastboot komutu ve çalıştırılacak argümanlar |
İadeler | |
---|---|
CommandResult | komutun çıktısını içeren CommandResult |
atar | |
---|---|
DeviceNotAvailableException | cihazla bağlantı kesilirse ve kurtarılamazsa. |
yürütmekLongFastbootKomut
public abstract CommandResult executeLongFastbootCommand (String... commandArgs)
Sistem komutu olarak uzun süre çalışan bir fastboot komutunu çalıştıran yardımcı yöntem.
Daha uzun bir zaman aşımı kullanması dışındaexecuteFastbootCommand(String)
ile aynıdır.parametreler | |
---|---|
commandArgs | String : fastboot komutu ve çalıştırılacak argümanlar |
İadeler | |
---|---|
CommandResult | komutun çıktısını içeren CommandResult |
atar | |
---|---|
DeviceNotAvailableException | cihazla bağlantı kesilirse ve kurtarılamazsa. |
yürütmekShellKomut
public abstract String executeShellCommand (String command)
Bir adb kabuk komutu yürüten ve çıktıyı String
olarak döndüren yardımcı yöntem.
parametreler | |
---|---|
command | String : çalıştırılacak adb shell komutu |
İadeler | |
---|---|
String | kabuk çıktısı |
atar | |
---|---|
DeviceNotAvailableException | cihazla bağlantı kesilirse ve kurtarılamazsa. |
yürütmekShellKomut
public abstract void executeShellCommand (String command, IShellOutputReceiver receiver, long maxTimeToOutputShellResponse, TimeUnit timeUnit, int retryAttempts)
Komut davranışını kontrol etmek için daha fazla parametre içeren bir adb kabuk komutu yürütür.
parametreler | |
---|---|
command | String : çalıştırılacak adb shell komutu |
receiver | IShellOutputReceiver : Kabuk çıktısının yönlendirileceği IShellOutputReceiver . |
maxTimeToOutputShellResponse | long : komutun herhangi bir yanıt vermemesine izin verilen maksimum süre; timeUnit belirtildiği gibi birim |
timeUnit | TimeUnit : maxTimeToOutputShellResponse için birim |
retryAttempts | int : bir istisna nedeniyle başarısız olursa, komutun yeniden denenmesi için maksimum sayı. RetryAttempts başarılı olmadan gerçekleştirilirse retryAttempts atılır. |
atar | |
---|---|
DeviceNotAvailableException | cihazla bağlantı kesilirse ve kurtarılamazsa. |
Ayrıca bakınız:
yürütmekShellKomut
public abstract void executeShellCommand (String command, IShellOutputReceiver receiver, long maxTimeoutForCommand, long maxTimeToOutputShellResponse, TimeUnit timeUnit, int retryAttempts)
Komut davranışını kontrol etmek için daha fazla parametre içeren bir adb kabuk komutu yürütür.
parametreler | |
---|---|
command | String : çalıştırılacak adb shell komutu |
receiver | IShellOutputReceiver : Kabuk çıktısının yönlendirileceği IShellOutputReceiver . |
maxTimeoutForCommand | long : komutun tamamlanması için maksimum zaman aşımı; timeUnit belirtildiği gibi birim |
maxTimeToOutputShellResponse | long : komutun herhangi bir yanıt vermemesine izin verilen maksimum süre; timeUnit belirtildiği gibi birim |
timeUnit | TimeUnit : maxTimeToOutputShellResponse için birim |
retryAttempts | int : bir istisna nedeniyle başarısız olursa, komutun yeniden denenmesi için maksimum sayı. RetryAttempts başarılı olmadan gerçekleştirilirse retryAttempts atılır. |
atar | |
---|---|
DeviceNotAvailableException | cihazla bağlantı kesilirse ve kurtarılamazsa. |
Ayrıca bakınız:
yürütmekShellKomut
public abstract void executeShellCommand (String command, IShellOutputReceiver receiver)
Komut başarısız olursa birden çok kez yeniden deneyerek verilen adb kabuk komutunu yürütür.
Varsayılan değerlerle daha basit birexecuteShellCommand(String, com.android.ddmlib.IShellOutputReceiver, long, TimeUnit, int)
.parametreler | |
---|---|
command | String : çalıştırılacak adb shell komutu |
receiver | IShellOutputReceiver : Kabuk çıktısının yönlendirileceği IShellOutputReceiver . |
atar | |
---|---|
DeviceNotAvailableException | cihazla bağlantı kesilirse ve kurtarılamazsa. |
yürütmekShellV2Komut
public abstract CommandResult executeShellV2Command (String command)
Bir adb kabuk komutu yürüten ve sonuçları komut durumu çıktısı, stdout ve stderr ile düzgün şekilde doldurulmuş bir CommandResult
olarak döndüren yardımcı yöntem.
parametreler | |
---|---|
command | String : Çalıştırılması gereken komut. |
İadeler | |
---|---|
CommandResult | CommandResult sonuç. |
atar | |
---|---|
DeviceNotAvailableException | cihazla bağlantı kesilirse ve kurtarılamazsa. |
yürütmekShellV2Komut
public abstract CommandResult executeShellV2Command (String command, OutputStream pipeToOutput)
Bir adb kabuk komutu yürüten ve sonuçları komut durumu çıktısı ve stderr ile düzgün şekilde doldurulmuş bir CommandResult
olarak döndüren yardımcı yöntem. stdout belirtilen akışa yönlendirilir.
parametreler | |
---|---|
command | String : Çalıştırılması gereken komut. |
pipeToOutput | OutputStream : ERROR(/OutputStream) std çıktısının yeniden yönlendirileceği yer veya null. |
İadeler | |
---|---|
CommandResult | CommandResult sonuç. |
atar | |
---|---|
DeviceNotAvailableException | cihazla bağlantı kesilirse ve kurtarılamazsa. |
yürütmekShellV2Komut
public abstract CommandResult executeShellV2Command (String command, File pipeAsInput)
Bir adb kabuk komutu yürüten ve sonuçları komut durumu çıktısı, stdout ve stderr ile düzgün şekilde doldurulmuş bir CommandResult
olarak döndüren yardımcı yöntem.
parametreler | |
---|---|
command | String : Çalıştırılması gereken komut. |
pipeAsInput | File : Komuta girdi olarak aktarılacak bir ERROR(/File) veya boş. |
İadeler | |
---|---|
CommandResult | CommandResult sonuç. |
atar | |
---|---|
DeviceNotAvailableException | cihazla bağlantı kesilirse ve kurtarılamazsa. |
yürütmekShellV2Komut
public abstract CommandResult executeShellV2Command (String command, long maxTimeoutForCommand, TimeUnit timeUnit, int retryAttempts)
Komut davranışını kontrol etmek için daha fazla parametre içeren bir adb kabuk komutu yürütür.
parametreler | |
---|---|
command | String : çalıştırılacak adb shell komutu |
maxTimeoutForCommand | long : komutun tamamlanması için maksimum zaman aşımı; timeUnit belirtildiği gibi birim |
timeUnit | TimeUnit : maxTimeToOutputShellResponse için birim |
retryAttempts | int : bir istisna nedeniyle başarısız olursa, komutun yeniden denenmesi için maksimum sayı. RetryAttempts başarılı olmadan gerçekleştirilirse retryAttempts atılır. |
İadeler | |
---|---|
CommandResult |
atar | |
---|---|
DeviceNotAvailableException | cihazla bağlantı kesilirse ve kurtarılamazsa. |
Ayrıca bakınız:
yürütmekShellV2Komut
public abstract CommandResult executeShellV2Command (String command, long maxTimeoutForCommand, TimeUnit timeUnit)
Komut davranışını kontrol etmek için daha fazla parametre içeren bir adb kabuk komutu yürütür.
parametreler | |
---|---|
command | String : çalıştırılacak adb shell komutu |
maxTimeoutForCommand | long : komutun tamamlanması için maksimum zaman aşımı; timeUnit belirtildiği gibi birim |
timeUnit | TimeUnit : maxTimeToOutputShellResponse için birim |
İadeler | |
---|---|
CommandResult |
atar | |
---|---|
DeviceNotAvailableException | cihazla bağlantı kesilirse ve kurtarılamazsa. |
Ayrıca bakınız:
yürütmekShellV2Komut
public abstract CommandResult executeShellV2Command (String command, File pipeAsInput, OutputStream pipeToOutput, long maxTimeoutForCommand, TimeUnit timeUnit, int retryAttempts)
Komut davranışını kontrol etmek için daha fazla parametre içeren bir adb kabuk komutu yürütür.
parametreler | |
---|---|
command | String : çalıştırılacak adb shell komutu |
pipeAsInput | File : Komuta girdi olarak aktarılacak bir ERROR(/File) veya boş. |
pipeToOutput | OutputStream : ERROR(/OutputStream) std çıktısının yeniden yönlendirileceği yer veya null. |
maxTimeoutForCommand | long : komutun tamamlanması için maksimum zaman aşımı; timeUnit belirtildiği gibi birim |
timeUnit | TimeUnit : maxTimeToOutputShellResponse için birim |
retryAttempts | int : bir istisna nedeniyle başarısız olursa, komutun yeniden denenmesi için maksimum sayı. RetryAttempts başarılı olmadan gerçekleştirilirse retryAttempts atılır. |
İadeler | |
---|---|
CommandResult |
atar | |
---|---|
DeviceNotAvailableException | cihazla bağlantı kesilirse ve kurtarılamazsa. |
Ayrıca bakınız:
yürütmekShellV2Komut
public abstract CommandResult executeShellV2Command (String command, File pipeAsInput, OutputStream pipeToOutput, OutputStream pipeToError, long maxTimeoutForCommand, TimeUnit timeUnit, int retryAttempts)
Komut davranışını kontrol etmek için daha fazla parametre içeren bir adb kabuk komutu yürütür.
parametreler | |
---|---|
command | String : çalıştırılacak adb shell komutu |
pipeAsInput | File : Komuta girdi olarak aktarılacak bir ERROR(/File) veya boş. |
pipeToOutput | OutputStream : ERROR(/OutputStream) std çıktısının yeniden yönlendirileceği yer veya null. |
pipeToError | OutputStream : ERROR(/OutputStream) std hatasının yeniden yönlendirileceği veya boş. |
maxTimeoutForCommand | long : komutun tamamlanması için maksimum zaman aşımı; timeUnit belirtildiği gibi birim |
timeUnit | TimeUnit : maxTimeToOutputShellResponse için birim |
retryAttempts | int : bir istisna nedeniyle başarısız olursa, komutun yeniden denenmesi için maksimum sayı. RetryAttempts başarılı olmadan gerçekleştirilirse retryAttempts atılır. |
İadeler | |
---|---|
CommandResult |
atar | |
---|---|
DeviceNotAvailableException | cihazla bağlantı kesilirse ve kurtarılamazsa. |
Ayrıca bakınız:
fastbootWipePartition
public abstract CommandResult fastbootWipePartition (String partition)
Aygıt için bir bölümü silen yardımcı yöntem.
getUseFastbootErase()
true
ise, bölümü silmek için fastboot silme kullanılacaktır. Aygıtın bir sonraki açılışında aygıtın bir dosya sistemi oluşturması gerekir. Aksi takdirde, cihazda yeni bir dosya sistemi oluşturacak olan fastboot formatı kullanılır. Cihaz zaten fastboot modundayken kullanılması bekleniyor.parametreler | |
---|---|
partition | String : silinecek bölüm |
İadeler | |
---|---|
CommandResult | komutun çıktısını içeren CommandResult |
atar | |
---|---|
DeviceNotAvailableException | cihazla bağlantı kesilirse ve kurtarılamazsa. |
getApiLevel
public abstract int getApiLevel ()
Cihaz API Düzeyini alın. Varsayılan olarak UNKNOWN_API_LEVEL
.
İadeler | |
---|---|
int | cihazın API Düzeyini gösteren bir tam sayı |
atar | |
---|---|
DeviceNotAvailableException |
getBasebandVersion
public abstract String getBasebandVersion ()
Bu cihazın temel bant (radyo) sürümünü elde etmek için kolaylık yöntemi. Telsiz sürümünün alınması cihaza özeldir, bu nedenle tüm cihazlar için doğru bilgileri döndürmeyebilir. Bu yöntem, doğru sürüm bilgilerini döndürmek için gsm.version.baseband özelliğine dayanır. Bu, bazı CDMA aygıtları için doğru değildir ve burada döndürülen sürüm, fastboot'tan bildirilen sürümle eşleşmeyebilir ve CDMA radyosu sürümünü döndürmeyebilir. TL;DR bu yöntem, yalnızca gsm.version.baseband özelliği fastboot getvar version-baseband
tarafından döndürülen sürümle aynıysa doğru sürümü bildirir.
İadeler | |
---|---|
String | String temel bant sürümü veya belirlenemiyorsa null (cihazın radyosu yok veya sürüm dizesi okunamıyor) |
atar | |
---|---|
DeviceNotAvailableException | cihazla bağlantı kesilirse ve kurtarılamazsa. |
pil almak
public abstract Integer getBattery ()
Bir aygıtın mevcut pil düzeyini veya pil düzeyi kullanılamıyorsa Null değerini döndürür.
İadeler | |
---|---|
Integer |
getBooleanProperty
public abstract boolean getBooleanProperty (String name, boolean defaultValue)
Verilen özelliğin boole değerini döndürür.
parametreler | |
---|---|
name | String : özellik adı |
defaultValue | boolean : özellik boşsa veya mevcut değilse döndürülecek varsayılan değer. |
İadeler | |
---|---|
boolean | özellik "1" , "y" , "yes" , "on" veya "true" true sahipse true , özellik "0" , "n" , "no" , "off" değerine sahipse false , "false" veya aksi takdirde defaultValue . |
atar | |
---|---|
DeviceNotAvailableException |
getBootHistory
public abstractgetBootHistory ()
Yardımcı yöntem, önyükleme geçmişi haritasını önyükleme zamanı ve önyükleme nedeni ile toplar.
İadeler | |
---|---|
Önyükleme süresi haritası (Epoch'tan bu yana saniye cinsinden UTC saati) ve önyükleme nedeni |
atar | |
---|---|
DeviceNotAvailableException |
getBootHistorySince
public abstractgetBootHistorySince (long utcEpochTime, TimeUnit timeUnit)
Yardımcı yöntem, cihazdan epoch'tan bu yana verilen zamandan ve belirtilen zaman biriminden itibaren önyükleme zamanı ve önyükleme nedeni ile önyükleme geçmişi haritasını toplar. Geçerli aygıt utcEpochTime, Milisaniye getDeviceDate()
yöntemiyle elde edilebilir.
parametreler | |
---|---|
utcEpochTime | long : Epoch'tan bu yana cihaz süresi. |
timeUnit | TimeUnit : zaman birimi TimeUnit . |
İadeler | |
---|---|
Önyükleme süresi haritası (Epoch'tan bu yana saniye cinsinden UTC saati) ve önyükleme nedeni |
atar | |
---|---|
DeviceNotAvailableException |
getBootloaderVersion
public abstract String getBootloaderVersion ()
Bu aygıtın önyükleyici sürümünü almak için kolaylık yöntemi.
Cihazın mevcut durumundan önyükleyici sürümünü almaya çalışacak. (yani cihaz fastboot modundaysa, fastboot'tan sürümü almaya çalışır)İadeler | |
---|---|
String | String önyükleyici sürümü veya bulunamazsa null |
atar | |
---|---|
DeviceNotAvailableException | cihazla bağlantı kesilirse ve kurtarılamazsa. |
getBugreport
public abstract InputStreamSource getBugreport ()
Cihazdan bir hata raporu alır.
Bunun uygulanmasının, sdcard'ı olmayan bir cihazda (veya sdcard'ın henüz takılı olmadığı durumlarda) çalışmaya devam etmesi garanti edilir.İadeler | |
---|---|
InputStreamSource | Talep üzerine hata raporu içeriğini üretecek bir InputStreamSource . Başarısızlık durumunda, InputStreamSource boş bir ERROR(/InputStream) üretecektir. |
getBugreportz
public abstract InputStreamSource getBugreportz ()
Cihazdan bir hata raporu alır. Zip biçimindeki hata raporu, ana hata raporunu ve hata ayıklama için yararlı olan diğer günlük dosyalarını içerir.
Yalnızca 'adb sürümü' > 1.0.36 için desteklenirİadeler | |
---|---|
InputStreamSource | bugreportz'u içeren zip dosyasının bir InputStreamSource , hata durumunda null değerini döndürür. |
getBuildAlias
public abstract String getBuildAlias ()
Aygıtın şu anda çalışmakta olduğu yapının diğer adını alın.
Derleme takma adı genellikle derleme kimliğinden daha okunabilir bir dizedir (genellikle Nexus derlemeleri için bir sayı). Örneğin, son Android 4.2 sürümünde derleme takma adı JDQ39 ve derleme kimliği 573038 vardır.
İadeler | |
---|---|
String | yapı takma adı veya alınamazsa yapı kimliğine geri dönün |
atar | |
---|---|
DeviceNotAvailableException |
getBuildFlavor
public abstract String getBuildFlavor ()
Aygıtın yapı lezzetini alın.
İadeler | |
---|---|
String | yapı aroması veya alınamazsa null |
atar | |
---|---|
DeviceNotAvailableException |
getBuildId
public abstract String getBuildId ()
Aygıtın şu anda çalışmakta olduğu yapıyı alın.
İadeler | |
---|---|
String | yapı kimliği veya IBuildInfo#UNKNOWN_BUILD_ID |
atar | |
---|---|
DeviceNotAvailableException |
getBuildSigningKeys
public abstract String getBuildSigningKeys ()
Aygıt görüntüsünü imzalamak için kullanılan anahtar türünü döndürür
Tipik olarak Android cihazlar, test anahtarlarıyla (AOSP'de olduğu gibi) veya serbest bırakma anahtarlarıyla (bireysel cihaz üreticileri tarafından kontrol edilir) imzalanabilir.
İadeler | |
---|---|
String | İmza anahtarı bulunursa, yoksa boş. |
atar | |
---|---|
DeviceNotAvailableException |
getCachedDeviceDescriptor
public abstract DeviceDescriptor getCachedDeviceDescriptor ()
Aygıt tahsis edilmişse önbelleğe alınmış bir DeviceDescriptor
, aksi takdirde geçerli DeviceDescriptor
döndürür.
İadeler | |
---|---|
DeviceDescriptor |
getCachedDeviceDescriptor
public abstract DeviceDescriptor getCachedDeviceDescriptor (boolean shortDescriptor)
Aygıt tahsis edilmişse önbelleğe alınmış bir DeviceDescriptor
, aksi takdirde geçerli DeviceDescriptor
döndürür.
parametreler | |
---|---|
shortDescriptor | boolean : Tanımlayıcının minimum minimum bilgiyle sınırlandırılıp sınırlandırılmayacağı |
İadeler | |
---|---|
DeviceDescriptor |
getChildren
public abstract String[] getChildren (String deviceFilePath)
İzinler nedeniyle bazen çalışmayan IFileEntry
alternatif.
parametreler | |
---|---|
deviceFilePath | String : cihazda aramanın yapılacağı yoldur |
İadeler | |
---|---|
String[] | Aygıttaki bir yoldaki tüm dosyayı içeren dize dizisi. |
atar | |
---|---|
DeviceNotAvailableException |
getDeviceClass
public abstract String getDeviceClass ()
Cihaz sınıfını alın.
İadeler | |
---|---|
String | String aygıt sınıfı. |
getDeviceDate
public abstract long getDeviceDate ()
Çağdan bu yana cihazın tarihini milisaniye cinsinden döndür.
İadeler | |
---|---|
long | çağ biçiminde cihazın tarihi. |
atar | |
---|---|
DeviceNotAvailableException |
getDeviceDescriptor
public abstract DeviceDescriptor getDeviceDescriptor ()
Gerçek cihaz nesnesini geçmeden bilgi almak için cihaz bilgisinden bir DeviceDescriptor
.
İadeler | |
---|---|
DeviceDescriptor |
getDeviceDescriptor
public abstract DeviceDescriptor getDeviceDescriptor (boolean shortDescriptor)
Gerçek cihaz nesnesini geçmeden bilgi almak için cihaz bilgisinden bir DeviceDescriptor
.
parametreler | |
---|---|
shortDescriptor | boolean : Tanımlayıcının minimum minimum bilgiyle sınırlandırılıp sınırlandırılmayacağı |
İadeler | |
---|---|
DeviceDescriptor |
getDeviceState
public abstract TestDeviceState getDeviceState ()
Cihazın durumunu alın.
İadeler | |
---|---|
TestDeviceState |
getDeviceTimeOffset
public abstract long getDeviceTimeOffset (Date date)
Cihaz ile belirli bir ERROR(/Date)
arasındaki zaman farkını almak için yardımcı. Epoch zamanını dahili olarak kullanın.
parametreler | |
---|---|
date | Date |
İadeler | |
---|---|
long | milisaniye cinsinden fark |
atar | |
---|---|
DeviceNotAvailableException |
getEmulatorOutput
public abstract InputStreamSource getEmulatorOutput ()
Öykünücü stdout ve stderr akışını alın
İadeler | |
---|---|
InputStreamSource | öykünücü çıkışı |
getExternalStoreFreeSpace
public abstract long getExternalStoreFreeSpace ()
Aygıtın harici deposundaki boş alan miktarını belirlemeye yönelik yardımcı yöntem.
İadeler | |
---|---|
long | KB cinsinden boş alan miktarı |
atar | |
---|---|
DeviceNotAvailableException | cihazla bağlantı kesilirse ve kurtarılamazsa. |
getFastbootÜrün Türü
public abstract String getFastbootProductType ()
Fastboot modundayken bu cihazın ürün türünü almak için kolaylık yöntemi.
Bu yöntem yalnızca cihazın hızlı önyüklemede olması gerekiyorsa kullanılmalıdır. Bu durumda genelgetProductType()
yönteminden biraz daha güvenli bir değişkendir, çünkü ITestDevice, cihaz yanlış durumdaysa veya yanıt vermiyorsa cihazı hızlı önyüklemeye kurtarmayı bilecektir.İadeler | |
---|---|
String | String ürün türü adı veya belirlenemezse null |
atar | |
---|---|
DeviceNotAvailableException | cihazla bağlantı kesilirse ve kurtarılamazsa. |
getFastbootProductVaryant
public abstract String getFastbootProductVariant ()
Fastboot modundayken bu cihazın ürün türünü almak için kolaylık yöntemi.
Bu yöntem yalnızca cihazın hızlı önyüklemede olması gerekiyorsa kullanılmalıdır. Bu durumda genelgetProductType()
yönteminden biraz daha güvenli bir değişkendir, çünkü ITestDevice, cihaz yanlış durumdaysa veya yanıt vermiyorsa cihazı hızlı önyüklemeye kurtarmayı bilecektir.İadeler | |
---|---|
String | String ürün türü adı veya belirlenemezse null |
atar | |
---|---|
DeviceNotAvailableException | cihazla bağlantı kesilirse ve kurtarılamazsa. |
getFastbootSeri Numarası
public abstract String getFastbootSerialNumber ()
Fastboot modu seri numarasını döndürür.
İadeler | |
---|---|
String |
getFastbootDeğişken
public abstract String getFastbootVariable (String variableName)
Cihazdan verilen fastboot değişken değerini alın.
parametreler | |
---|---|
variableName | String : değişken adı |
İadeler | |
---|---|
String | özellik değeri veya yoksa null |
atar | |
---|---|
| DesteklenmeyenOperationException |
DeviceNotAvailableException |
getFileEntry
public abstract IFileEntry getFileEntry (String path)
Cihazdaki uzak bir dosyaya referans alın.
parametreler | |
---|---|
path | String : alınacak dosya yolu. '/' ile ilgili mutlak bir yol veya yol olabilir. (yani hem "/system" hem de "system" sözdizimi desteklenir) |
İadeler | |
---|---|
IFileEntry | verilen path dosya bulunamazsa, IFileEntry veya null |
atar | |
---|---|
DeviceNotAvailableException |
getIDevice
public abstract IDevice getIDevice ()
İlişkili ddmlib IDevice
bir başvuru döndürür.
IDevice
tahsis edilebilir. Bu nedenle, arayanlar IDevice
için bir referans tutmamalıdır, çünkü bu referans bayatlayabilir.İadeler | |
---|---|
IDevice | IDevice |
getIntProperty
public abstract long getIntProperty (String name, long defaultValue)
Aygıttan verilen özelliğin tamsayı değerini döndürür.
parametreler | |
---|---|
name | String : özellik adı |
defaultValue | long : özellik boşsa veya mevcut değilse döndürülecek varsayılan değer. |
İadeler | |
---|---|
long | özellik değeri veya özellik boşsa, mevcut değilse veya bir tamsayı değerine sahip değilse defaultValue . |
atar | |
---|---|
DeviceNotAvailableException |
getLastExpectedRebootTimeMillis
public abstract long getLastExpectedRebootTimeMillis ()
System.currentTimeMillis()
tarafından döndürüldüğü gibi, Tradefed API'lerinin EPOCH'tan bu yana milisaniye cinsinden bir yeniden başlatmayı en son tetiklediği zamanı döndürür.
İadeler | |
---|---|
long |
getLaunchApiLevel
public abstract int getLaunchApiLevel ()
Cihazın ilk başlatılan API Düzeyini edinin. Varsayılan olarak UNKNOWN_API_LEVEL
.
İadeler | |
---|---|
int | cihazın ilk başlatılan API Düzeyini gösteren bir tam sayı |
atar | |
---|---|
DeviceNotAvailableException |
getLogcat
public abstract InputStreamSource getLogcat ()
Logcat verilerinin anlık görüntü akışını alır.
İki modda çalışır:
TestDeviceOptions.getMaxLogcatDataSize()
baytına kadar dönecektir.İadeler | |
---|---|
InputStreamSource |
getLogcat
public abstract InputStreamSource getLogcat (int maxBytes)
Yakalanan logcat verilerinin son maxBytes
anlık görüntü akışını alır.
Tüm getLogcat()
anlık görüntüsünü almanın potansiyel olarak büyük disk alanı cezasına maruz kalmadan yakalanan logcat verilerinin sık anlık görüntülerini yakalamak istediğiniz durumlar için kullanışlıdır.
parametreler | |
---|---|
maxBytes | int : döndürülecek maksimum veri miktarı. Should be an amount that can comfortably fit in memory |
İadeler | |
---|---|
InputStreamSource |
getLogcatDump
public abstract InputStreamSource getLogcatDump ()
Get a dump of the current logcat for device. Unlike getLogcat()
, this method will always return a static dump of the logcat.
Has the disadvantage that nothing will be returned if device is not reachable.
İadeler | |
---|---|
InputStreamSource | a InputStreamSource of the logcat data. An empty stream is returned if fail to capture logcat data. |
getLogcatSince
public abstract InputStreamSource getLogcatSince (long date)
Grabs a snapshot stream of captured logcat data starting the date provided. The time on the device should be used getDeviceDate()
.
parametreler | |
---|---|
date | long : in millisecond since epoch format of when to start the snapshot until present. (can be be obtained using 'date +%s') |
İadeler | |
---|---|
InputStreamSource |
getMountPoint
public abstract String getMountPoint (String mountName)
Returns a mount point.
Queries the device directly if the cached info inIDevice
is not available. TODO: move this behavior to IDevice#getMountPoint(String)
parametreler | |
---|---|
mountName | String : the name of the mount point |
İadeler | |
---|---|
String | the mount point or null |
See also:
getMountPointInfo
public abstract ITestDevice.MountPointInfo getMountPointInfo (String mountpoint)
Returns a MountPointInfo
corresponding to the specified mountpoint path, or null
if that path has nothing mounted or otherwise does not appear in /proc/mounts as a mountpoint.
parametreler | |
---|---|
mountpoint | String |
İadeler | |
---|---|
ITestDevice.MountPointInfo | A ERROR(/List) of MountPointInfo containing the information in "/proc/mounts" |
atar | |
---|---|
DeviceNotAvailableException |
See also:
getMountPointInfo
public abstractgetMountPointInfo ()
Returns a parsed version of the information in /proc/mounts on the device
İadeler | |
---|---|
A ERROR(/List) of MountPointInfo containing the information in "/proc/mounts" |
atar | |
---|---|
DeviceNotAvailableException |
getPartitionFreeSpace
public abstract long getPartitionFreeSpace (String partition)
Helper method to determine amount of free space on device partition.
parametreler | |
---|---|
partition | String |
İadeler | |
---|---|
long | the amount of free space in KB |
atar | |
---|---|
DeviceNotAvailableException | if connection with device is lost and cannot be recovered. |
getProcessByName
public abstract ProcessInfo getProcessByName (String processName)
Helper method runs the "pidof" and "stat" command and returns ProcessInfo
object with PID and process start time of the given process.
parametreler | |
---|---|
processName | String : the proces name String. |
İadeler | |
---|---|
ProcessInfo | ProcessInfo of given processName |
atar | |
---|---|
DeviceNotAvailableException |
getProcessPid
public abstract String getProcessPid (String process)
Returns the pid of the service or null if something went wrong.
parametreler | |
---|---|
process | String : The proces name String. |
İadeler | |
---|---|
String |
atar | |
---|---|
DeviceNotAvailableException |
getProductType
public abstract String getProductType ()
Convenience method to get the product type of this device.
This method will work if device is in either adb or fastboot mode.İadeler | |
---|---|
String | the String product type name. Will not be null |
atar | |
---|---|
DeviceNotAvailableException | if connection with device is lost and cannot be recovered, or if product type can not be determined |
getProductVariant
public abstract String getProductVariant ()
Convenience method to get the product variant of this device.
This method will work if device is in either adb or fastboot mode.İadeler | |
---|---|
String | the String product variant name or null if it cannot be determined |
atar | |
---|---|
DeviceNotAvailableException | if connection with device is lost and cannot be recovered. |
getProperty
public abstract String getProperty (String name)
Retrieve the given property value from the device.
parametreler | |
---|---|
name | String : the property name |
İadeler | |
---|---|
String | the property value or null if it does not exist |
atar | |
---|---|
DeviceNotAvailableException |
getRecoveryMode
public abstract ITestDevice.RecoveryMode getRecoveryMode ()
Get the current recovery mode used for the device.
İadeler | |
---|---|
ITestDevice.RecoveryMode | the current recovery mode used for the device. |
getSerialNumber
public abstract String getSerialNumber ()
Convenience method to get serial number of this device.
İadeler | |
---|---|
String | the String serial number |
getTombstones
public abstractgetTombstones ()
Fetch and return the list of tombstones from the devices. Requires root.
method is best-effort so if one tombstone fails to be pulled for any reason it will be missing from the list. Only a DeviceNotAvailableException
will terminate the method early.
İadeler | |
---|---|
A list of tombstone files, empty if no tombstone. |
atar | |
---|---|
DeviceNotAvailableException |
See also:
getTotalMemory
public abstract long getTotalMemory ()
Returns total physical memory size in bytes or -1 in case of internal error
İadeler | |
---|---|
long |
getUseFastbootErase
public abstract boolean getUseFastbootErase ()
Get whether to use fastboot erase or fastboot format to wipe a partition on the device.
İadeler | |
---|---|
boolean | true if fastboot erase will be used or false if fastboot format will be used. |
See also:
isAdbRoot
public abstract boolean isAdbRoot ()
İadeler | |
---|---|
boolean | true if device currently has adb root, false otherwise. |
atar | |
---|---|
DeviceNotAvailableException | if connection with device is lost and cannot be recovered. |
isAdbTcp
public abstract boolean isAdbTcp ()
İadeler | |
---|---|
boolean | true if device is connected to adb-over-tcp, false otherwise. |
isAppEnumerationSupported
public abstract boolean isAppEnumerationSupported ()
Check whether platform on device supports app enumeration
İadeler | |
---|---|
boolean | True if app enumeration is supported, false otherwise |
atar | |
---|---|
DeviceNotAvailableException |
isDeviceEncrypted
public abstract boolean isDeviceEncrypted ()
Returns if the device is encrypted.
İadeler | |
---|---|
boolean | true if the device is encrypted. |
atar | |
---|---|
DeviceNotAvailableException | if connection with device is lost and cannot be recovered. |
isDirectory
public abstract boolean isDirectory (String deviceFilePath)
Return True if the path on the device is a directory, false otherwise.
parametreler | |
---|---|
deviceFilePath | String |
İadeler | |
---|---|
boolean |
atar | |
---|---|
DeviceNotAvailableException |
isEncryptionSupported
public abstract boolean isEncryptionSupported ()
Returns if encryption is supported on the device.
İadeler | |
---|---|
boolean | true if the device supports encryption. |
atar | |
---|---|
DeviceNotAvailableException |
isExecutable
public abstract boolean isExecutable (String fullPath)
Returns True if the file path on the device is an executable file, false otherwise.
parametreler | |
---|---|
fullPath | String |
İadeler | |
---|---|
boolean |
atar | |
---|---|
DeviceNotAvailableException |
isHeadless
public abstract boolean isHeadless ()
Return true if the device is headless (no screen), false otherwise.
İadeler | |
---|---|
boolean |
atar | |
---|---|
DeviceNotAvailableException |
isRuntimePermissionSupported
public abstract boolean isRuntimePermissionSupported ()
Check whether platform on device supports runtime permission granting
İadeler | |
---|---|
boolean | True if runtime permission are supported, false otherwise. |
atar | |
---|---|
DeviceNotAvailableException |
isStateBootloaderOrFastbootd
public abstract boolean isStateBootloaderOrFastbootd ()
Returns true if device is in TestDeviceState#FASTBOOT
or TestDeviceState.FASTBOOTD
.
İadeler | |
---|---|
boolean |
logAnrs
public abstract boolean logAnrs (ITestLogger logger)
Collects and log ANRs from the device.
parametreler | |
---|---|
logger | ITestLogger : an ITestLogger to log the ANRs. |
İadeler | |
---|---|
boolean | True if the logging was successful, false otherwise. |
atar | |
---|---|
DeviceNotAvailableException |
logBugreport
public abstract boolean logBugreport (String dataName, ITestLogger listener)
Helper method to take a bugreport and log it to the reporters.
parametreler | |
---|---|
dataName | String : name under which the bugreport will be reported. |
listener | ITestLogger : an ITestLogger to log the bugreport. |
İadeler | |
---|---|
boolean | True if the logging was successful, false otherwise. |
logOnDevice
public abstract void logOnDevice (String tag, Log.LogLevel level, String format, Object... args)
Log a message in the logcat of the device. This is a safe call that will not throw even if the logging fails.
parametreler | |
---|---|
tag | String : The tag under which we log our message in the logcat. |
level | Log.LogLevel : The debug level of the message in the logcat. |
format | String : The message format. |
args | Object : the args to be replaced via String.format(). |
nonBlockingReboot
public abstract void nonBlockingReboot ()
Issues a command to reboot device and returns on command complete and when device is no longer visible to adb.
atar | |
---|---|
DeviceNotAvailableException |
postBootSetup
public abstract void postBootSetup ()
Perform instructions to configure device for testing that after every boot.
Should be called after device is fully booted/available In normal circumstances this method doesn't need to be called explicitly, as implementations should perform these steps automatically when performing a reboot. Where it may need to be called is when device reboots due to other events (eg when a fastboot update command has completed)atar | |
---|---|
DeviceNotAvailableException | if connection with device is lost and cannot be recovered. |
postInvocationTearDown
public void postInvocationTearDown ()
Bu yöntem kullanımdan kaldırılmıştır.
Use postInvocationTearDown(Throwable)
instead.
Extra steps for device specific required clean up that will be executed after the invocation is done.
postInvocationTearDown
public abstract void postInvocationTearDown (Throwable invocationException)
Extra steps for device specific required clean up that will be executed after the invocation is done.
parametreler | |
---|---|
invocationException | Throwable : if any, the final exception raised by the invocation failure. |
preInvocationSetup
public void preInvocationSetup (IBuildInfo info, MultiMap<String, String> attributes)
Extra steps for device specific required setup that will be executed on the device prior to the invocation flow.
parametreler | |
---|---|
info | IBuildInfo : The IBuildInfo of the device. |
attributes | MultiMap : The attributes stored in the invocation context |
atar | |
---|---|
| com.android.tradefed.targetprep.TargetSetupError |
DeviceNotAvailableException | |
TargetSetupError |
pullDir
public abstract boolean pullDir (String deviceFilePath, File localDir)
Recursively pull directory contents from device.
parametreler | |
---|---|
deviceFilePath | String : the absolute file path of the remote source |
localDir | File : the local directory to pull files into |
İadeler | |
---|---|
boolean | true if file was pulled successfully. false otherwise. |
atar | |
---|---|
DeviceNotAvailableException | if connection with device is lost and cannot be recovered. |
pullFile
public abstract File pullFile (String remoteFilePath, int userId)
Retrieves a file off device, stores it in a local temporary ERROR(/File)
, and returns that File
.
parametreler | |
---|---|
remoteFilePath | String : the absolute path to file on device. |
userId | int : The user id to pull from |
İadeler | |
---|---|
File | A ERROR(/File) containing the contents of the device file, or null if the copy failed for any reason (including problems with the host filesystem) |
atar | |
---|---|
DeviceNotAvailableException | if connection with device is lost and cannot be recovered. |
pullFile
public abstract File pullFile (String remoteFilePath)
Retrieves a file off device, stores it in a local temporary ERROR(/File)
, and returns that File
.
parametreler | |
---|---|
remoteFilePath | String : the absolute path to file on device. |
İadeler | |
---|---|
File | A ERROR(/File) containing the contents of the device file, or null if the copy failed for any reason (including problems with the host filesystem) |
atar | |
---|---|
DeviceNotAvailableException | if connection with device is lost and cannot be recovered. |
pullFile
public abstract boolean pullFile (String remoteFilePath, File localFile)
Retrieves a file off device.
parametreler | |
---|---|
remoteFilePath | String : the absolute path to file on device. |
localFile | File : the local file to store contents in. If non-empty, contents will be replaced. |
İadeler | |
---|---|
boolean | true if file was retrieved successfully. false otherwise. |
atar | |
---|---|
DeviceNotAvailableException | if connection with device is lost and cannot be recovered. |
pullFile
public abstract boolean pullFile (String remoteFilePath, File localFile, int userId)
Retrieves a file off device.
parametreler | |
---|---|
remoteFilePath | String : the absolute path to file on device. |
localFile | File : the local file to store contents in. If non-empty, contents will be replaced. |
userId | int : The user id to pull from |
İadeler | |
---|---|
boolean | true if file was retrieved successfully. false otherwise. |
atar | |
---|---|
DeviceNotAvailableException | if connection with device is lost and cannot be recovered. |
pullFileContents
public abstract String pullFileContents (String remoteFilePath)
Retrieves a file off device, and returns the contents.
parametreler | |
---|---|
remoteFilePath | String : the absolute path to file on device. |
İadeler | |
---|---|
String | A String containing the contents of the device file, or null if the copy failed for any reason (including problems with the host filesystem) |
atar | |
---|---|
DeviceNotAvailableException |
pullFileFromExternal
public abstract File pullFileFromExternal (String remoteFilePath)
A convenience method to retrieve a file from the device's external storage, stores it in a local temporary ERROR(/File)
, and return a reference to that File
.
parametreler | |
---|---|
remoteFilePath | String : the path to file on device, relative to the device's external storage mountpoint |
İadeler | |
---|---|
File | A ERROR(/File) containing the contents of the device file, or null if the copy failed for any reason (including problems with the host filesystem) |
atar | |
---|---|
DeviceNotAvailableException | if connection with device is lost and cannot be recovered. |
pushDir
public abstract boolean pushDir (File localDir, String deviceFilePath,excludedDirectories)
Recursively push directory contents to device while excluding some directories that are filtered.
parametreler | |
---|---|
localDir | File : the local directory to push |
deviceFilePath | String : the absolute file path of the remote destination |
excludedDirectories |
İadeler | |
---|---|
boolean | true if file was pushed successfully. false otherwise. |
atar | |
---|---|
DeviceNotAvailableException | if connection with device is lost and cannot be recovered. |
pushDir
public abstract boolean pushDir (File localDir, String deviceFilePath)
Recursively push directory contents to device.
parametreler | |
---|---|
localDir | File : the local directory to push |
deviceFilePath | String : the absolute file path of the remote destination |
İadeler | |
---|---|
boolean | true if file was pushed successfully. false otherwise. |
atar | |
---|---|
DeviceNotAvailableException | if connection with device is lost and cannot be recovered. |
pushFile
public abstract boolean pushFile (File localFile, String deviceFilePath, boolean evaluateContentProviderNeeded)
Variant of pushFile(File, String)
which can optionally consider evaluating the need for the content provider.
parametreler | |
---|---|
localFile | File : the local file to push |
deviceFilePath | String : the remote destination absolute file path |
evaluateContentProviderNeeded | boolean : whether to check if we need the content provider |
İadeler | |
---|---|
boolean | true if file was pushed successfully. false otherwise. |
atar | |
---|---|
DeviceNotAvailableException | if connection with device is lost and cannot be recovered. |
pushFile
public abstract boolean pushFile (File localFile, String deviceFilePath)
Push a file to device. By default using a content provider.
parametreler | |
---|---|
localFile | File : the local file to push |
deviceFilePath | String : the remote destination absolute file path |
İadeler | |
---|---|
boolean | true if file was pushed successfully. false otherwise. |
atar | |
---|---|
DeviceNotAvailableException | if connection with device is lost and cannot be recovered. |
pushString
public abstract boolean pushString (String contents, String deviceFilePath)
Push file created from a string to device
parametreler | |
---|---|
contents | String : the contents of the file to push |
deviceFilePath | String : the remote destination absolute file path |
İadeler | |
---|---|
boolean | true if string was pushed successfully. false otherwise. |
atar | |
---|---|
DeviceNotAvailableException | if connection with device is lost and cannot be recovered. |
reboot
public abstract void reboot ()
Reboots the device into adb mode.
Blocks until device becomes available.atar | |
---|---|
DeviceNotAvailableException | if device is not available after reboot |
reboot
public abstract void reboot (String reason)
Reboots the device into adb mode with given reason
to be persisted across reboot.
Blocks until device becomes available.
Last reboot reason can be obtained by querying sys.boot.reason
propety.
parametreler | |
---|---|
reason | String : a reason for this reboot, or null if no reason is specified. |
atar | |
---|---|
DeviceNotAvailableException | if device is not available after reboot |
rebootIntoBootloader
public abstract void rebootIntoBootloader ()
Reboots the device into bootloader mode.
Blocks until device is in bootloader mode.atar | |
---|---|
DeviceNotAvailableException | if connection with device is lost and cannot be recovered. |
rebootIntoFastbootd
public abstract void rebootIntoFastbootd ()
Reboots the device into fastbootd mode.
Blocks until device is in fastbootd mode.
atar | |
---|---|
DeviceNotAvailableException | if connection with device is lost and cannot be recovered. |
rebootIntoRecovery
public abstract void rebootIntoRecovery ()
Reboots the device into adb recovery mode.
Blocks until device enters recoveryatar | |
---|---|
DeviceNotAvailableException | if device is not available after reboot |
rebootIntoSideload
public abstract void rebootIntoSideload (boolean autoReboot)
Reboots the device into adb sideload mode (note that this is a special mode under recovery)
Blocks until device enters sideload mode
parametreler | |
---|---|
autoReboot | boolean : whether to automatically reboot the device after sideload |
atar | |
---|---|
DeviceNotAvailableException | if device is not in sideload after reboot |
rebootIntoSideload
public abstract void rebootIntoSideload ()
Reboots the device into adb sideload mode (note that this is a special mode under recovery)
Blocks until device enters sideload mode
atar | |
---|---|
DeviceNotAvailableException | if device is not in sideload after reboot |
rebootUntilOnline
public abstract void rebootUntilOnline ()
An alternate to reboot()
that only blocks until device is online ie visible to adb.
atar | |
---|---|
DeviceNotAvailableException | if device is not available after reboot |
rebootUntilOnline
public abstract void rebootUntilOnline (String reason)
An alternate to reboot()
that only blocks until device is online ie visible to adb.
parametreler | |
---|---|
reason | String : a reason for this reboot, or null if no reason is specified. |
atar | |
---|---|
DeviceNotAvailableException | if device is not available after reboot |
See also:
rebootUserspace
public abstract void rebootUserspace ()
Reboots only userspace part of device.
Blocks until device becomes available.
WARNING. Userspace reboot is currently under active development, use it on your own risk.
atar | |
---|---|
DeviceNotAvailableException | if device is not available after reboot |
rebootUserspaceUntilOnline
public abstract void rebootUserspaceUntilOnline ()
An alternate to rebootUserspace()
()} that only blocks until device is online ie visible to adb.
atar | |
---|---|
DeviceNotAvailableException | if device is not available after reboot |
remountSystemWritable
public abstract void remountSystemWritable ()
Make the system partition on the device writable. May reboot the device.
atar | |
---|---|
DeviceNotAvailableException |
remountVendorWritable
public abstract void remountVendorWritable ()
Make the vendor partition on the device writable. May reboot the device.
atar | |
---|---|
DeviceNotAvailableException |
runInstrumentationTests
public abstract boolean runInstrumentationTests (IRemoteAndroidTestRunner runner, ITestLifeCycleReceiver... listeners)
Convenience method for performing ERROR(/#runInstrumentationTests(com.android.ddmlib.testrunner.IRemoteAndroidTestRunner,Collection))
with one or more listeners passed as parameters.
parametreler | |
---|---|
runner | IRemoteAndroidTestRunner : the IRemoteAndroidTestRunner which runs the tests |
listeners | ITestLifeCycleReceiver : the test result listener(s) |
İadeler | |
---|---|
boolean | true if test command completed. false if it failed to complete, but recovery succeeded |
atar | |
---|---|
DeviceNotAvailableException | if connection with device is lost and cannot be recovered. ie test command failed to complete and recovery failed. |
runInstrumentationTests
public abstract boolean runInstrumentationTests (IRemoteAndroidTestRunner runner,listeners)
Runs instrumentation tests, and provides device recovery.
If connection with device is lost before test run completes, and recovery succeeds, all listeners will be informed of testRunFailed and "false" will be returned. The test command will not be rerun. It is left to callers to retry if necessary.
If connection with device is lost before test run completes, and recovery fails, all listeners will be informed of testRunFailed and DeviceNotAvailableException will be thrown.
parametreler | |
---|---|
runner | IRemoteAndroidTestRunner : the IRemoteAndroidTestRunner which runs the tests |
listeners |
İadeler | |
---|---|
boolean | true if test command completed. false if it failed to complete due to device communication exception, but recovery succeeded |
atar | |
---|---|
DeviceNotAvailableException | if connection with device is lost and cannot be recovered. ie test command failed to complete and recovery failed. |
runInstrumentationTestsAsUser
public abstract boolean runInstrumentationTestsAsUser (IRemoteAndroidTestRunner runner, int userId, ITestLifeCycleReceiver... listeners)
Same as ITestDevice#runInstrumentationTests(IRemoteAndroidTestRunner, ITestLifeCycleReceiver...)
but runs the test for a given user.
parametreler | |
---|---|
runner | IRemoteAndroidTestRunner |
userId | int |
listeners | ITestLifeCycleReceiver |
İadeler | |
---|---|
boolean |
atar | |
---|---|
DeviceNotAvailableException |
runInstrumentationTestsAsUser
public abstract boolean runInstrumentationTestsAsUser (IRemoteAndroidTestRunner runner, int userId,listeners)
Same as ERROR(ITestDevice#runInstrumentationTests(IRemoteAndroidTestRunner, Collection)/com.android.tradefed.device.ITestDevice#runInstrumentationTests(com.android.ddmlib.testrunner.IRemoteAndroidTestRunner,Collection) ITestDevice#runInstrumentationTests(IRemoteAndroidTestRunner, Collection))
but runs the test for the given user.
parametreler | |
---|---|
runner | IRemoteAndroidTestRunner |
userId | int |
listeners |
İadeler | |
---|---|
boolean |
atar | |
---|---|
DeviceNotAvailableException |
setDate
public abstract void setDate (Date date)
Sets the date on device
Note: setting date on device requires root
parametreler | |
---|---|
date | Date : specify a particular date; will use host date if null |
atar | |
---|---|
DeviceNotAvailableException |
setOptions
public abstract void setOptions (TestDeviceOptions options)
Set the TestDeviceOptions
for the device
parametreler | |
---|---|
options | TestDeviceOptions |
setProperty
public abstract boolean setProperty (String propKey, String propValue)
Sets the given property value on the device. Requires adb root is true.
parametreler | |
---|---|
propKey | String : The key targeted to be set. |
propValue | String : The property value to be set. |
İadeler | |
---|---|
boolean | returns True if the setprop command was successful, False otherwise. |
atar | |
---|---|
DeviceNotAvailableException |
setRecovery
public abstract void setRecovery (IDeviceRecovery recovery)
Set the IDeviceRecovery
to use for this device. Should be set when device is first allocated.
parametreler | |
---|---|
recovery | IDeviceRecovery : the IDeviceRecovery |
setRecoveryMode
public abstract void setRecoveryMode (ITestDevice.RecoveryMode mode)
Set the current recovery mode to use for the device.
Used to control what recovery method to use when a device communication problem is encountered. Its recommended to only use this method sparingly when needed (for example, when framework is down, etcparametreler | |
---|---|
mode | ITestDevice.RecoveryMode : whether 'recover till online only' mode should be on or not. |
setUseFastbootErase
public abstract void setUseFastbootErase (boolean useFastbootErase)
Set whether to use fastboot erase or fastboot format to wipe a partition on the device.
parametreler | |
---|---|
useFastbootErase | boolean : true if fastboot erase should be used or false if fastboot format should be used. |
See also:
startLogcat
public abstract void startLogcat ()
Start capturing logcat output from device in the background.
Will have no effect if logcat output is already being captured. Data can be later retrieved via getLogcat. When the device is no longer in use,stopLogcat()
must be called. startLogcat()
and stopLogcat()
do not normally need to be called when within a TF invocation context, as the TF framework will start and stop logcat.stopEmulatorOutput
public abstract void stopEmulatorOutput ()
Close and delete the emulator output.
stopLogcat
public abstract void stopLogcat ()
Stop capturing logcat output from device, and discard currently saved logcat data.
Will have no effect if logcat output is not being captured.switchToAdbTcp
public abstract String switchToAdbTcp ()
Switch device to adb-over-tcp mode.
İadeler | |
---|---|
String | the tcp serial number or null if device could not be switched |
atar | |
---|---|
DeviceNotAvailableException |
switchToAdbUsb
public abstract boolean switchToAdbUsb ()
Switch device to adb over usb mode.
İadeler | |
---|---|
boolean | true if switch was successful, false otherwise. |
atar | |
---|---|
DeviceNotAvailableException |
syncFiles
public abstract boolean syncFiles (File localFileDir, String deviceFilePath)
Incrementally syncs the contents of a local file directory to device.
Decides which files to push by comparing timestamps of local files with their remote equivalents. Only 'newer' or non-existent files will be pushed to device. Thus overhead should be relatively small if file set on device is already up to date. Hidden files (with names starting with ".") will be ignored. Example usage: syncFiles("/tmp/files", "/sdcard") will created a /sdcard/files directory if it doesn't already exist, and recursively push the /tmp/files contents to /sdcard/files.parametreler | |
---|---|
localFileDir | File : the local file directory containing files to recursively push. |
deviceFilePath | String : the remote destination absolute file path root. All directories in thos file path must be readable. ie pushing to /data/local/tmp when adb is not root will fail |
İadeler | |
---|---|
boolean | true if files were synced successfully. false otherwise. |
atar | |
---|---|
DeviceNotAvailableException | if connection with device is lost and cannot be recovered. |
takeBugreport
public abstract Bugreport takeBugreport ()
Take a bugreport and returns it inside a Bugreport
object to handle it. Return null in case of issue.
Bugreport#close()
.İadeler | |
---|---|
Bugreport |
unlockDevice
public abstract boolean unlockDevice ()
Unlocks the device if the device is in an encrypted state.
This method may restart the framework but will not callpostBootSetup()
. Therefore, the device might not be fully ready to be tested when this method returns.İadeler | |
---|---|
boolean | true if successful or if the device is unencrypted. |
atar | |
---|---|
DeviceNotAvailableException | if connection with device is lost and cannot be recovered. |
UnsupportedOperationException | if encryption is not supported on the device. |
waitForBootComplete
public abstract boolean waitForBootComplete (long timeOut)
Blocks until the device's boot complete flag is set.
parametreler | |
---|---|
timeOut | long : time in msecs to wait for the flag to be set |
İadeler | |
---|---|
boolean | true if device's boot complete flag is set within the timeout |
atar | |
---|---|
DeviceNotAvailableException |
waitForDeviceAvailable
public abstract boolean waitForDeviceAvailable ()
Waits for the device to be responsive and available for testing. Uses default timeout.
İadeler | |
---|---|
boolean | True if device is available, False if recovery is disabled and unavailable. |
atar | |
---|---|
DeviceNotAvailableException | if connection with device is lost and cannot be recovered. |
waitForDeviceAvailable
public abstract boolean waitForDeviceAvailable (long waitTime)
Waits for the device to be responsive and available for testing.
parametreler | |
---|---|
waitTime | long : the time in ms to wait |
İadeler | |
---|---|
boolean | True if device is available, False if recovery is disabled and unavailable. |
atar | |
---|---|
DeviceNotAvailableException | if device is still unresponsive after waitTime expires. |
waitForDeviceBootloader
public abstract void waitForDeviceBootloader ()
Blocks until device is visible via fastboot. Use default timeout.
atar | |
---|---|
DeviceNotAvailableException | if connection with device is lost and cannot be recovered. |
waitForDeviceInRecovery
public abstract boolean waitForDeviceInRecovery (long waitTime)
Blocks for the device to be in the 'adb recovery' state (note this is distinct from IDeviceRecovery
).
parametreler | |
---|---|
waitTime | long : the time in ms to wait |
İadeler | |
---|---|
boolean | true if device boots into recovery before time expires. false otherwise |
waitForDeviceInSideload
public abstract boolean waitForDeviceInSideload (long waitTime)
Blocks for the device to be in the 'adb sideload' state
parametreler | |
---|---|
waitTime | long : the time in ms to wait |
İadeler | |
---|---|
boolean | true if device boots into sideload before time expires. false otherwise |
waitForDeviceNotAvailable
public abstract boolean waitForDeviceNotAvailable (long waitTime)
Blocks for the device to be not available ie missing from adb
parametreler | |
---|---|
waitTime | long : the time in ms to wait |
İadeler | |
---|---|
boolean | true if device becomes not available before time expires. false otherwise |
waitForDeviceOnline
public abstract void waitForDeviceOnline ()
Blocks until device is visible via adb. Uses default timeout
Note the device may not necessarily be responsive to commands on completion. UsewaitForDeviceAvailable()
instead.atar | |
---|---|
DeviceNotAvailableException | if connection with device is lost and cannot be recovered. |
waitForDeviceOnline
public abstract void waitForDeviceOnline (long waitTime)
Blocks until device is visible via adb.
Note the device may not necessarily be responsive to commands on completion. UsewaitForDeviceAvailable()
instead.parametreler | |
---|---|
waitTime | long : the time in ms to wait |
atar | |
---|---|
DeviceNotAvailableException | if connection with device is lost and cannot be recovered. |
waitForDeviceShell
public abstract boolean waitForDeviceShell (long waitTime)
Waits for device to be responsive to a basic adb shell command.
parametreler | |
---|---|
waitTime | long : the time in ms to wait |
İadeler | |
---|---|
boolean | true if device becomes responsive before waitTime elapses. |