Software Archive
Read-only legacy content
17060 讨论

Debug iOS app with Safari as chrome/inspect??

Hamilton_Tenório_da_
重要分销商 I
2,135 次查看

Is there a way to debug an iOS APP as we do with chrome://inspect (Android)?

I have one issue with an APP that is occuring only in iOS. In order of the pluigns, debug of XDK  (with AppPreview) is not working.

Thank you.

 

0 项奖励
8 回复数
John_H_Intel2
员工
2,135 次查看

What is not working with DAP? I just rebuild a new build and it installed just fine. What are you having issues with?

0 项奖励
Hamilton_Tenório_da_
重要分销商 I
2,135 次查看

When I start the debug, the console shows error at the first line of a plugin. See the image attached.

All the functions that depends of a plugin is not working.

I think that cordova plugins are not been executing on debug. Is it correct? 

 

 

0 项奖励
John_H_Intel2
员工
2,135 次查看

Third party plugins are not yet supported in DAP on iOS. They are supported for Android however, so if you have an Android device, you that to test with.

0 项奖励
Hamilton_Tenório_da_
重要分销商 I
2,135 次查看

Yes. I knew it. The problem is that on Android everything is OK. But on iOS, something is not working and I don´t know what. The app is loaded, but one action (speech to text) is not working. When I touch the button to start, not happen (no message, no error). I am looking for a way to debug as I do with Android (chrome://inspect). Is there?

0 项奖励
John_H_Intel2
员工
2,135 次查看

Yes, you can use safari. You need to enable it on the Develop tab.

0 项奖励
Hamilton_Tenório_da_
重要分销商 I
2,135 次查看

I found the problem. For Android, it is not necessary to mark CONNECTION Standard Cordova Plugin to check the internet connection (I don´t know why, but it works). Even without this plugin you have response from the the command "navigator.connection.type".

In iOS, this is necessary. Without it, the app crash. 

To solve, I checked this plugin and everything works now. 

0 项奖励
PaulF_IntelCorp
2,135 次查看

@Hamilton, you'll need a Mac running Safari:

  • Enable "web inspector" on the iOS device: open "Settings" > choose "Safari" > choose "Advanced" > set "Web Inspector" button to "on" (make it green).
  • Enable device debug in Safari on the Mac: select "Preferences" from the Safari menu > choose the "Advanced" tab > check the "Show Develop menu in menu bar" option (to enable this feature).
  • Build your app using an ad-hoc provisioning file and download the app to your Mac.
  • Re-sign the app you built with a dev provisioning file (easiest way to do this is with "iReSign"). You can download it directly from the GitHub repo and move the iReSign.app folder to your /Applications folder (or wherever you like...). See the README.md at the GitHub repo for some basic instructions, it's pretty straightforward. I believe it requires that Xcode be installed on your system.
  • Attach the iOS device to your Mac via USB.
  • Open iTunes and select the iOS device so you can see the apps on the device.
  • Drag the resigned IPA to the iTunes icon on the Mac's Dock.
  • Make sure you have selected "install" in the list of apps shown for the iOS device in iTunes -- should say "will install."
  • Sync iTunes with your iOS device, so it installs the re-signed app onto your device (push the "Apply" button in the lower right corner).
  • Start the app on your iOS device.
  • Debug with Safari on the Mac by selecting "Develop" from the Safari menu > "name of attached device" > "name of app to be debugged" > "index.html"
  • Safari Web Inspector will startup and you'll have a full debug environment (similar to Chrome Dev Tools)
0 项奖励
Hamilton_Tenório_da_
重要分销商 I
2,135 次查看

Thank you for this detailed points. I will try it. 

0 项奖励
回复