UninstallPackage() public method

Uninstalls a package from the device.
public UninstallPackage ( string packageName ) : void
packageName string /// The name of the package to uninstall. ///
return void
Ejemplo n.º 1
0
 /// <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);
 }
Ejemplo n.º 2
0
        /// <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);
        }
Ejemplo n.º 3
0
        /// <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);
        }
Ejemplo n.º 4
0
        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");
        }