$state.transitionTo works in ionic serve but not when deployed in Mobile App

I have written a basic ionic app -
in the index.html I have tags in which the screens are to be loaded.
I have three screens. The first screen loads in
I am using $state.transitionTo (‘screen2’)/$state.transitionTo (‘screen3’) in a function which is called on button click in screen1.
The transition works perfectly on browser using ionic serve. However when i deploy the app for testing on the emulator or device the app does not transition to the required screens. I have some validations on the button click which are working fine on the mobile app. however nothing beyond that.

Two things:

1). In your states, how is the HTML linked to? Something like :

template : "/screen2.html"

If so, be sure you aren’t using a leading /. iOS will not accept that.

2). Use GapDebug or the Safari Developer Tools to inspect the app. If you just use Safari, you won’t catch any failures on load. However, once open in the inspector, tap the “Reload” icon and the app will reload. You may find a console error or something.

Thanks for the relpy. Your suggestion to use GapDebug actually helped a lot.Issue was in template defination. And the debugger helped me solve several other minor bugs.