Install apps silently, with granted INSTALL_PACKAGES permission

后端 未结 16 2482
梦谈多话
梦谈多话 2020-11-22 10:32

I am trying to silently install apk into the system. My app is located in /system/app and successfully granted permission \"android.permission.INSTALL_PACKAGES\"

Ho

16条回答
  •  猫巷女王i
    2020-11-22 10:46

    !/bin/bash

    f=/home/cox/myapp.apk   #or $1 if input from terminal.
    
    #backup env var
    backup=$LD_LIBRARY_PATH
    LD_LIBRARY_PATH=/vendor/lib:/system/lib
    myTemp=/sdcard/temp.apk
    adb push $f $myTemp
    adb shell pm install -r $myTemp
    #restore env var
    LD_LIBRARY_PATH=$backup
    

    This works for me. I run this on ubuntu 12.04, on shell terminal.

提交回复
热议问题