Files
iOSAI/tidevice_entry.py

18 lines
533 B
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# from tidevice.__main__ import main
# if __name__ == '__main__':
# main()
# tidevice_entry.py
import sys, traceback, os
from tidevice.__main__ import main
if __name__ == "__main__":
try:
main()
except Exception:
# 把 traceback 写到日志文件,但**不输出到控制台**
with open(os.path.expanduser("~/tidevice_crash.log"), "a", encoding="utf-8") as f:
traceback.print_exc(file=f)
# 静默退出,**返回码 1**(父进程只认 returncode
sys.exit(1)