À partir du 27 mars 2025, nous vous recommandons d'utiliser android-latest-release
au lieu de aosp-main
pour créer et contribuer à AOSP. Pour en savoir plus, consultez la section Modifications apportées à AOSP.
Restez organisé à l'aide des collections
Enregistrez et classez les contenus selon vos préférences.
StubDevice
public
class
StubDevice
extends Object
implements
IDevice
java.lang.Object
|
↳ |
com.android.tradefed.device.StubDevice
|
Sous-classes directes connues
|
Implémentation d'espace réservé de simulation d'un IDevice
.
Résumé
Méthodes publiques |
boolean
|
arePropertiesSet()
|
void
|
createForward(int localPort, String remoteSocketName, IDevice.DeviceUnixSocketNamespace namespace)
|
void
|
createForward(int localPort, int remotePort)
|
void
|
createReverse(int remotePort, int localPort)
|
void
|
executeShellCommand(String command, IShellOutputReceiver receiver, long maxTimeToOutputResponse, TimeUnit maxTimeUnits)
|
void
|
executeShellCommand(String command, IShellOutputReceiver receiver)
|
void
|
executeShellCommand(String command, IShellOutputReceiver receiver, int maxTimeToOutputResponse)
Cette méthode est obsolète.
utiliser executeShellCommand(String, com.android.ddmlib.IShellOutputReceiver, long, TimeUnit) .
|
void
|
executeShellCommand(String command, IShellOutputReceiver receiver, long maxTimeout, long maxTimeToOutputResponse, TimeUnit maxTimeUnits)
|
|
getAbis()
|
String
|
getAvdName()
|
String
|
getAvdPath()
|
|
getBattery(long freshnessTime, TimeUnit timeUnit)
|
|
getBattery()
|
Integer
|
getBatteryLevel(long freshnessMs)
Cette méthode est obsolète.
Utilisez plutôt getBattery(long, TimeUnit) .
|
Integer
|
getBatteryLevel()
Cette méthode est obsolète.
Utilisez plutôt getBattery() .
|
Client
|
getClient(String applicationName)
|
String
|
getClientName(int pid)
|
Client[]
|
getClients()
|
int
|
getDensity()
|
FileListingService
|
getFileListingService()
|
String
|
getLanguage()
|
String
|
getMountPoint(String name)
|
String
|
getName()
|
|
getProperties()
Cette méthode est obsolète.
Utilisez plutôt getSystemProperty(String) .
|
String
|
getProperty(String name)
|
String
|
getPropertyCacheOrSync(String name)
Cette méthode est obsolète.
Utilisez plutôt getProperty(String) .
|
int
|
getPropertyCount()
Cette méthode est obsolète.
obsolète dans ddmlib avec "détail de l'implémentation" comme motif.
|
String
|
getPropertySync(String name)
Cette méthode est obsolète.
Utilisez plutôt getProperty(String) .
|
String
|
getRegion()
|
RawImage
|
getScreenshot()
|
RawImage
|
getScreenshot(long timeout, TimeUnit unit)
|
String
|
getSerialNumber()
|
IDevice.DeviceState
|
getState()
|
SyncService
|
getSyncService()
|
ListenableFuture<String>
|
getSystemProperty(String name)
|
AndroidVersion
|
getVersion()
|
boolean
|
hasClients()
|
void
|
installPackage(String packageFilePath, boolean reinstall, InstallReceiver receiver, long maxTimeout, long maxTimeToOutputResponse, TimeUnit maxTimeUnits, String... extraArgs)
|
void
|
installPackage(String packageFilePath, boolean reinstall, InstallReceiver receiver, String... extraArgs)
|
void
|
installPackage(String packageFilePath, boolean reinstall, String... extraArgs)
|
void
|
installPackages( apkFilePaths, boolean reinstall, extraArgs, long timeOutInMs, TimeUnit timeunit)
|
void
|
installRemotePackage(String remoteFilePath, boolean reinstall, InstallReceiver receiver, String... extraArgs)
|
void
|
installRemotePackage(String remoteFilePath, boolean reinstall, String... extraArgs)
|
void
|
installRemotePackage(String remoteFilePath, boolean reinstall, InstallReceiver receiver, long maxTimeout, long maxTimeToOutputResponse, TimeUnit maxTimeUnits, String... extraArgs)
|
boolean
|
isBootLoader()
|
boolean
|
isEmulator()
|
boolean
|
isOffline()
|
boolean
|
isOnline()
|
boolean
|
isRoot()
|
void
|
pullFile(String remote, String local)
|
void
|
pushFile(String local, String remote)
|
void
|
reboot(String into)
|
void
|
removeForward(int localPort)
|
void
|
removeForward(int localPort, int remotePort)
|
void
|
removeForward(int localPort, String remoteSocketName, IDevice.DeviceUnixSocketNamespace namespace)
|
void
|
removeRemotePackage(String remoteFilePath)
|
void
|
removeReverse(int remotePort)
|
boolean
|
root()
|
void
|
runEventLogService(LogReceiver receiver)
|
void
|
runLogService(String logname, LogReceiver receiver)
|
void
|
setSerial(String serial)
|
void
|
startScreenRecorder(String remoteFilePath, ScreenRecorderOptions options, IShellOutputReceiver receiver)
|
boolean
|
supportsFeature(IDevice.HardwareFeature arg0)
|
boolean
|
supportsFeature(IDevice.Feature feature)
|
String
|
syncPackageToDevice(String localFilePath)
|
String
|
uninstallApp(String applicationID, String... extraArgs)
|
String
|
uninstallPackage(String packageName)
|
Constructeurs publics
StubDevice
public StubDevice (String serial)
StubDevice
public StubDevice (String serial,
boolean isEmulator)
Paramètres |
serial |
String |
isEmulator |
boolean |
Méthodes publiques
arePropertiesSet
public boolean arePropertiesSet ()
createForward
public void createForward (int localPort,
String remoteSocketName,
IDevice.DeviceUnixSocketNamespace namespace)
Paramètres |
localPort |
int |
remoteSocketName |
String |
namespace |
IDevice.DeviceUnixSocketNamespace |
Génère |
AdbCommandRejectedException |
|
TimeoutException |
|
createForward
public void createForward (int localPort,
int remotePort)
Paramètres |
localPort |
int |
remotePort |
int |
Génère |
AdbCommandRejectedException |
|
TimeoutException |
|
createReverse
public void createReverse (int remotePort,
int localPort)
Paramètres |
remotePort |
int |
localPort |
int |
Génère |
AdbCommandRejectedException |
|
TimeoutException |
|
executeShellCommand
public void executeShellCommand (String command,
IShellOutputReceiver receiver,
long maxTimeToOutputResponse,
TimeUnit maxTimeUnits)
Paramètres |
command |
String |
receiver |
IShellOutputReceiver |
maxTimeToOutputResponse |
long |
maxTimeUnits |
TimeUnit |
Génère |
AdbCommandRejectedException |
|
ShellCommandUnresponsiveException |
|
TimeoutException |
|
executeShellCommand
public void executeShellCommand (String command,
IShellOutputReceiver receiver)
Paramètres |
command |
String |
receiver |
IShellOutputReceiver |
Génère |
AdbCommandRejectedException |
|
ShellCommandUnresponsiveException |
|
TimeoutException |
|
executeShellCommand
public void executeShellCommand (String command,
IShellOutputReceiver receiver,
int maxTimeToOutputResponse)
Cette méthode est obsolète.
utilisez executeShellCommand(String, com.android.ddmlib.IShellOutputReceiver, long, TimeUnit)
.
Paramètres |
command |
String |
receiver |
IShellOutputReceiver |
maxTimeToOutputResponse |
int |
Génère |
AdbCommandRejectedException |
|
ShellCommandUnresponsiveException |
|
TimeoutException |
|
executeShellCommand
public void executeShellCommand (String command,
IShellOutputReceiver receiver,
long maxTimeout,
long maxTimeToOutputResponse,
TimeUnit maxTimeUnits)
Paramètres |
command |
String |
receiver |
IShellOutputReceiver |
maxTimeout |
long |
maxTimeToOutputResponse |
long |
maxTimeUnits |
TimeUnit |
Génère |
AdbCommandRejectedException |
|
ShellCommandUnresponsiveException |
|
TimeoutException |
|
getAbis
public getAbis ()
getAvdName
public String getAvdName ()
getAvdPath
public String getAvdPath ()
getBattery
public getBattery (long freshnessTime,
TimeUnit timeUnit)
Paramètres |
freshnessTime |
long |
timeUnit |
TimeUnit |
getBattery
public getBattery ()
getBatteryLevel
public Integer getBatteryLevel (long freshnessMs)
Cette méthode est obsolète.
Utilisez plutôt getBattery(long, TimeUnit)
.
Paramètres |
freshnessMs |
long |
Génère |
AdbCommandRejectedException |
|
ShellCommandUnresponsiveException |
|
TimeoutException |
|
getBatteryLevel
public Integer getBatteryLevel ()
Cette méthode est obsolète.
Utilisez plutôt getBattery()
.
Génère |
AdbCommandRejectedException |
|
ShellCommandUnresponsiveException |
|
TimeoutException |
|
getClient
public Client getClient (String applicationName)
Paramètres |
applicationName |
String |
getClientName
public String getClientName (int pid)
getClients
public Client[] getClients ()
getDensity
public int getDensity ()
getFileListingService
public FileListingService getFileListingService ()
Renvoie |
FileListingService |
|
getLanguage
public String getLanguage ()
getMountPoint
public String getMountPoint (String name)
getName
public String getName ()
getProperty
public String getProperty (String name)
getPropertyCacheOrSync
public String getPropertyCacheOrSync (String name)
Cette méthode est obsolète.
Utilisez plutôt getProperty(String)
.
Génère |
AdbCommandRejectedException |
|
ShellCommandUnresponsiveException |
|
TimeoutException |
|
getPropertyCount
public int getPropertyCount ()
Cette méthode est obsolète.
est obsolète dans ddmlib avec le motif "détail de l'implémentation".
getPropertySync
public String getPropertySync (String name)
Cette méthode est obsolète.
Utilisez plutôt getProperty(String)
.
Génère |
AdbCommandRejectedException |
|
ShellCommandUnresponsiveException |
|
TimeoutException |
|
getRegion
public String getRegion ()
getScreenshot
public RawImage getScreenshot ()
Génère |
AdbCommandRejectedException |
|
TimeoutException |
|
getScreenshot
public RawImage getScreenshot (long timeout,
TimeUnit unit)
Paramètres |
timeout |
long |
unit |
TimeUnit |
Génère |
AdbCommandRejectedException |
|
TimeoutException |
|
getSerialNumber
public String getSerialNumber ()
getState
public IDevice.DeviceState getState ()
Renvoie |
IDevice.DeviceState |
|
getSyncService
public SyncService getSyncService ()
Génère |
AdbCommandRejectedException |
|
TimeoutException |
|
getSystemProperty
public ListenableFuture<String> getSystemProperty (String name)
Renvoie |
ListenableFuture<String> |
|
getVersion
public AndroidVersion getVersion ()
hasClients
public boolean hasClients ()
installPackage
public void installPackage (String packageFilePath,
boolean reinstall,
InstallReceiver receiver,
long maxTimeout,
long maxTimeToOutputResponse,
TimeUnit maxTimeUnits,
String... extraArgs)
Paramètres |
packageFilePath |
String |
reinstall |
boolean |
receiver |
InstallReceiver |
maxTimeout |
long |
maxTimeToOutputResponse |
long |
maxTimeUnits |
TimeUnit |
extraArgs |
String |
installPackage
public void installPackage (String packageFilePath,
boolean reinstall,
InstallReceiver receiver,
String... extraArgs)
Paramètres |
packageFilePath |
String |
reinstall |
boolean |
receiver |
InstallReceiver |
extraArgs |
String |
installPackage
public void installPackage (String packageFilePath,
boolean reinstall,
String... extraArgs)
Paramètres |
packageFilePath |
String |
reinstall |
boolean |
extraArgs |
String |
installPackages
public void installPackages ( apkFilePaths,
boolean reinstall,
extraArgs,
long timeOutInMs,
TimeUnit timeunit)
Paramètres |
apkFilePaths |
|
reinstall |
boolean |
extraArgs |
|
timeOutInMs |
long |
timeunit |
TimeUnit |
installRemotePackage
public void installRemotePackage (String remoteFilePath,
boolean reinstall,
InstallReceiver receiver,
String... extraArgs)
Paramètres |
remoteFilePath |
String |
reinstall |
boolean |
receiver |
InstallReceiver |
extraArgs |
String |
installRemotePackage
public void installRemotePackage (String remoteFilePath,
boolean reinstall,
String... extraArgs)
Paramètres |
remoteFilePath |
String |
reinstall |
boolean |
extraArgs |
String |
installRemotePackage
public void installRemotePackage (String remoteFilePath,
boolean reinstall,
InstallReceiver receiver,
long maxTimeout,
long maxTimeToOutputResponse,
TimeUnit maxTimeUnits,
String... extraArgs)
Paramètres |
remoteFilePath |
String |
reinstall |
boolean |
receiver |
InstallReceiver |
maxTimeout |
long |
maxTimeToOutputResponse |
long |
maxTimeUnits |
TimeUnit |
extraArgs |
String |
isBootLoader
public boolean isBootLoader ()
isEmulator
public boolean isEmulator ()
isOffline
public boolean isOffline ()
isOnline
public boolean isOnline ()
isRoot
public boolean isRoot ()
Génère |
AdbCommandRejectedException |
|
ShellCommandUnresponsiveException |
|
TimeoutException |
|
pullFile
public void pullFile (String remote,
String local)
Paramètres |
remote |
String |
local |
String |
Génère |
AdbCommandRejectedException |
|
SyncException |
|
TimeoutException |
|
pushFile
public void pushFile (String local,
String remote)
Paramètres |
local |
String |
remote |
String |
Génère |
AdbCommandRejectedException |
|
SyncException |
|
TimeoutException |
|
redémarrer
public void reboot (String into)
Génère |
AdbCommandRejectedException |
|
TimeoutException |
|
removeForward
public void removeForward (int localPort)
Génère |
AdbCommandRejectedException |
|
TimeoutException |
|
removeForward
public void removeForward (int localPort,
int remotePort)
Paramètres |
localPort |
int |
remotePort |
int |
Génère |
AdbCommandRejectedException |
|
TimeoutException |
|
removeForward
public void removeForward (int localPort,
String remoteSocketName,
IDevice.DeviceUnixSocketNamespace namespace)
Paramètres |
localPort |
int |
remoteSocketName |
String |
namespace |
IDevice.DeviceUnixSocketNamespace |
Génère |
AdbCommandRejectedException |
|
TimeoutException |
|
removeRemotePackage
public void removeRemotePackage (String remoteFilePath)
Paramètres |
remoteFilePath |
String |
removeReverse
public void removeReverse (int remotePort)
Paramètres |
remotePort |
int |
Génère |
AdbCommandRejectedException |
|
TimeoutException |
|
racine
public boolean root ()
Génère |
AdbCommandRejectedException |
|
ShellCommandUnresponsiveException |
|
TimeoutException |
|
runEventLogService
public void runEventLogService (LogReceiver receiver)
Paramètres |
receiver |
LogReceiver |
Génère |
AdbCommandRejectedException |
|
TimeoutException |
|
runLogService
public void runLogService (String logname,
LogReceiver receiver)
Paramètres |
logname |
String |
receiver |
LogReceiver |
Génère |
AdbCommandRejectedException |
|
TimeoutException |
|
setSerial
public void setSerial (String serial)
startScreenRecorder
public void startScreenRecorder (String remoteFilePath,
ScreenRecorderOptions options,
IShellOutputReceiver receiver)
Paramètres |
remoteFilePath |
String |
options |
ScreenRecorderOptions |
receiver |
IShellOutputReceiver |
Génère |
AdbCommandRejectedException |
|
ShellCommandUnresponsiveException |
|
TimeoutException |
|
supportsFeature
public boolean supportsFeature (IDevice.HardwareFeature arg0)
Paramètres |
arg0 |
IDevice.HardwareFeature |
supportsFeature
public boolean supportsFeature (IDevice.Feature feature)
Paramètres |
feature |
IDevice.Feature |
syncPackageToDevice
public String syncPackageToDevice (String localFilePath)
Paramètres |
localFilePath |
String |
Génère |
AdbCommandRejectedException |
|
SyncException |
|
TimeoutException |
|
uninstallApp
public String uninstallApp (String applicationID,
String... extraArgs)
Paramètres |
applicationID |
String |
extraArgs |
String |
uninstallPackage
public String uninstallPackage (String packageName)
Paramètres |
packageName |
String |
Le contenu et les exemples de code de cette page sont soumis aux licences décrites dans la Licence de contenu. Java et OpenJDK sont des marques ou des marques déposées d'Oracle et/ou de ses sociétés affiliées.
Dernière mise à jour le 2025/07/27 (UTC).
[[["Facile à comprendre","easyToUnderstand","thumb-up"],["J'ai pu résoudre mon problème","solvedMyProblem","thumb-up"],["Autre","otherUp","thumb-up"]],[["Il n'y a pas l'information dont j'ai besoin","missingTheInformationINeed","thumb-down"],["Trop compliqué/Trop d'étapes","tooComplicatedTooManySteps","thumb-down"],["Obsolète","outOfDate","thumb-down"],["Problème de traduction","translationIssue","thumb-down"],["Mauvais exemple/Erreur de code","samplesCodeIssue","thumb-down"],["Autre","otherDown","thumb-down"]],["Dernière mise à jour le 2025/07/27 (UTC)."],[],[],null,[]]