[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
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]