Exemplo n.º 1
0
        private void duoxian(string a_b, int dqinx)
        {
            string dizhi = null;
            string path  = null;
            string seed  = null;

            MyFuncUtil.myqiehuancd(a_b, out dizhi, out path, out seed);
            //MyLdcmd.mySort(dizhi);
            Thread.Sleep(2000);
            WriteLog.WriteLogFile(dqinx + "", "模拟器" + dqinx + "进入到循环当中");

            /*var r = MyFuncUtil.Launch(a, dizhi);
             * if (r == 0)
             * {
             *  WriteLog.WriteLogFile(a + "", "模拟器" + a + "打开失败");
             *  Thread.Sleep(20000);
             *  return;
             * }
             * Thread.Sleep(20000);*/
            myDm dm = new myDm();

            lock (dm)
            {
                MingRi_Sort mr = new MingRi_Sort(dm, dqinx, dizhi);
                //登录 要下载文件 暂定十分钟 发现start按钮则立刻跳出
                tmpBool = mr.denglu(10);
                if (!tmpBool)
                {
                    tmpBoolString.Append("登录环节出错");
                    return;
                }
                tmpBool = mr.zhuce(3);
                if (!tmpBool)
                {
                    tmpBoolString.Append("注册环节出错");
                    return;
                }
                string bmpname = dqinx + "_" + dm.GetTime();
                mr.zhuxian();
                Thread.Sleep(10000);
                int rg = mr.ganyuan_jietu();
                if (rg != -1)
                {
                    Thread.Sleep(10000);
                    MyLdcmd.myScreencap(dqinx, path + bmpname + ".png", dizhi);
                    Thread.Sleep(20000);
                    if (dm.IsFileExist(path + bmpname + ".png") == 1)
                    {
                        string abc = mr.generalBasicDemo(dqinx, path + bmpname + ".png");
                        WriteLog.WriteLogFile(dqinx + "", abc + " " + abc.Length);
                        MyFuncUtil.MyRestore(dqinx, abc, a_b);
                        if (abc.Length <= 0)
                        {
                            dm.DeleteFile(path + bmpname + ".png");
                        }
                    }
                }
            }
        }
Exemplo n.º 2
0
        private void duoxianxunhuan(string a_b, int dqinx, int xhcishu)
        {
            string dizhi = null;
            string path  = null;
            string seed  = null;

            MyFuncUtil.myqiehuancd(a_b, out dizhi, out path, out seed);
            //MyLdcmd.mySort(dizhi);
            var cishu   = 0;
            var cgcishu = 0;

            for (int cs = 0; cs < xhcishu; cs++)
            {
                var ks = MyFuncUtil.GetTimestamp();
                Thread.Sleep(2000);
                MyFuncUtil.mylogandxianshi("模拟器" + dqinx + "进入到循环当中");
                Thread.Sleep(1000);
                bool temp = false;
                if (!temp)
                {
                    MyFuncUtil.mylogandxianshi("模拟器" + dqinx + "关闭失败");
                    Thread.Sleep(20000);
                    continue;
                }
                MyFuncUtil.mylogandxianshi("模拟器" + dqinx + "复原");
                MyLdcmd.myRestore(dqinx, seed, dizhi);
                MyFuncUtil.mylogandxianshi("模拟器" + dqinx + "改名");
                MyLdcmd.myRename(dqinx, "雷" + dqinx + "-" + cgcishu, dizhi);
                temp = MyFuncUtil.Launch(dqinx, dizhi);
                if (!temp)
                {
                    MyFuncUtil.mylogandxianshi("模拟器" + dqinx + "打开失败");
                    Thread.Sleep(20000);
                    continue;
                }
                int i = MyFuncUtil.QiDongWanChengInx(a_b, dqinx, apkName);
                if (i == -1)
                {
                    MyFuncUtil.mylogandxianshi("模拟器" + dqinx + "打开app" + apkName + "失败");
                    Thread.Sleep(20000);
                    continue;
                }
                MyLdcmd.mySort(a_b);
                //Thread.Sleep(2000 * 60 * 200);
                //lock (obj)
                {
                    myDm        dm = new myDm();
                    MingRi_Sort mr = new MingRi_Sort(dm, dqinx, dizhi);
                    //登录 要下载文件 暂定十分钟 发现start按钮则立刻跳出
                    tmpBool = mr.denglu(10);
                    if (!tmpBool)
                    {
                        tmpBoolString.Append("登录环节出错");
                        return;
                    }
                    tmpBool = mr.zhuce(3);
                    if (!tmpBool)
                    {
                        tmpBoolString.Append("注册环节出错");
                        return;
                    }
                    string bmpname = dqinx + "_" + dm.GetTime();
                    mr.zhuxian();
                    Thread.Sleep(10000);
                    int rg = mr.ganyuan_jietu();
                    if (rg != -1)
                    {
                        Thread.Sleep(10000);
                        MyLdcmd.myScreencap(dqinx, path + bmpname + ".png", dizhi);
                        Thread.Sleep(20000);
                        if (dm.IsFileExist(path + bmpname + ".png") == 1)
                        {
                            string abc = mr.generalBasicDemo(dqinx, path + bmpname + ".png");
                            WriteLog.WriteLogFile(dqinx + "", abc + " " + abc.Length);
                            MyFuncUtil.MyRestore(dqinx, abc, a_b);
                            if (abc.Length > 0)
                            {
                                cgcishu++;
                            }
                            else
                            {
                                dm.DeleteFile(path + bmpname + ".png");
                            }
                        }
                    }
                    cishu++;
                    var js = MyFuncUtil.GetTimestamp();
                    MyFuncUtil.mylogandxianshi("模拟器" + dqinx + "循环" + cishu + "次数");
                    MyFuncUtil.mylogandxianshi("模拟器" + dqinx + "循环1次耗时" + MyFuncUtil.SecondToHour(js - ks));
                }
            }
        }