public class RealAndroidDevice extends Object implements AndroidDevice
Modifier and Type | Class and Description |
---|---|
static class |
RealAndroidDevice.ErrorParsingReceiver
Implementation of
IShellOutputReceiver with helper functions to
parse output lines and figure out if a call to IDevice.executeShellCommand(String,
com.android.ddmlib.IShellOutputReceiver) succeeded. |
Constructor and Description |
---|
RealAndroidDevice(BuckEventBus buckEventBus,
com.android.ddmlib.IDevice device,
Console console) |
RealAndroidDevice(BuckEventBus eventBus,
com.android.ddmlib.IDevice device,
Console console,
Path agentApkPath,
int agentPort,
com.google.common.collect.ImmutableList<String> rapidInstallTypes) |
Modifier and Type | Method and Description |
---|---|
static com.google.common.collect.ImmutableList<com.google.common.collect.ImmutableList<String>> |
chunkArgs(Iterable<String> args,
int sizeLimit)
Breaks a list of strings into groups whose total size is within some limit.
|
AutoCloseable |
createForward() |
String |
deviceStartActivity(String activityToRun,
boolean waitForDebugger) |
List<String> |
getDeviceAbis() |
Optional<PackageInfo> |
getPackageInfo(String packageName) |
String |
getProperty(String name) |
String |
getSerialNumber() |
String |
getSignature(String packagePath) |
boolean |
installApkOnDevice(File apk,
boolean installViaSd,
boolean quiet,
boolean verifyTempWritable) |
void |
installFiles(String filesType,
Map<Path,Path> installPaths) |
boolean |
isEmulator() |
void |
killProcess(String processName) |
com.google.common.collect.ImmutableSortedSet<Path> |
listDirRecursive(Path root) |
void |
mkDirP(String dirpath) |
static Optional<PackageInfo> |
parsePathAndPackageInfo(String packageName,
String rawOutput) |
void |
rmFiles(String dirPath,
Iterable<String> filesToDelete) |
void |
sendBroadcast(String action,
Map<String,String> stringExtras) |
void |
stopPackage(String packageName) |
boolean |
uninstallApkFromDevice(String packageName,
boolean keepData)
Uninstalls apk from specific device.
|
void |
uninstallPackage(String packageName) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
installApkOnDevice
public RealAndroidDevice(BuckEventBus eventBus, com.android.ddmlib.IDevice device, Console console, @Nullable Path agentApkPath, int agentPort, com.google.common.collect.ImmutableList<String> rapidInstallTypes)
public RealAndroidDevice(BuckEventBus buckEventBus, com.android.ddmlib.IDevice device, Console console)
public static com.google.common.collect.ImmutableList<com.google.common.collect.ImmutableList<String>> chunkArgs(Iterable<String> args, int sizeLimit)
public static Optional<PackageInfo> parsePathAndPackageInfo(String packageName, String rawOutput)
@Nullable public String deviceStartActivity(String activityToRun, boolean waitForDebugger)
public boolean uninstallApkFromDevice(String packageName, boolean keepData)
InstallCommand
and UninstallCommand
.public boolean isEmulator()
public boolean installApkOnDevice(File apk, boolean installViaSd, boolean quiet, boolean verifyTempWritable)
installApkOnDevice
in interface AndroidDevice
public void stopPackage(String packageName) throws Exception
stopPackage
in interface AndroidDevice
Exception
public Optional<PackageInfo> getPackageInfo(String packageName) throws Exception
getPackageInfo
in interface AndroidDevice
Exception
public void uninstallPackage(String packageName) throws com.android.ddmlib.InstallException
uninstallPackage
in interface AndroidDevice
com.android.ddmlib.InstallException
public String getSignature(String packagePath) throws Exception
getSignature
in interface AndroidDevice
Exception
public String getSerialNumber()
getSerialNumber
in interface AndroidDevice
public com.google.common.collect.ImmutableSortedSet<Path> listDirRecursive(Path root) throws Exception
listDirRecursive
in interface AndroidDevice
Exception
public void rmFiles(String dirPath, Iterable<String> filesToDelete)
rmFiles
in interface AndroidDevice
public AutoCloseable createForward() throws Exception
createForward
in interface AndroidDevice
Exception
public void installFiles(String filesType, Map<Path,Path> installPaths) throws Exception
installFiles
in interface AndroidDevice
Exception
public void mkDirP(String dirpath) throws Exception
mkDirP
in interface AndroidDevice
Exception
public String getProperty(String name) throws Exception
getProperty
in interface AndroidDevice
Exception
public List<String> getDeviceAbis() throws Exception
getDeviceAbis
in interface AndroidDevice
Exception
public void killProcess(String processName) throws Exception
killProcess
in interface AndroidDevice
Exception
public void sendBroadcast(String action, Map<String,String> stringExtras) throws Exception
sendBroadcast
in interface AndroidDevice
Exception