简体   繁体   中英

phonegap iOS app working on simulator but not in device. How to debug

I just finished developing a Cordova / Phonegapp app. When I test it on iOS simulator it all works fine and quick, but, when testing on device it works only part of it.

My app is a game with the kingdom background and has 8 buttons (8 buildings).

When I click on each building it leads me to a screen representing what it's inside the building, but one of them doesn't work and gets my app frozen.

How can I see fail or crash reports that helps me debug my app on device?

If you provide full path to your file ie "file:///Users/.../someDir/some.html" it will work only on simulator running on the same machine where your project is.

I suggest just adding the additional path to the file you want to access ie if you are in "/someDir" you will need to provide only "some.html" or if you want to access parent directory just use "../".

As far as debugging Cordova app, I suggest downloading this plugin and using console.log instead of alert .

Hope this helped.

好的,我找到了一种通过alert调试我的应用程序的“斯巴达式”方法,发现网址设置不正确(仍然不知道为什么它可以在模拟器上运行)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM