You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
HMG_QLine/qline_scripts/clear_logs.sh

30 lines
594 B
Bash

#!/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 <device_ip:port>"
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"