开发者

Is there a way to install apps by copying it to /data/app

开发者 https://www.devze.com 2023-03-01 05:51 出处:网络
To install app with adb I use adb push app.apk /data/app And then app installs. But when I just copy file with RootExplorer to /data/app, it copies, but don\'t install.开发者_StackOverflow社区 It

To install app with adb I use

adb push app.apk /data/app

And then app installs.

But when I just copy file with RootExplorer to /data/app, it copies, but don't install.开发者_StackOverflow社区 It just lies there.

Is there a way to install apps with Terminal Emulator for example?


Actually, the way to install apps is:

adb install app.apk

If you want to do it programmatically, you will have to use an Intent like this:

Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(Uri.fromFile(new File(Environment.getExternalStorageDirectory() + "/app.apk")),"application/vnd.android.package-archive");
startActivity(intent); 

In the case above, the apk is in the SDCard directory.

0

精彩评论

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