Esempio n. 1
0
        /// <summary>
        /// Uninstall an package from the device.
        /// </summary>
        /// <param name="packageName">Name of the package.</param>
        /// <exception cref="IOException"></exception>
        ///
        /// <exception cref="PackageInstallException"></exception>
        public void UninstallPackage(String packageName)
        {
            InstallReceiver receiver = new InstallReceiver( );

            ExecuteShellCommand(String.Format("pm uninstall {0}", packageName), receiver);
            if (!String.IsNullOrEmpty(receiver.ErrorMessage))
            {
                throw new PackageInstallationException(receiver.ErrorMessage);
            }
        }
Esempio n. 2
0
File: Device.cs Progetto: sttt/madb
        /// <summary>
        /// Installs the application package that was pushed to a temporary location on the device.
        /// </summary>
        /// <param name="remoteFilePath">absolute file path to package file on device</param>
        /// <param name="reinstall">set to <see langword="true"/> if re-install of app should be performed</param>
        public void InstallRemotePackage(string remoteFilePath, bool reinstall)
        {
            InstallReceiver receiver = new InstallReceiver();
            string          cmd      = string.Format("pm install {1}{0}", remoteFilePath, reinstall ? "-r " : string.Empty);

            this.ExecuteShellCommand(cmd, receiver);

            if (!string.IsNullOrEmpty(receiver.ErrorMessage))
            {
                throw new PackageInstallationException(receiver.ErrorMessage);
            }
        }
Esempio n. 3
0
        /// <summary>
        /// Installs the application package that was pushed to a temporary location on the device.
        /// </summary>
        /// <param name="remoteFilePath">absolute file path to package file on device</param>
        /// <param name="reinstall">set to <code>true</code> if re-install of app should be performed</param>
        public void InstallRemotePackage(String remoteFilePath, bool reinstall)
        {
            InstallReceiver receiver = new InstallReceiver( );
            FileEntry       entry    = FileListingService.FindFileEntry(remoteFilePath);
            String          cmd      = String.Format("pm install {1}{0}", entry.FullEscapedPath, reinstall ? "-r " : String.Empty);

            ExecuteShellCommand(cmd, receiver);

            if (!String.IsNullOrEmpty(receiver.ErrorMessage))
            {
                throw new PackageInstallationException(receiver.ErrorMessage);
            }
        }
Esempio n. 4
0
 /// <summary>
 /// Uninstall an package from the device.
 /// </summary>
 /// <param name="packageName">Name of the package.</param>
 /// <exception cref="IOException"></exception>
 ///   
 /// <exception cref="PackageInstallException"></exception>
 public void UninstallPackage(String packageName)
 {
     InstallReceiver receiver = new InstallReceiver();
     ExecuteShellCommand(String.Format("pm uninstall {0}", packageName), receiver);
     if(!String.IsNullOrEmpty(receiver.ErrorMessage)) {
         throw new PackageInstallationException(receiver.ErrorMessage);
     }
 }
Esempio n. 5
0
        /// <summary>
        /// Installs the application package that was pushed to a temporary location on the device.
        /// </summary>
        /// <param name="remoteFilePath">absolute file path to package file on device</param>
        /// <param name="reinstall">set to <code>true</code> if re-install of app should be performed</param>
        public void InstallRemotePackage(String remoteFilePath, bool reinstall)
        {
            InstallReceiver receiver = new InstallReceiver();
            FileEntry entry = FileListingService.FindFileEntry(remoteFilePath);
            String cmd = String.Format("pm install {1}{0}", entry.FullEscapedPath, reinstall ? "-r " : String.Empty);
            ExecuteShellCommand(cmd, receiver);

            if(!String.IsNullOrEmpty(receiver.ErrorMessage)) {
                throw new PackageInstallationException(receiver.ErrorMessage);
            }
        }