Android debug bridge command line-adb shell tips continue
1. Kill specified process / Linux host
adb shell pidof -s "my-target-process" | xargs -I{} kill "{}"
2. Windows run.bat with prepare-android.sh
Windows cmd C:\> type prepare-android.sh
#!/system/bin/sh
mount -o rw -o remount /system
mount |grep system
ORE_PROSS=your_app_name
pid=`pgrep -x $ORE_PROSS` # Get a pid.
if [ ! -z $pid ]; then # If there is none,
echo "Kill $ORE_PROSS"
su root kill -9 `pidof -s $ORE_PROSS`
fi
Windows cmd C:\ type update.bat
set pa=c:\Android
set LOGFILE=Update-log_flash.txt
"%pa%/adb/adb.exe" wait-for-device
timeout /t 2 /nobreak
"%pa%/adb/adb.exe" root
timeout /t 1 /nobreak
"%pa%/adb/adb.exe" remount
timeout /t 1 /nobreak
SET prepare_sh=prepare-android.sh
"%pa%/adb/adb.exe" push %prepare_sh% /mnt/sdcard/%prepare_sh%"
SET root_command="su root chmod a+x /mnt/sdcard/%prepare_sh%"
"%pa%/adb/adb.exe" shell %root_command%
SET root_command="su root sh /mnt/sdcard/%prepare_sh%"
"%pa%/adb/adb.exe" shell %root_command%