#!/usr/bin/env bash # Parse command line arguments while [[ $# -gt 0 ]]; do key="$1" case $key in -ip) DEVICE_IP="$2" shift # past argument shift # past value ;; *) echo "Unknown option: $1" exit 1 ;; esac done if [[ -z "$DEVICE_IP" ]]; then echo "Usage: sh clear_logs.sh -ip " exit 1 fi LOG_PATH="/storage/emulated/0/Android/data/com.example.hmg_qline.hmg_qline/files/logs" # Remove all files in the logs directory on the device adb -s $DEVICE_IP shell rm -rf "$LOG_PATH/*" echo "✅ Logs cleared on $DEVICE_IP"