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, waitinstallApkOnDevicepublic 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 AndroidDevicepublic void stopPackage(String packageName) throws Exception
stopPackage in interface AndroidDeviceExceptionpublic Optional<PackageInfo> getPackageInfo(String packageName) throws Exception
getPackageInfo in interface AndroidDeviceExceptionpublic void uninstallPackage(String packageName) throws com.android.ddmlib.InstallException
uninstallPackage in interface AndroidDevicecom.android.ddmlib.InstallExceptionpublic String getSignature(String packagePath) throws Exception
getSignature in interface AndroidDeviceExceptionpublic String getSerialNumber()
getSerialNumber in interface AndroidDevicepublic com.google.common.collect.ImmutableSortedSet<Path> listDirRecursive(Path root) throws Exception
listDirRecursive in interface AndroidDeviceExceptionpublic void rmFiles(String dirPath, Iterable<String> filesToDelete)
rmFiles in interface AndroidDevicepublic AutoCloseable createForward() throws Exception
createForward in interface AndroidDeviceExceptionpublic void installFiles(String filesType, Map<Path,Path> installPaths) throws Exception
installFiles in interface AndroidDeviceExceptionpublic void mkDirP(String dirpath) throws Exception
mkDirP in interface AndroidDeviceExceptionpublic String getProperty(String name) throws Exception
getProperty in interface AndroidDeviceExceptionpublic List<String> getDeviceAbis() throws Exception
getDeviceAbis in interface AndroidDeviceExceptionpublic void killProcess(String processName) throws Exception
killProcess in interface AndroidDeviceExceptionpublic void sendBroadcast(String action, Map<String,String> stringExtras) throws Exception
sendBroadcast in interface AndroidDeviceException