ubuntu 不行 我又切到了win10系统
还是git clone 先
接下来逐一排坑:
1 先改了 monkey.ini
[DEFAULT]
cmd=monkey -p com.huasheng.stock --throttle 500 --ignore-timeouts --ignore-crashes --monitor-native-crashes -v -v -v 200 >
package_name=com.huasheng.stock
activity = com.huasheng.stock.ui.MainActivity
net = wifi
2 走你第一回
D:\workspace\git\monkeyTest>python3 monkeyTest.py
*** liyu 2015-01-15***
*** v1.0.0 ***
Checking adb port...
成功: 已终止 PID 为 10896 的进程。
adb port has been released!
Traceback (most recent call last):
File "monkeyTest.py", line 154, in
runnerPool()
File "monkeyTest.py", line 66, in runnerPool
shutil.rmtree((PATH("./info/"))) # 删除持久化目录
File "D:\Python36\lib\shutil.py", line 494, in rmtree
return _rmtree_unsafe(path, onerror)
File "D:\Python36\lib\shutil.py", line 376, in _rmtree_unsafe
onerror(os.listdir, path, sys.exc_info())
File "D:\Python36\lib\shutil.py", line 374, in _rmtree_unsafe
names = os.listdir(path)
FileNotFoundError: [WinError 3] 系统找不到指定的路径。: 'D:\workspace\git\monkeyTest\info'
根据错误 在该目录下创建info目录.
3 走你第二回
D:\workspace\git\monkeyTest>python3 monkeyTest.py
*** liyu 2015-01-15***
*** v1.0.0 ***
Checking adb port...
成功: 已终止 PID 为 10940 的进程。
adb port has been released!
adb devices
- server not running *
设备不存在
提示设备不存在,好吧,连接小米 并检查连接.
D:\workspace\git\monkeyTest>adb devices -l
List of devices attached
12345678 device product:chiron model:MIX_2 device:chiron
4 走你第三回
D:\workspace\git\monkeyTest>python3 monkeyTest.py
*** liyu 2015-01-15***
*** v1.0.0 ***
Checking adb port...
成功: 已终止 PID 为 9800 的进程。
adb port has been released!
adb devices
- server not running *
adb -s 45806625 shell wm size
adb -s 45806625 shell cat /proc/meminfo
adb -s 45806625 shell cat /system/build.prop
adb -s 45806625 shell cat /proc/cpuinfo
创建文件成功
创建文件成功
创建文件成功
创建文件成功
创建文件成功
创建文件成功
创建文件成功
------writeSum-------
1
adb -s 45806625 shell monkey -p com.huasheng.stock --throttle 500 --ignore-timeouts --ignore-crashes --monitor-native-crashes -v -v -v 200 >>D:\workspace\git\monkeyTe st\log\238be041-f0f3-4fb4-aee5-b11ccd098919monkey.log
系统找不到指定的路径。
系统找不到指定的路径。
系统找不到指定的路径。
----get_pid-------
adb -s 45806625 shell ps | findstr com.huasheng.stock
adb -s 45806625 shell cat /proc/cpuinfo
adb -s 45806625 shell dumpsys battery
Current.Battery.Service.state:.AC.powered:.false.USB.powered:.true.Wireless.powered:.false.Max.charging.current:.0.Max.charging.voltage:.0.Charge.counter:.0.status:.2.h ealth:.2.present:.true.level:.100.scale:.100.voltage:.4341.temperature:.320.technology:.Li-poly
读取文件错误
------read-------
D:\workspace\git\monkeyTest\info\45806625_battery.pickle
[]
------writeInfo-------
[100]
multiprocessing.pool.RemoteTraceback:
"""
Traceback (most recent call last):
File "D:\Python36\lib\multiprocessing\pool.py", line 119, in worker
result = (True, func(*args, **kwds))
File "D:\Python36\lib\multiprocessing\pool.py", line 44, in mapstar
return list(map(*args))
File "D:\workspace\git\monkeyTest\monkeyTest.py", line 103, in start
with open(mc["monkey_log"], encoding='utf-8') as monkeylog:
FileNotFoundError: [Errno 2] No such file or directory: 'D:\workspace\git\monkeyTest\log\238be041-f0f3-4fb4-aee5-b11ccd098919monkey.log'
"""
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "monkeyTest.py", line 154, in
runnerPool()
File "monkeyTest.py", line 77, in runnerPool
pool.map(start, devices_Pool)
File "D:\Python36\lib\multiprocessing\pool.py", line 266, in map
return self._map_async(func, iterable, mapstar, chunksize).get()
File "D:\Python36\lib\multiprocessing\pool.py", line 644, in get
raise self._value
FileNotFoundError: [Errno 2] No such file or directory: 'D:\workspace\git\monkeyTest\log\238be041-f0f3-4fb4-aee5-b11ccd098919monkey.log'
根据错误提示,在该目录下创建log目录
5 走你第四回
D:\workspace\git\monkeyTest>python3 monkeyTest.py
*** liyu 2015-01-15***
*** v1.0.0 ***
Checking adb port...
成功: 已终止 PID 为 9296 的进程。
错误: 没有找到进程 "9296"。
成功: 已终止 PID 为 16240 的进程。
adb port has been released!
adb devices
- server not running *
adb -s 45806625 offline shell wm size
multiprocessing.pool.RemoteTraceback:
"""
Traceback (most recent call last):
File "D:\Python36\lib\multiprocessing\pool.py", line 119, in worker
result = (True, func(*args, **kwds))
File "D:\Python36\lib\multiprocessing\pool.py", line 44, in mapstar
return list(map(*args))
File "D:\workspace\git\monkeyTest\monkeyTest.py", line 88, in start
mkdirInit(devices, app, num)
File "D:\workspace\git\monkeyTest\monkeyTest.py", line 54, in mkdirInit
app[devices] = {"cpu": cpu, "men": men, "flow": flow, "battery": battery, "fps": fps, "header": get_phome(devices)}
File "D:\workspace\git\monkeyTest\monkeyTest.py", line 38, in get_phome
bg = BasePhoneMsg.get_phone_Kernel(devices)
File "D:\workspace\git\monkeyTest\Base\BasePhoneMsg.py", line 66, in get_phone_Kernel
pix = get_app_pix(devices)
File "D:\workspace\git\monkeyTest\Base\BasePhoneMsg.py", line 62, in get_app_pix
return subprocess.check_output(cmd).split()[2].decode()
File "D:\Python36\lib\subprocess.py", line 336, in check_output
**kwargs).stdout
File "D:\Python36\lib\subprocess.py", line 418, in run
output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command 'adb -s 45806625 offline shell wm size' returned non-zero exit status 1.
"""
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "monkeyTest.py", line 154, in
runnerPool()
File "monkeyTest.py", line 77, in runnerPool
pool.map(start, devices_Pool)
File "D:\Python36\lib\multiprocessing\pool.py", line 266, in map
return self._map_async(func, iterable, mapstar, chunksize).get()
File "D:\Python36\lib\multiprocessing\pool.py", line 644, in get
raise self._value
subprocess.CalledProcessError: Command 'adb -s 45806625 offline shell wm size' returned non-zero exit status 1.
到此该错误 我就无能为力了,应该调整 'adb -s 45806625 offline shell wm size' returned non-zero exit status 1.
该命令了 这个应该我也可以....