How to debug an app when running on emulator?


My app is working perfectly on Safari, Chrome and Firefox. When launched from the IOS emulator it fails to render a modal input field (built with an Angular directive). If I add the “-L” option to “ionic emulate ios” it render the input field but some functionality is not working properly. Is there a way to debug the IOS emulator?


Now I’m able to debug thx to this nice post How can I properly debug iOS on a simulator?
The ionic emulate -lc command line is working great I can see the errors the emulator is throwing.
Now I’m facing another issue :frowning:

Inside the directive I have this code:

scope.searchText = scope.suggestions[scope.selectedIndex].surname;

which is perfectly working on the browser but on the emulator I receive this error:

871769   error    Error: undefined is not an object (evaluating 'scope.suggestions[scope.selectedIndex].surname')
dispatchEvent@[native code]


Same problem here. Having undefined is not an object error as well. Can’t figure out whats wrong.


You guys should be able to inspect the emulator, the same way you could do with a real phone. Open a chrome browser, and visit chrome://inspect/#devices page :slight_smile: