private void TapWindowClose() { Debug.WriteLine("TapWindowClose()"); int xPosition = _rand.Next(_androidDevice.WindowCloseAreaXStart, _androidDevice.WindowCloseAreaXEnd); int yPosition = _rand.Next(_androidDevice.WindowCloseAreaYStart, _androidDevice.WindowCloseAreaYEnd); Trace.WriteLine(string.Format("linkを閉じるエリアをタップ: X={0}, Y={1}", xPosition, yPosition)); AdbOperation.Tap(xPosition, yPosition); }
private void TapRadarCloseClose() { Debug.WriteLine("TapRadarCloseClose()"); int xPosition = _rand.Next(_androidDevice.RadarCloseButtonAreaXStart, _androidDevice.RadarCloseButtonAreaXEnd); int yPosition = _rand.Next(_androidDevice.RadarCloseButtonAreaYStart, _androidDevice.RadarCloseButtonAreaYEnd); Trace.WriteLine(string.Format("「Close(レーダー)」ボタンをタップ: X={0}, Y={1}", xPosition, yPosition)); AdbOperation.Tap(xPosition, yPosition); }
private void TapMaintenanceEscapeButton() { Debug.WriteLine("TapErrorEscapeButton()"); int xPosition = _rand.Next(_androidDevice.ReturnMaintenanceButtonAreaXStart, _androidDevice.ReturnMaintenanceButtonAreaXEnd); int yPosition = _rand.Next(_androidDevice.ReturnMaintenanceButtonAreaYStart, _androidDevice.ReturnMaintenanceButtonAreaYEnd); Trace.WriteLine(string.Format("メンテナンスから抜けるボタンをタップ: X={0}, Y={1}", xPosition, yPosition)); AdbOperation.Tap(xPosition, yPosition); }
private void TapCharge300Button() { Debug.WriteLine(nameof(TapCharge300Button)); int xPosition = _rand.Next(_androidDevice.Charge300ButtonAreaXStart, _androidDevice.Charge300ButtonAreaXEnd); int yPosition = _rand.Next(_androidDevice.Charge300ButtonAreaYStart, _androidDevice.Charge300ButtonAreaYEnd); Trace.WriteLine(string.Format("「バッテリー300」ボタンをタップ: X={0}, Y={1}", xPosition, yPosition)); AdbOperation.Tap(xPosition, yPosition); }
private void TapBatteryButton() { Debug.WriteLine("TapBatteryButton()"); int xPosition = _rand.Next(_androidDevice.BatteryButtonAreaXStart, _androidDevice.BatteryButtonAreaXEnd); int yPosition = _rand.Next(_androidDevice.BatteryButtonAreaYStart, _androidDevice.BatteryButtonAreaYEnd); Trace.WriteLine(string.Format("「バッテリー」ボタンをタップ: X={0}, Y={1}", xPosition, yPosition)); AdbOperation.Tap(xPosition, yPosition); }
private void TakeScreenShot(CancellationToken token) { Debug.WriteLine("TakeScreenShot(CancellationToken)"); Trace.WriteLine("---------- スクリーンショット処理の開始 ----------"); Trace.WriteLine(string.Format("スクリーンショットを撮影: {0}", _androidDevice.ScreenShotRemotePath)); AdbOperation.TakeScreenshot(_androidDevice.ScreenShotRemotePath); Sleep("TakeScreenShotInterval", _androidDevice.TakeScreenShotInterval, token); Trace.WriteLine(string.Format("スクリーンショットを転送: {0}", _androidDevice.ScreenShotLocalPath)); AdbOperation.PullFile(_androidDevice.ScreenShotRemotePath, _androidDevice.ScreenShotLocalPath); Sleep("PullFileInterval", _androidDevice.PullFileInterval, token); Trace.WriteLine(string.Format("スクリーンショットを削除: {0}", _androidDevice.ScreenShotRemotePath)); AdbOperation.RemoveFile(_androidDevice.ScreenShotRemotePath); Sleep("RemoveFileInterval", _androidDevice.RemoveFileInterval, token); Trace.WriteLine("---------- スクリーンショット処理の終了 ----------"); }
private void Unlock(CancellationToken token) { Debug.WriteLine("Unlock(CancellationToken)"); Trace.WriteLine("---------- スリープモードから復帰開始 ----------"); AdbOperation.PushPowerButton(); Sleep("UnlockPowerInterval", _androidDevice.UnlockPowerInterval, token); switch (_androidDevice.UnlockType) { case AndroidDevice.UnlockTypeEnum.None: Trace.WriteLine("端末アンロック: スワイプ"); AdbOperation.Swipe(_androidDevice.UnlockXStart, _androidDevice.UnlockYStart, _androidDevice.UnlockXEnd, _androidDevice.UnlockYEnd, _androidDevice.UnlockDuration); break; case AndroidDevice.UnlockTypeEnum.Pin: Trace.WriteLine("端末アンロック: スワイプ"); AdbOperation.Swipe(_androidDevice.UnlockXStart, _androidDevice.UnlockYStart, _androidDevice.UnlockXEnd, _androidDevice.UnlockYEnd, _androidDevice.UnlockDuration); Sleep("UnlockSwipeInterval", _androidDevice.UnlockSwipeInterval, token); Trace.WriteLine("端末アンロック: PIN入力"); AdbOperation.InputText(_androidDevice.UnlockPassword); Sleep("UnlockInputInterval", _androidDevice.UnlockInputInterval, token); Trace.WriteLine("端末アンロック: Enter押下"); AdbOperation.InputKeyEvent("KEYCODE_ENTER"); break; case AndroidDevice.UnlockTypeEnum.PinWithoutEnter: Trace.WriteLine("端末アンロック: スワイプ"); AdbOperation.Swipe(_androidDevice.UnlockXStart, _androidDevice.UnlockYStart, _androidDevice.UnlockXEnd, _androidDevice.UnlockYEnd, _androidDevice.UnlockDuration); Sleep("UnlockSwipeInterval", _androidDevice.UnlockSwipeInterval, token); Trace.WriteLine("端末アンロック: PIN入力"); AdbOperation.InputText(_androidDevice.UnlockPassword); Sleep("UnlockInputInterval", _androidDevice.UnlockInputInterval, token); break; case AndroidDevice.UnlockTypeEnum.Passowrd: Trace.WriteLine("端末アンロック: スワイプ"); AdbOperation.Swipe(_androidDevice.UnlockXStart, _androidDevice.UnlockYStart, _androidDevice.UnlockXEnd, _androidDevice.UnlockYEnd, _androidDevice.UnlockDuration); Sleep("UnlockSwipeInterval", _androidDevice.UnlockSwipeInterval, token); Trace.WriteLine("端末アンロック: Password入力"); AdbOperation.InputText(_androidDevice.UnlockPassword); Sleep("UnlockInputInterval", _androidDevice.UnlockInputInterval, token); Trace.WriteLine("端末アンロック: Enter押下"); AdbOperation.InputKeyEvent("KEYCODE_ENTER"); break; } Trace.WriteLine("---------- スリープモードから復帰完了 ----------"); }
private void GoToSleepMode() { Debug.WriteLine("GoToSleepMode()"); Trace.WriteLine("スリープモードへ移行"); AdbOperation.PushPowerButton(); }
private int GetBattery() { Debug.WriteLine("GetBattery()"); return(AdbOperation.GetBatteryInfo()); }