Xcode debugging(iOS)
Introduction
Xcode is the official IDE for iOS development. It is used to build iOS apps using Objective-C and Swift. It is also used to debug iOS apps. It is the equivalent of Android Studio for Android development.
Debugging webview javascript using Safari
See https://github.com/kaarbontech/device-app-builder/blob/production/docs/iOS/iOS_Debugging.md
Debugging native code using Xcode
When running the app in the simulator or device from xcode, you can use the Xcode debugger to debug the native code. This is useful for debugging plugins, or any native code that is interfacing with the javascript running in the webview. Breakpoints can be added to the native code.
Debugging the webview entrypoint index.html
🚨 Note. You can debug and make changes to the www/index.html entrypoint inside xcode, but beware that there is a staging area in the file browser, you need to make changes to the one in the staging area to see any changes.
Xcode Quirks
Some common issues that you may encounter when using Xcode.
Build fails due to signing certificate issues
If you are debugging the build in the simulator, you will probably not get this error. This happens when you are trying to build the app on a real device. You will need to use an device that has been added to the kaarbontech account and included in the "Kaarbontech Development" provisional profile. Add your device here.
Debugging device over wifi
You may find it is difficult to debug and keep your iOS device charged, as by default you need to have the device connected to your computer running xcode via a USB cable. You can debug over wifi, but you need to have the device connected to your computer via USB first. Go to Devices and Simulators ⌘⇧2 and select your device. You will see a checkbox for "Connect via network". Check this box and you can now debug over wifi.