New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[TIMOB-25742] Fixed adb issue where it fails to install to Android 4.1 devices #22
Conversation
…ndroid 4.1 devices
lib/adb.js
Outdated
} | ||
|
||
// Set up the 'adb' arguments array. | ||
let arguments = []; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
arguments
is a special word in JavaScript. Please use another variable name like args
or something. Also, this should be const
.
lib/adb.js
Outdated
if (devices.filter(function (d) { return d.id == deviceId }).length != 1) return callback(new Error(__('device not found'))); | ||
|
||
devices = devices.filter(function (d) { return d.id == deviceId }); | ||
if (devices.length != 1) return callback(new Error(__('device not found'))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In general, we prefer !==
over !=
. Same goes for the ==
on the previous line.
lib/adb.js
Outdated
if (deviceApiLevel >= 17) { | ||
// Set the '-d' argument to install an older APK over a new one. | ||
// Note: Only supported on Android 4.2 (API Level 17) and higher. | ||
arguments.push('-d'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are we keeping the -d
flag anyways? According to the adb
help screen, it says "allow version code downgrade (debuggable packages only)". Do we care?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assume someone must have been burned by this at some point. Doesn't hurt to keep it. But I agree that this should be a rare event.
Updated PR based on feedback. |
APPROVED |
JIRA: https://jira.appcelerator.org/browse/TIMOB-25742
Summary:
adb install
command was passing argument-d
, which is only supported on Android 4.2 and higher.-d
argument if supported on device.Test:
Run the test attached to TIMOB-25742.