I have seen already a number of border cases and strange developer interface.
From the "shake your device", which is really impractical, specially with a tablet
To working around Android studio to simulate a button press.
Is there a consistent way to do it? Can't we use a intern API to have a debug button within our app to launch such menu as
If you are on a mac, there is a handy tool called Frappe. https://github.com/niftylettuce/frappe
You can use this command from the shell
adb shell input keyevent 82
EDIT: this solution only works for android devices and is among the hacks proposed in the question above. So it is improvable. However It is selected as valid answer until this happens.