I finally got it figured.
Problem seemed to be that the apk was not properly installed. The application was in fact able to run when i installed it with the following command (as recommanded by jojo in cordova run android executes fine. But Android 4.1.2 doesn’t start the app): adb install <path_to_apk>
So I checked Cordova code to see what happens when apk is installed, and manually launched the command Cordova is using:
adb -s ' + resolvedTarget.target + ' install -r -d "' + apk_path + '"
It returns: “Error: unknown option -d”!
If you simply delete the “-d” option, applications run normally with
cordova run android
. On Cordova 5.0.0 you will find this commande at line 101 of file platforms\android\cordova\lib\device.js (and at line 311 of platforms\android\cordova\lib\emulator.js for cordova emulate android
).
I don’t know what this “-d” option is meant too… Is this a Cordova bug?
EDIT
As joris says in comment :
The
-d
is supposed to come directly afteradb
(as in--device
) instead of after install. So you can just move it there instead of removing it.
Plus, here is the opened issue on apache cordova issue tracker