public UninstallPackage ( string packageName ) : void | ||
packageName | string | /// The name of the package to uninstall. /// |
return | void |
/// <summary> /// Uninstalls a package from the device. /// </summary> /// <param name="device"> /// The device on which to uninstall the package. /// </param> /// <param name="packageName"> /// The name of the package to uninstall. /// </param> public static void UninstallPackage(this DeviceData device, string packageName) { PackageManager manager = new PackageManager(device); manager.UninstallPackage(packageName); }
/// <summary> /// Uninstalls a package from the device. /// </summary> /// <param name="device"> /// The device on which to uninstall the package. /// </param> /// <param name="packageName"> /// The name of the package to uninstall. /// </param> public static void UninstallPackage(this DeviceData device, string packageName) { PackageManager manager = new PackageManager(device); manager.UninstallPackage(packageName); }
/// <summary> /// Uninstalls a package from the device. /// </summary> /// <param name="client"> /// The connection to the adb server. /// </param> /// <param name="device"> /// The device on which to uninstall the package. /// </param> /// <param name="packageName"> /// The name of the package to uninstall. /// </param> public static void UninstallPackage(this IAdbClient client, DeviceData device, string packageName) { PackageManager manager = new PackageManager(client, device); manager.UninstallPackage(packageName); }
public void UninstallPackageTest() { DeviceData device = new DeviceData() { State = DeviceState.Online }; DummyAdbClient client = new DummyAdbClient(); client.Commands.Add("pm list packages -f", "package:/system/app/Gallery2/Gallery2.apk=com.android.gallery3d"); client.Commands.Add("pm uninstall com.android.gallery3d", "Success"); AdbClient.Instance = client; PackageManager manager = new PackageManager(device); // Command should execute correctly; if the wrong command is passed an exception // would be thrown. manager.UninstallPackage("com.android.gallery3d"); }