0

I am using an ADB or android debugging bridge for the the first time.

The problem is I have written a code to download the APK from the market on the device directly. Now I want to run the ADB to install the downloaded apk and take screenshots.

How can I do that?

skynet
  • 9,898
  • 5
  • 43
  • 52

1 Answers1

2

Install apk file programmatically .

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

*first copy apk file to sd card programmatically and then do the above step *

OR

Step-by-Step way to install android apk to 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

Look at this link to capture screen shot through ADB.

Chirag
  • 56,621
  • 29
  • 151
  • 198