Loren
Loren

Reputation: 14866

How do you see logging from a Meteor Cordova iOS app?

From what I understand, doing a console.log in a normal Cordova app gets piped to the Xcode debug output, but that doesn't work for my Meteor Cordova iOS app, so I've been doing alerts, which isn't as good.

Upvotes: 2

Views: 1293

Answers (2)

RebelOfBabylon
RebelOfBabylon

Reputation: 668

@Ethaan's answer is a good point, but I don't think it is answering the OP's intended question. I am going to re-iterate the comment from @user728291 on the Question since I believe it is the sought answer.

Safari Remote Debugging will show you console.log messages from Xcode's simulator or a connected device.

And in the case that the hyper-link may someday be moot, I will re-iterate the referenced text from the link:

If you are doing iOS PhoneGap debugging and have the Safari Develop Menu enabled, you can access the currently active session through the built-in Safari Web Inspector. To activate, go to Develop -> (iPad || iPhone) Simulator (normally, the third menu item) and click the active session you want to connect to. Voila!

Upvotes: 2

Ethaan
Ethaan

Reputation: 11376

The same way you can use Meteor.isServer and Meteor.isClient booleans to separate your client-side code and server-side code, you can use Meteor.isCordova constant to separate your Cordova/Phonegap-specific code from the rest of code shipped to browsers and mobile devices.

From Meteor Cordova Phonegap Integration Documentation

So try with this.

if (Meteor.isCordova) {
      console.log('Hi iam on the console from Xcode")
      console.log("Welcome back " + Meteor.user().username);
      console.log("the user with the id  " + Meteor.userId() + " Just logged In");
    }

Upvotes: 1

Related Questions