function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
@altius_rup@altius_rup 

Mobile SDK 2.2.1 - iOS hybrid - no Javascript logs in Xcode console

Hi,
How can I get Javascript log messages (console.log) to appera in the XCode system log (or elsewhere) ?
Whe I run my app in the Safari browser on my Mac, console.log messages appear in the web browser developer console.
However, when running in the (Apple) iOS SImulator, they do not appear in XCode's console.

ANyone had this problem ? 

BTW the Cordova Logger and DebigConsole are declared in the confix.xml : any way to check whether they are active ?

Hope you can help,
Rup
Dev AngelDev Angel
Hi Rup,

You should be able to connect your safari browser to the iOS simulator. From the Salesforce iOS Hybrid Workbook:

Tutorial 2: Debugging a Hybrid Remote App
You’re probably already familiar with developer tools such as the Chrome Developer Tools that allow you to debug JavaScript
in web pages. Such tools make developing web apps much more pleasant than sprinkling alert() calls through the code! You’ll
be pleased to learn that we can achieve most, if not all, of the same functionality for hybrid apps using browser-based tools.
iOS Debug Setup
Debugging iOS apps is easy using Safari.
1. Run your app in the iOS Emulator, or a connected iOS device, then start Safari.
2. Select Safari > Preferences > Advanced.
3. Click Show Develop menu in menu bar, and close the preferences window.
4. Click the Develop menu and you should see a menu item corresponding to the iPhone Simulator or device.
5. Click the menu item, then click the Mobile Inventory entry in the sub menu and Safari will open, showing you the
application's Document Object Model tree, or DOM, a structural representation of the HTML page (click the top left
‘resources’ icon if you don’t see the DOM)