Board logo

标题: [文本处理] 批处理命令FINDSTR字符太长,怎么办 [打印本页]

作者: hentai87    时间: 2020-7-18 13:10     标题: 批处理命令FINDSTR字符太长,怎么办

运行结果
===unknown Phh-Treble with GApps (CQ3001HFUG)===
  ACTIVITY com.android.launcher3/.Launcher 64550c8 pid=2573
FINDSTR: Line 4 is too long.
  1. @echo off
  2. ::adb临时加入到path环境变量
  3. set My_PATH=%~dp0
  4. set PATH=%PATH%;%My_PATH%
  5. @for /f "skip=1 usebackq" %%i in (`adb devices`) do call:print_deviceInfo %%i
  6. pause
  7. goto :eof
  8. :print_deviceInfo
  9. for /f "tokens=1 usebackq" %%i in (`adb -s %1 shell getprop ro.product.manufacturer`) do set manufacturer=%%i
  10. for /f "tokens=1,2,3 usebackq" %%i in (`adb -s %1 shell getprop ro.product.model`) do set model=%%i %%j %%k
  11. echo ===%manufacturer% %model% (%1)===
  12. adb -s %1 shell dumpsys activity top|findstr ACTIVITY
  13. echo.
  14. goto :eof
复制代码

作者: went    时间: 2020-7-18 14:07

调powershell
  1. powershell -c " adb -s %1 shell dumpsys activity top | Where-Object { $_ -cmatch 'ACTIVITY' } "
复制代码





欢迎光临 批处理之家 (http://www.bathome.net/) Powered by Discuz! 7.2