示例#1
0
文件: Device.cs 项目: harishraj/tools
        public void UninstallPackage(string packageName)
        {
            InstallReceiver receiver = new InstallReceiver();

            ExecuteShellCommand($"pm uninstall {packageName}", receiver);
            if (!string.IsNullOrEmpty(receiver.ErrorMessage))
            {
                throw new PackageInstallationException(receiver.ErrorMessage);
            }
        }
示例#2
0
文件: Device.cs 项目: harishraj/tools
        public void InstallRemotePackage(string remoteFilePath, bool reinstall)
        {
            InstallReceiver receiver = new InstallReceiver();
            FileEntry       entry    = this.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);
            }
        }
示例#3
0
 public void UninstallPackage(string packageName)
 {
     InstallReceiver receiver = new InstallReceiver();
     ExecuteShellCommand($"pm uninstall {packageName}", receiver);
     if (!string.IsNullOrEmpty(receiver.ErrorMessage))
         {
         throw new PackageInstallationException(receiver.ErrorMessage);
         }
 }
示例#4
0
        public void InstallRemotePackage(string remoteFilePath, bool reinstall)
        {
            InstallReceiver receiver = new InstallReceiver();
            FileEntry entry = this.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);
                }
        }