zoukankan      html  css  js  c++  java
  • 【Python】wifi开关测试

    #!/usr/bin/python
    # -*- coding: UTF-8 -*-
    import os
    import time
    
    def find_device():
    	os.system('adb kill-serve')
    	os.system('adb start-server')
    	os.system('adb root') 
    	os.system('adb remount') 
    	print("adb devices")
    	os.system('adb devices')
    
    def open_wifi():
    	print("open wifi")
    	os.system('adb shell svc wifi enable')
    
    def close_wifi():
    	print("close wifi")
    	os.system('adb shell svc wifi disable')
    
    def open_settings():
    	print("open settings")
    	os.system('adb shell am start com.android.settings/com.android.settings.Settings')
    
    def get_log(name,count):
    	os.system('adb logcat -t 50000 > '+name+count+'.log')
    
    #模拟开关wifi
    open_settings()
    for i in range(1,20):
    	find_device()
    	open_wifi()
    	time.sleep(5)
    	close_wifi()
    	count=str(i)
    	get_log(name="wifi_open_close",count=count)
    print("wifi_open_close finish
    ")
    
  • 相关阅读:
    GET和POST区别
    es索引介绍
    前端 用法记录
    axios 使用
    react技巧 学习
    vuex 学习笔记
    fetch 学习笔记
    react-router 4.0 学习笔记
    react 学习笔记2
    react 学习笔记
  • 原文地址:https://www.cnblogs.com/wucaiyun1/p/11018207.html
Copyright © 2011-2022 走看看