1

I'm trying to install apk when the device is booting. I wrote shell script to install apk:

#!/system/bin/sh
pm install /data/local/tmp/MagiskManager-v7.1.1.apk

Unfortunately, when I enters the shell (using 'adb shell') and runs the script(using 'sh my_script.sh') I get error:

Exception occurred while executing:
java.lang.IllegalArgumentException: Error: Can't open file: /data/local/tmp/MagiskManager-v7.1.1.apk
        at com.android.server.pm.PackageManagerShellCommand.setParamsSize(PackageManagerShellCommand.java:461)
        at com.android.server.pm.PackageManagerShellCommand.runInstall(PackageManagerShellCommand.java:1060)
        at com.android.server.pm.PackageManagerShellCommand.onCommand(PackageManagerShellCommand.java:169)
        at android.os.ShellCommand.exec(ShellCommand.java:111)
        at com.android.server.pm.PackageManagerService.onShellCommand(PackageManagerService.java:22472)
        at android.os.Binder.shellCommand(Binder.java:881)
        at android.os.Binder.onTransact(Binder.java:765)
        at android.content.pm.IPackageManager$Stub.onTransact(IPackageManager.java:4924)
        at com.android.server.pm.PackageManagerService.onTransact(PackageManagerService.java:4118)
        at android.os.Binder.execTransactInternal(Binder.java:1021)
        at android.os.Binder.execTransact(Binder.java:994)

I already tried to put the apk in /data/local/tmp but it's not working. Also init.d app failed to run the script

5
  • But I want to do it every boot so I can't plug the device into pc every boot – Barel Elbaz Dec 30 '20 at 8:31
  • 3
    Are you sure that at that time you execute the command the user data partition has already been mounted? – Robert Dec 30 '20 at 12:43
  • 2
    Why would you want to install Magisk Manager at every boot? If you install it once, it's installed. – Rukbat Dec 30 '20 at 20:16
  • I customized settings system app and sigbed it with officail rom signature, the problem is that when I reboot my device the app turns into the older version and I should reinstall it every boot – Barel Elbaz Dec 31 '20 at 21:10
  • v7.1.1 is long outdated, please install v8.0.4 github.com/topjohnwu/Magisk/blob/master/README.MD#downloads – alecxs Jan 2 at 9:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.