Function used to communicate with the device through the REST API
Beispiel #1
0
 private void InstallAppOnDevicesList(string buildPath, string appName, bool uninstallBeforeInstall, string[] targetList)
 {
     string[] IPlist = ParseIPList(BuildDeployPrefs.TargetIPs);
     for (int i = 0; i < IPlist.Length; i++)
     {
         try
         {
             bool   completedUninstall = false;
             string IP = FinalizeIP(IPlist[i]);
             if (BuildDeployPrefs.FullReinstall &&
                 BuildDeployPortal.IsAppInstalled(appName, new BuildDeployPortal.ConnectInfo(IP, BuildDeployPrefs.DeviceUser, BuildDeployPrefs.DevicePassword)))
             {
                 EditorUtility.DisplayProgressBar("Installing on devices", "Uninstall (" + IP + ")", (float)i / (float)IPlist.Length);
                 if (!UninstallApp(appName, IP))
                 {
                     Debug.LogError("Uninstall failed - skipping install (" + IP + ")");
                     continue;
                 }
                 completedUninstall = true;
             }
             EditorUtility.DisplayProgressBar("Installing on devices", "Install (" + IP + ")", (float)(i + (completedUninstall ? 0.5f : 0.0f)) / (float)IPlist.Length);
             InstallApp(buildPath, appName, IP);
         }
         catch (Exception ex)
         {
             Debug.LogError(ex.ToString());
         }
     }
     EditorUtility.ClearProgressBar();
 }
        private bool UninstallApp(string packageFamilyName, string targetDevice)
        {
            // Connection info
            var connectInfo = new BuildDeployPortal.ConnectInfo(targetDevice, BuildDeployPrefs.DeviceUser, BuildDeployPrefs.DevicePassword);

            // Kick off the install
            Debug.Log("Uninstall build: " + targetDevice);
            return(BuildDeployPortal.UninstallApp(packageFamilyName, connectInfo));
        }
 public void OpenLogFileForIPs(string IPs, string appName)
 {
     string[] ipList = ParseIPList(IPs);
     for (int i = 0; i < ipList.Length; i++)
     {
         // Use the Device Portal REST API
         BuildDeployPortal.DeviceLogFile_View(appName, new BuildDeployPortal.ConnectInfo(FinalizeIP(ipList[i]), deviceUser, devicePassword));
     }
 }
 void KillAppOnIPs(string appName, string targetIPs)
 {
     string[] IPlist = ParseIPList(targetIPs);
     for (int i = 0; i < IPlist.Length; i++)
     {
         string targetIP = FinalizeIP(IPlist[i]);
         Debug.Log("Kill app on: " + targetIP);
         BuildDeployPortal.KillApp(appName, new BuildDeployPortal.ConnectInfo(targetIP, deviceUser, devicePassword));
     }
 }
 bool IsAppRunning_FirstIPCheck(string appName, string targetIPs)
 {
     // Just pick the first one and use it...
     string[] IPlist = ParseIPList(targetIPs);
     if (IPlist.Length > 0)
     {
         string targetIP = FinalizeIP(IPlist[0]);
         return(BuildDeployPortal.IsAppRunning(appName, new BuildDeployPortal.ConnectInfo(targetIP, deviceUser, devicePassword)));
     }
     return(false);
 }
        public void OpenLogFileForIPs(string IPs)
        {
            string packageFamilyName = CalcPackageFamilyName();

            if (string.IsNullOrEmpty(packageFamilyName))
            {
                return;
            }

            string[] ipList = ParseIPList(IPs);
            for (int i = 0; i < ipList.Length; i++)
            {
                // Use the Device Portal REST API
                BuildDeployPortal.DeviceLogFile_View(
                    packageFamilyName, new BuildDeployPortal.ConnectInfo(FinalizeIP(ipList[i]), BuildDeployPrefs.DeviceUser, BuildDeployPrefs.DevicePassword));
            }
        }
Beispiel #7
0
        private bool InstallApp(string buildPath, string appName, string targetDevice)
        {
            // Get the appx path
            FileInfo[] files = (new DirectoryInfo(buildPath)).GetFiles("*.appx");
            if (files.Length == 0)
            {
                Debug.LogError("No APPX found in folder build folder (" + buildPath + ")");
                return(false);
            }

            // Connection info
            var connectInfo = new BuildDeployPortal.ConnectInfo(targetDevice, BuildDeployPrefs.DeviceUser, BuildDeployPrefs.DevicePassword);

            // Kick off the install
            Debug.Log("Installing build on: " + targetDevice);
            return(BuildDeployPortal.InstallApp(files[0].FullName, connectInfo));
        }
        void KillAppOnIPs(string targetIPs)
        {
            string packageFamilyName = CalcPackageFamilyName();

            if (string.IsNullOrEmpty(packageFamilyName))
            {
                return;
            }

            string[] IPlist = ParseIPList(targetIPs);
            for (int i = 0; i < IPlist.Length; i++)
            {
                string targetIP = FinalizeIP(IPlist[i]);
                Debug.Log("Kill app on: " + targetIP);
                BuildDeployPortal.KillApp(
                    packageFamilyName, new BuildDeployPortal.ConnectInfo(targetIP, BuildDeployPrefs.DeviceUser, BuildDeployPrefs.DevicePassword));
            }
        }
        private void InstallAppOnDevicesList(string buildPath, string[] targetList)
        {
            string packageFamilyName = CalcPackageFamilyName();

            if (string.IsNullOrEmpty(packageFamilyName))
            {
                return;
            }

            for (int i = 0; i < targetList.Length; i++)
            {
                try
                {
                    bool   completedUninstall = false;
                    string ip = FinalizeIP(targetList[i]);
                    if (BuildDeployPrefs.FullReinstall &&
                        BuildDeployPortal.IsAppInstalled(packageFamilyName, new BuildDeployPortal.ConnectInfo(ip, BuildDeployPrefs.DeviceUser, BuildDeployPrefs.DevicePassword)))
                    {
                        EditorUtility.DisplayProgressBar("Installing on devices", "Uninstall (" + ip + ")", i / (float)targetList.Length);
                        if (!UninstallApp(packageFamilyName, ip))
                        {
                            Debug.LogError("Uninstall failed - skipping install (" + ip + ")");
                            continue;
                        }

                        completedUninstall = true;
                    }

                    EditorUtility.DisplayProgressBar("Installing on devices", "Install (" + ip + ")", (i + (completedUninstall ? 0.5f : 0.0f)) / targetList.Length);
                    InstallApp(buildPath, ip);
                }
                catch (Exception ex)
                {
                    Debug.LogError(ex.ToString());
                }
            }
            EditorUtility.ClearProgressBar();
        }