压测《崩铁》是否出现黑屏(Unity线程小于等于1)

@echo off
setlocal enabledelayedexpansion

REM 设置循环次数
set loop_count=2147483647

REM 执行循环
for /l %%i in (1, 1, %loop_count%) do (
    echo Loop: %%i

    REM 启动应用
    adb -s 183.60.151.152:22780 shell am start -n com.miHoYo.hkrpg/com.mihoyo.combosdk.ComboSDKActivity
    adb -s 183.60.151.152:22779 shell am start -n com.miHoYo.hkrpg/com.mihoyo.combosdk.ComboSDKActivity
    timeout /t 20

    REM 获取进程数量
    for /f %%j in ('adb -s 183.60.151.152:22780 shell "ps -T -p $(pidof com.miHoYo.hkrpg) | grep UnityMain | wc -l"') do set return_code_1=%%j
    for /f %%j in ('adb -s 183.60.151.152:22779 shell "ps -T -p $(pidof com.miHoYo.hkrpg) | grep UnityMain | wc -l"') do set return_code_2=%%j

    REM 检测返回值是否小于等于 1
    set /a decimal_value_1 = !return_code_1!
    set /a decimal_value_2 = !return_code_2!
    echo !decimal_value_1!
    echo !decimal_value_2!
    
    if !decimal_value_1! leq 1 (
        echo Test Finish!
        goto :EndLoop
    )

    if !decimal_value_2! leq 1 (
        echo Test Finish!
        goto :EndLoop
    )

    REM 模拟滑动操作
    start /b adb -s 183.60.151.152:22780 shell input swipe 800 540 800 540 100
    adb -s 183.60.151.152:22779 shell input swipe 800 540 800 540 100
    timeout /t 10

    for /l %%k in (1, 1, 3) do (
        start /b adb -s 183.60.151.152:22780 shell input swipe 1500 540 10 540 1000
        adb -s 183.60.151.152:22779 shell input swipe 1500 540 10 540 1000
    )

    REM 关闭应用
    adb -s 183.60.151.152:22780 shell am force-stop com.miHoYo.hkrpg
    adb -s 183.60.151.152:22779 shell am force-stop com.miHoYo.hkrpg 
)

:EndLoop
endlocal

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值