I want to see what happens in the iOS Simulator if I'm not testing the app in Xcode.
For example, if I open a link in the Safari simulator, see what happens in the console, or if I install a web-app, see the links that I'm pressing in console.
How can I do this?
I want to see it in Xcode or Terminal, but it's not a problem if I need to use another bit of software.
iOS Simulator > Menu Bar > Debug > Open System Log
Old ways:
iOS Simulator prints its logs directly to stdout, so you can see the logs mixed up with system logs.
Open the Terminal and type: tail -f /var/log/system.log
Then run the simulator.
EDIT:
This stopped working on Mavericks/Xcode 5. Now you can access the simulator logs in its own folder: ~/Library/Logs/iOS Simulator/<sim-version>/system.log
You can either use the Console.app to see this, or just do a tail (iOS 7.0.3 64 bits for example):
tail -f ~/Library/Logs/iOS\ Simulator/7.0.3-64/system.log
EDIT 2:
They are now located in ~/Library/Logs/CoreSimulator/<simulator-hash>/system.log
tail -f ~/Library/Logs/CoreSimulator/<simulator-hash>/system.log
Is this still accurate? I'm not seeing anything from
console.log
in these log usingtail
orConsole.app
iOS Simulator > Menu Bar > Debug > Open System Log
Thanks! Its ~/Library/Logs/CoreSimulator/<simulator-hash>/system.log these days though.
The answer from BYossarian is the "correct" one. "Develop menu in desktop safari that lets you see the iOS simulator console: Develop -> iPhone Simulator -> site name"
In case you're unsure of what
<simulator-hash>
to use (I was), you can also simply do:tail -f ~/Library/Logs/CoreSimulator/*/system.log
which would render all but keep on tailing only the one that gets updated (most likely the running one)