简体   繁体   中英

Android adb shell - Find and replace text within a file using command

How to find and replace text within a file using adb command?

Is there any file edit command line in adb similar to sed command in linux and windows

sed does really good job with ease. However I could't find any similar way to do in Android

sed -i 's/original/new/g' file.txt

The above command replaces text with in a file However same doesn't work inside adb shell

C:\Users\^^^^\Desktop>adb shell sed
/system/bin/sh: sed: not found

My device is not rooted and no plans to root my device

If you have root, you can install busybox on the device and use sed that way:

adb shell busybox sed

Otherwise, you're limited to what the Android OS ships with, which is almost nothing useful.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM