http://blog.csdn.net/wirelessqa/article/details/8624208
Some machines after root through the ADB shell, the default is not the root user, you need to enter SU to switch to root, so that in the execution of batch processing or want to put the file on the phone system will have a problem:
Method One: Command line
1 |
adb shell "su -c ‘sleep 1‘" |
3 |
adb push tcpdump /data/local/tcpdump |
Method Two: Using Tools
ADBD Insecure (Super ADBD)
:http://pan.baidu.com/share/link?shareid=322594&uk=436271564
Description
1. Open adbd, tick start Super adbd, so you can run the ADB shell command directly with root authority
2. Because the superuser is not permanent, the reboot will be invalid, so check the power on the boot will eliminate the hassle of every open
Note: These commands may be useful for some phones, but the stable version of the Xiaomi phone is useless. Because the stable version of Xiaomi does not support root, if you need to install MIUI development version for Root
Method Three: First put the file into the sdcard and then put into the system
1. Use other tools to put the file (tcpdump) into the SDcard
2.ADB Shell enters the shell environment, Su gets root privileges (the ADB shell will get root permission by default without SU)
3.cat/sdcard/File > System file path, as follows: Place tcpdump under System file/data/local/
Note: The shell command CP and RM are not supported here, will be error, so directly with the cat to copy it.
Method Four: Put the file in a privileged document
1 |
bixiaopeng@bixiaopengtekiMacBook-Pro ~$ adb push /Users/bixiaopeng/Downloads/tcpdump /data/local/tmp/tcpdump |
2 |
2899KB/s (645840bytes in 0.217s) |
3 |
bixiaopeng@bixiaopengtekiMacBook-Pro ~$ adb shell |
5 |
shell@android:/ # ls data/local/tmp/ |
7 |
d10519f9d1f65446873da10267a674bc.apk |
1 |
系统不允许我们放到/data/local中,那我们就放到权限比较大的tmp中 |
"Turn" "Android Test Tips" 01. How to put files into the phone system when the ADB shell is not the root user by default