#! /bin/bash
trap "" HUP
for i in $(seq 1 100):
do
currenttime=$(date "+%Y-%m-%d %H:%M:%S")
echo $i"---"${currenttime} >>/sdcard/DCIM/buyan_time.txt
input tap xxx xxx
done
或者
adb root
adb remount
adb pushtest.sh /data/
adb shell
cd data
chmod 777test.sh
nohup ./test.sh &
//nohup:永久执行
//&:后台挂起