[TIMOB-25171] Ask to try again after installing app to device fails
GitHub Issue | n/a |
---|---|
Type | Improvement |
Priority | None |
Status | Open |
Resolution | Unresolved |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | CLI |
Labels | cb-tooling |
Reporter | Fokke Zandbergen |
Assignee | Unknown |
Created | 2015-10-26T14:07:12.000+0000 |
Updated | 2020-01-30T21:22:54.000+0000 |
Description
Triggered by a [blog post](http://skypanther.com/2015/10/arggh-failed-android-install/) by [~skypanther] I was thinking maybe we should ask the user to try again when for some reason the CLI failed to install an app on a device.
Currently, you'd need to do the full build again or manually figure out how to use the involved to tooling directly to install the existing build - which would not get you the logs via the CLI.
We could do something like:
[INFO] Making sure the adb server is running
[INFO] Installing apk: /path/to/your_app/build/android/bin/YourApp.apk
[INFO] Installing app on device: Galaxy Nexus
[ERROR] Failed to install apk on "01498FE710016018"
[ERROR] Error: INSTALL_FAILED_VERSION_DOWNGRADE
Would you like to have me try it again?
0) No, thanks
1) Try again with device A (selected)
2) Try again with device B
By displaying and refreshing the (otherwise cached) list of connected devices the user would be able to try another device, the same or give up.
*UPDATE:* As [~timpoulsen] suggested, it might be even better to have a map of errors-codes to human-readable reasons why the install failed as well as a flag if a retry would make sense. Like in the above example, it would not and the users will simply have to remove the app or bump the version and rebuild.
Thanks for submitting the ticket Fokke. I think if this is implemented, it would be most useful if the tooling provided some plain-language interpretation of why the first build failed. By that I mean simply parsing the error code (e.g. INSTALLED_FAILED_VERSION_DOWNGRADE) and offering a helpful suggestion ("Looks like you already have a newer version of this app installed on your device.").
Good one [~timpoulsen]