GPS 诊断脚本

发布时间:2026/7/23 14:39:39

GPS 诊断脚本 GPS 诊断脚本Xshell 直接粘贴用法连接一台设备后执行正常机、故障机各跑一遍对比生成的 txtSERIAL(adbget−serialno2/dev/null)TIME(adb get-serialno 2/dev/null) TIME(adbget−serialno2/dev/null)TIME(date %Y%m%d_%H%M%S)OUT“/tmp/gps_diag_KaTeX parse error: Expected group after _ at position 9: {SERIAL}_̲{TIME}.txt”LOG“/tmp/gps_log_KaTeX parse error: Expected group after _ at position 9: {SERIAL}_̲{TIME}.txt”adb logcat -cecho “echo “请现在在设备上FactoryTest - GPS”echo “保持 YGPS 界面等待 60 秒…”echo ”sleep 60{echo “ GPS DIAG REPORTecho “Time : $(date ‘%Y-%m-%d %H:%M:%S’)”echo “Serial : ${SERIAL}”echo ”echoecho “ location_mode ”adb shell settings get secure location_modeechoecho “ YGPS permission ”adb shell dumpsys package com.mediatek.ygps | grep -E “ACCESS_FINE_LOCATION|ACCESS_COARSE_LOCATION|granted”echoecho “ mnld process ”adb shell “ps -A | grep -i mnl”echoecho “ dev node ”adb shell “ls -l /dev/gps /dev/gps_emi /dev/stpgps 21”echoecho “ key log count ”echo -n GnssStatus onStarted : adb logcat -d | grep -c “GnssStatus onStarted”echo -n GSV : adb logcat -d | grep -c “GSV”echo -n GGA : adb logcat -d | grep -c “GGA”echo -n setSatelliteStatus : adb logcat -d | grep -c “setSatelliteStatus”echo -n onFirstFix : adb logcat -d | grep -c “onFirstFix”echo -n mnl version : adb logcat -d | grep -c “mnl version”echo -n clearSateInfo : adb logcat -d | grep -c “clearSateInfo”echo -n SecurityException : adb logcat -d | grep -c “SecurityException”echoecho “ sample GSV (first 5) ”adb logcat -d | grep -i GSV | head -5echoecho “ sample mnl version ”adb logcat -d | grep -i “mnl version” | head -3echoecho “ sample setSatelliteStatus ”adb logcat -d | grep -i “setSatelliteStatus” | head -3echoecho “ quick judge ”GSV(adblogcat−d∣grep−cGSV)MNL(adb logcat -d | grep -c GSV) MNL(adblogcat−d∣grep−cGSV)MNL(adb shell “ps -A | grep -i mnl” | wc -l)START$(adb logcat -d | grep -c “GnssStatus onStarted”)if [ “MNL−eq0];thenecho[结论倾向]MNLD未运行−驱动/软件elif[MNL -eq 0 ]; then echo [结论倾向] MNLD 未运行 - 驱动/软件 elif [ MNL−eq0];thenecho[结论倾向]MNLD未运行−驱动/软件elif[START” -gt 0 ] [ “GSV−eq0];thenecho[结论倾向]GPS已启动但无GSV−硬件RF/天线/校准或MNLD无NMEAelif[GSV -eq 0 ]; then echo [结论倾向] GPS 已启动但无 GSV - 硬件RF/天线/校准 或 MNLD 无 NMEA elif [ GSV−eq0];thenecho[结论倾向]GPS已启动但无GSV−硬件RF/天线/校准或MNLD无NMEAelif[GSV” -gt 0 ]; thenecho “[结论倾向] 有 GSV - GPS 有搜星数据若 UI 仍空查 YGPS/FactoryTest”elseecho “[结论倾向] GPS 未正常启动 - 查权限/定位开关”fiechoecho “Report file: ${OUT}”echo “Full log :KaTeX parse error: Expected EOF, got } at position 53: … }̲ | tee {OUT}”adb logcat -d | grep -iE “YGPS|NmeaParser|mnl|mnld|gps|gnss|GSV|GGA|RMC|onFirstFix|setSatelliteStatus|onStarted|clearSate|SecurityException|Factory_GPSTest|GpsTestResult” “${LOG}”echo “Done.”echo “Summary: ${OUT}”echo “Detail : ${LOG}”

相关新闻