Android 使用ADB在PC的SD卡上安装apk进行测试并截图
我第一次使用ADB或android调试桥 问题是我已经编写了一个代码,可以直接从市场上的设备上下载APK。现在我想运行ADB来安装下载的apk并截图Android 使用ADB在PC的SD卡上安装apk进行测试并截图,android,adb,monkeyrunner,Android,Adb,Monkeyrunner,我第一次使用ADB或android调试桥 问题是我已经编写了一个代码,可以直接从市场上的设备上下载APK。现在我想运行ADB来安装下载的apk并截图 如何才能做到这一点?以编程方式安装apk文件 Intent intent = new Intent(Intent.ACTION_VIEW); intent.setDataAndType(Uri.fromFile(new File(Environment.getExternalStorageDirectory() + "/barcode.apk")
如何才能做到这一点?以编程方式安装apk文件
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(Uri.fromFile(new File(Environment.getExternalStorageDirectory() + "/barcode.apk")), "application/vnd.android.package-archive");
startActivity(intent);
*首先以编程方式将apk文件复制到sd卡,然后执行上述步骤*
或
将android apk安装到emulator的分步方法:
1) Install Android SDK
2) Start the emulator by going to $SDK_root/emulator.exe
3) Go to command prompt and go to the directory $SDK_root/platform-tools
4) Type in the command adb install
5) Now ur app is up and running on the emulator
查看以通过ADB捕获屏幕截图。我的apk在sdk卡中。因此,我在终端上发出命令,那么SD卡上的apk应该如何安装DB install D:/download/test.apk