55 lines
1.6 KiB
PowerShell
55 lines
1.6 KiB
PowerShell
$adb = "C:\Users\12914\Android\sdk\platform-tools\adb.exe"
|
|
$target = "127.0.0.1:16384"
|
|
$outDir = "C:\Users\12914\Desktop\vscode"
|
|
|
|
# 不重启daemon,直接用已连接的设备
|
|
Write-Host "=== Check devices ==="
|
|
& $adb devices
|
|
|
|
# 截图1: 当前页面(应该是HTTP安全警告或已加载的页面)
|
|
Write-Host "=== Screenshot 1 ==="
|
|
& $adb -s $target shell screencap -p /sdcard/s1.png
|
|
& $adb -s $target pull /sdcard/s1.png "$outDir\_mumu_s1.png"
|
|
|
|
# 点击"继续访问网站"
|
|
Write-Host "=== Tap continue ==="
|
|
& $adb -s $target shell input tap 290 965
|
|
Start-Sleep -Seconds 4
|
|
|
|
# 截图2
|
|
Write-Host "=== Screenshot 2 ==="
|
|
& $adb -s $target shell screencap -p /sdcard/s2.png
|
|
& $adb -s $target pull /sdcard/s2.png "$outDir\_mumu_s2.png"
|
|
|
|
# 如果还在警告页,再试一次点击
|
|
Write-Host "=== Tap continue again (fallback) ==="
|
|
& $adb -s $target shell input tap 290 965
|
|
Start-Sleep -Seconds 4
|
|
|
|
# 截图3
|
|
Write-Host "=== Screenshot 3 ==="
|
|
& $adb -s $target shell screencap -p /sdcard/s3.png
|
|
& $adb -s $target pull /sdcard/s3.png "$outDir\_mumu_s3.png"
|
|
|
|
# 向下滚动
|
|
Write-Host "=== Scroll down ==="
|
|
& $adb -s $target shell input swipe 300 800 300 300 500
|
|
Start-Sleep -Seconds 2
|
|
|
|
# 截图4: 滚动后
|
|
Write-Host "=== Screenshot 4 ==="
|
|
& $adb -s $target shell screencap -p /sdcard/s4.png
|
|
& $adb -s $target pull /sdcard/s4.png "$outDir\_mumu_s4.png"
|
|
|
|
# 继续滚动
|
|
Write-Host "=== Scroll down more ==="
|
|
& $adb -s $target shell input swipe 300 800 300 300 500
|
|
Start-Sleep -Seconds 2
|
|
|
|
# 截图5
|
|
Write-Host "=== Screenshot 5 ==="
|
|
& $adb -s $target shell screencap -p /sdcard/s5.png
|
|
& $adb -s $target pull /sdcard/s5.png "$outDir\_mumu_s5.png"
|
|
|
|
Write-Host "=== All done ==="
|