Tag Archives: Adb Shell Monkey Warning

[Solved] Adb Shell Monkey Warning: can‘t create log.txt, Read-only file system

Problem description

When using monkey to debug Android programs, the shell prompts an error, and the problem is as follows
first, I use

adb shell

Enter the device shell, and then use the following command to execute the monkey test
command command

monkey -p com.baidu.BaiduMap -v -v -v --ignore-crashes --throttle 200 --pct-touch 50 5 1>D:\\info.txt 2>D:\error.txt

tips

/system/bin/sh: can't create D:\info.txt: Read-only file system

Analysis and correction

Reason: the reason why the file cannot be written is that the device shell only has read and write permissions on the device, but not on the PC. Therefore, you should not execute monkey after entering the ADB shell, but exit the shell first

exit

It is then executed on the command line

adb shell monkey -p com.baidu.BaiduMap -v -v -v --ignore-crashes --throttle 200 --pct-touch 50 5 1>D:\\info.txt 2>D:\error.txt