Troubleshooting an iOS mobile app
Application logs can help you troubleshoot mobile apps. Options in Safari for Web Inspector and JavaScript can help you debug JavaScript code for iOS mobile apps. Once you install and run the mobile app, you can start debugging the JavaScript code for the app directly from the JavaScript console in the Web Inspector.
When troubleshooting a mobile app created for the iOS platform:
- Ensure you set the application log level to debug.
- You can view application logs and local storage from the system info pages available in the side menu for the app.
- You can also view application logs directly from Xcode by opening the Devices window and selecting the connected device where the mobile app was installed.
In order to debug JavaScript code for a mobile app built for the iOS platform, you must do the following:
- Build your iOS mobile app by using an Apple developer certificate. Remember that:
- JavaScript debugging is not available in a mobile app that is built with the enterprise Apple distribution certificate.
- With the Apple developer certificate, you can install your mobile app only on devices that are registered with the Apple Developer Program.
- You can obtain your Apple developer private key by exporting it directly from your Xcode account, or alternatively, from the Keychain Access application on your Mac computer.
- Enable the Web Inspector and JavaScript in the device's Safari options.
- In the Safari options on your Mac computer, enable showing the develop menu in a menu option.
Previous topic Troubleshooting mobile apps Next topic Device logs