Cordova's deviceready not working when debugging from device

Hello everyone! I run the command ionic run android, and enable my environment to debug from my device. Everything fine.

My code call the Cordova’s deviceready (Doc here!).
However, Cordova seems not to be ready, so my callback is never called. Important: If I build the apk, the issue doesn’t happen, only if I deploy to device.

I was using OpenFB.
OpenFB plugin can’t manage well this event if you don’t call these two functions:

openFB.login(…);
openFB.api({…});

If you only call one, the error occurs. You need to call these 2 properly.