Aaron Hull
Aaron Hull

Reputation: 442

Why does adb install fail from context menu with "must specify a apk size" error?

I have manually added a .apk and apkfile entry to my registry under Computer\HKEY_CLASSES_ROOT\ with the following keys:

apkfile
  shell
    Install to Device
      command = "C:\Users\[me]\AppData\Local\Android\Sdk\platform-tools\adb.exe" install /r "%1"

This successfully adds a context menu item called Install to Device that appears to successfully run over the file.

The command prompt opens and closes with these messages:

Performing Streamed Install

adb: failed to install C:[path][myapk].apk: Error: must specify a APK size

However, Running the (apparently) same command over the APK in cmd or powershell succeeds.

Any idea why this might be the case?

Upvotes: 0

Views: 958

Answers (2)

csdroid
csdroid

Reputation: 51

I had the same problem, but eventually I realized that I was trying to install multiple apk's, so I removed the others and kept only one apk.

Upvotes: 1

Gunpreet Singh
Gunpreet Singh

Reputation: 1

In your command instead of using /r, try using - r. I hope that helps

Upvotes: 0

Related Questions