[TIMOB-25742] CLI: Fails to install APK to Android 4.1 devices
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Medium |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2018-02-16T22:02:56.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 7.1.0 |
Components | Android |
Labels | android, appc, cli |
Reporter | Joshua Quick |
Assignee | Joshua Quick |
Created | 2018-02-02T01:17:47.000+0000 |
Updated | 2018-03-01T19:24:50.000+0000 |
Description
*Summary:*
The "appc" command line tool always fails to install a built APK to an Android 4.1 device. It can only successfully install to Android 4.2 and higher.
*How to Reproduce:*
Connect an Android 4.1 device to your machine.
In the top-left corner of Appcelerator Studio, select "Run" and the Android 4.1 device from the drop-down UI.
Click the "Run" button.
Observe the "Console" log.
_Alternatively, you can do this at the command line via..._appc run -p android
*Result:*
The install fails after the build with the following error messages...
[ERROR] : Failed to install apk on "014E05E01600E012"
[ERROR] Application Installer abnormal process termination. Process exit value was 1
*Cause:*
The CLI is installing the APK using Google's "adb" command line tool with the "-d" argument. Android 4.1 does not support the "-d" argument.
https://github.com/appcelerator/node-titanium-sdk/blob/master/lib/adb.js#L548
*Recommended Solution:*
The "adb" command line does not return an error until near the end of the install, which can take a lot of time for large APKs. So, it would be best to fetch the API Level from the device first via the "adb shell getprop" command and then only use "adb install" with argument "-d" if the API Level is 17 or higher.
PR: https://github.com/appcelerator/node-titanium-sdk/pull/22
Need to validate the fix before closing after next CLI release (CLI 7.0.3 or later).
Validated with 7.0.2 from the CLI.