diff --git a/clear_apps.py b/clear_apps.py deleted file mode 100755 index 10e2f0b..0000000 --- a/clear_apps.py +++ /dev/null @@ -1,29 +0,0 @@ -#!/usr/bin/python3 - -import uiautomator2 as u2 -import time - -def clear_all_apps(): - d = u2.connect() - while True: - try: - d.keyevent("HOME") - d.keyevent("HOME") - d.keyevent("312") - time.sleep(1) - if "com.miui.home:id/recents_container" not in d.dump_hierarchy(): - continue - if "近期没有任何内容" in d.dump_hierarchy(): - d.keyevent("HOME") - d.keyevent("HOME") - exit(0) - d.xpath('//*[@resource-id="com.miui.home:id/clearAnimView"]').click_exists(timeout=3) - d.keyevent("HOME") - d.keyevent("HOME") - except Exception as e: - print("clear_all_apps errors", e) - d = u2.connect() - continue - -if __name__=="__main__": - clear_all_apps() diff --git a/run.sh b/run.sh index 8b5b6c9..67d63fe 100755 --- a/run.sh +++ b/run.sh @@ -246,7 +246,7 @@ for round in $(seq 1 $cycle); do echo $round $app $start_type $start_time $rss $pss $pagefaults $minorfaults $majorfaults $itlbmiss $dtlbmiss $cpustall $inc_ratio $inc_total $order4_ratio $order4_cont $nr_inc_direct_reclaim >> $dir/result if [ $clear_background -ne 0 ]; then - python3 clear_apps.py + ./clearapp.sh fi rm tmp.txt