Android install apks file
Android installation apks file is nothing more than three steps:
1. Find an apks file
2. Unzip it
unzip apks文件路径
#或者
unzip -d 需要解压到的文件夹,必须要存在 apks文件路径
3. Install it code source
#通过adb shell连接手机,进入刚刚解压的那个文件夹路径里面
#执行下面bash 脚本
total=0
for aa in $(ls *.apk)
do
o=($(ls -l $aa))
let total=$total+${o[4]}
done
echo "total size $total"
create=$(pm install-create -S $total)
sid=$(echo $create |grep -E -o '[0-9]+')
echo "session id $sid"
for aa in $(ls *.apk)
do
o=($(ls -l $aa))
echo "write $aa to $sid"
cat $aa | pm install-write -S ${o[4]} $sid $aa -
done
pm install-commit $sid
I wrote a script here to facilitate the installation of apks, and also realized the backup and recovery of apks files by the way.
csdn resource