"Turn" "Android Test Tips" 01. How to put files into the phone system when the ADB shell is not the root user by default

Source: Internet
Author: User

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‘"
2 adb start-server
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
4 shell@android:/ $ su
5 shell@android:/ # ls data/local/tmp/
6 busybox
7 d10519f9d1f65446873da10267a674bc.apk
8 tcpdump
9 shell@android:/ # 
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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.