开发者

How to move apps to sdcard via shell script

开发者 https://www.devze.com 2023-04-05 07:52 出处:网络
I want to write a small tool to move apps to SDcard. I found the movePackage()-method in Android Open Source and reflect the method. I failed because this method need com.android.PERMISSION.MOVE_PACK

I want to write a small tool to move apps to SDcard.

I found the movePackage()-method in Android Open Source and reflect the method. I failed because this method need com.android.PERMISSION.MOVE_PACKAGE which I cannot get. So I want to using shell开发者_如何学C script to do this for rooted devices.

But I don't actually know what happened in the movePackage()-method. So I can't write the correct script.

Could you please tell what happened inside the Android when a app is moved to SDcard? Can I do this with program?


I'm not sure If I understand you, but on rooted device you can use adb.

For example:

adb push /home/username/Desktop/app.apk /sdcard/app.apk

Also you can do this (for removing):

adb shell rm /sdcard/app.apk

If you want to install:

adb install /home/username/Desktop/app.apk
0

精彩评论

暂无评论...
验证码 换一张
取 消