Android 測試載入器

來源:互聯網
上載者:User

標籤:android   style   blog   http   color   ar   os   sp   for   

有時候會發現給手機燒入的資訊裡少了某一些檔案,比如一個表徵圖,或者一個mp3檔案之類的等等,為此做了一個小工具檢查指定手機裡面是否包含相應的檔案。

通過程式執行手機的命令來操作手機,感覺還挺有意思的。

static void Main(string[] args)        {            string result = "";            string error = "";            string str = "";            do            {                Console.WriteLine("請通過資料線串連手機...");                string cmd = "adb wait-for-devices";                               ProcessExcuter.Run(Global.Adb.ToString(), cmd, 10000, out result, out error);                bool isOk = false;                isOk = Comm.WaitForDevices(ref result);                Console.WriteLine("--> " + result);                if (!result.Contains("成功"))                {                    return;                }                Console.WriteLine("<-- OK");                                 System.Diagnostics.Stopwatch sw = new System.Diagnostics.Stopwatch();


sw.Start();

                    Console.ReadLine();
                    return;
                }


                    Console.WriteLine("FAIL:Total " + (decimal)sw.ElapsedMilliseconds + "S");
                    Console.ReadLine();
                    return;
                }


                    {
                        isOk = false;
                    }
                }


                    Console.WriteLine("缺少音頻檔案【校正音頻檔案未通過】.");
                    Console.WriteLine("FAIL:Total " + (decimal)sw.ElapsedMilliseconds + "S");
                    Console.ReadLine();
                    return;
                }
                Console.WriteLine("--> " + cmd);
                Console.WriteLine("<-- OK:" + result);

                             sw.Stop();                 Console.WriteLine("\n");                Console.WriteLine("PASS:Total " + (decimal)sw.ElapsedMilliseconds + "S");                Console.WriteLine("\n");                Console.WriteLine("按斷行符號鍵繼續...");                str = Console.ReadKey().Key.ToString();            } while (str.ToUpper().Trim() == "ENTER" || !string.IsNullOrEmpty(error));            Console.ReadLine();        }

Android 測試載入器

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.