Troubleshooting an iOS custom mobile app
Application logs can help you troubleshoot custom mobile apps. Options in Safari for Web Inspector and JavaScript can help you debug JavaScript code for iOS custom mobile apps. Once you install and run the custom mobile app, you can start debugging the JavaScript code for the app directly from the JavaScript console in the Web Inspector.
When troubleshooting a custom 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 custom mobile app built for the iOS platform, you must do the following:
-
Build your iOS custom 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 custom 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.
Note:
For more information about certificates for the iOS platform, see
Generating mobile certificates for the iOS platform
on the PDN portal, and also
Maintaining Your Signing Identities and Certificates
on the Apple Developer Portal.