# NSLog while debugging the simulator

**URL:** https://talk.remobjects.com/t/nslog-while-debugging-the-simulator/26890
**Category:** Fire
**Created:** [July 1, 2022, 2:50pm UTC](https://talk.remobjects.com/t/nslog-while-debugging-the-simulator/26890 "2022-07-01T14:50:41Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![JohnMoshakis](https://talk.remobjects.com/user_avatar/talk.remobjects.com/johnmoshakis/32/2286_2.png) [@JohnMoshakis](https://talk.remobjects.com/u/JohnMoshakis)
#### Post date: [July 1, 2022, 2:50pm UTC](https://talk.remobjects.com/t/nslog-while-debugging-the-simulator/26890/1 "2022-07-01T14:50:41Z")

</div>

Hi,  
I dont think NSLog statements are appearing in the debug info window while debugging in the ios simulator. I can see them in console.

Cheers,  
John

---

<div class="post-metadata">

### Author: ![mh](https://talk.remobjects.com/user_avatar/talk.remobjects.com/mh/32/18050_2.png) [@mh](https://talk.remobjects.com/u/mh)
#### Post date: [July 1, 2022, 2:53pm UTC](https://talk.remobjects.com/t/nslog-while-debugging-the-simulator/26890/2 "2022-07-01T14:53:41Z")

</div>

> [@JohnMoshakis](#):
>
> I dont think NSLog statements are appearing in the debug info window while debugging in the ios simulator. I can see them in console.

I believe that is not only known, the debug console even explicitly tells you. Simulator shows only stdout, no NSog, device shows only NSLog, no stdout, IIRC. Which I know is annoying, but out of my hands. FWIW, if you use Elements RTL’s “Log” function, it should do the right thing for either.

---

<div class="post-metadata">

### Author: ![mh](https://talk.remobjects.com/user_avatar/talk.remobjects.com/mh/32/18050_2.png) [@mh](https://talk.remobjects.com/u/mh)
#### Post date: [July 1, 2022, 2:58pm UTC](https://talk.remobjects.com/t/nslog-while-debugging-the-simulator/26890/3 "2022-07-01T14:58:01Z")

</div>

Hm, actually no, it’s supposed to be the reverse, stdout doesn’t work in Simulator, NSLog used to, but I can confirm it also no longer does :(. I will have a look but chances are that this is out of my control (I just capture what “`simctl`” gives me), and something Apple changed/broke.

---

<div class="post-metadata">

### Author: ![JohnMoshakis](https://talk.remobjects.com/user_avatar/talk.remobjects.com/johnmoshakis/32/2286_2.png) [@JohnMoshakis](https://talk.remobjects.com/u/JohnMoshakis)
#### Post date: [July 1, 2022, 2:58pm UTC](https://talk.remobjects.com/t/nslog-while-debugging-the-simulator/26890/4 "2022-07-01T14:58:32Z")

</div>

```auto
~> Please note: The debugger cannot capture StdOut (from `print()` or `writeLn()`) from the Simulator. `NSLog()` will be visible.

```

To me that reads like NSLog will be visible. I didnt know about Log, that would be handy but it doesnt appear to work

---

<div class="post-metadata">

### Author: ![mh](https://talk.remobjects.com/user_avatar/talk.remobjects.com/mh/32/18050_2.png) [@mh](https://talk.remobjects.com/u/mh)
#### Post date: [July 1, 2022, 2:58pm UTC](https://talk.remobjects.com/t/nslog-while-debugging-the-simulator/26890/5 "2022-07-01T14:58:58Z")

</div>

> [@JohnMoshakis](#):
>
> To me that reads like NSLog will be visible. I didnt know about Log, that would be handy but it doesnt appear to work

> [@mh](#):
>
> Hm, actually no, it’s supposed to be the reverse, stdout doesn’t work in Simulator, NSLog used to, but I can confirm it also no longer does :(. I will have a look but chances are that this is out of my control (I just capture what “`simctl`” gives me), and something Apple changed/broke.

^^^

---

<div class="post-metadata">

### Author: ![JohnMoshakis](https://talk.remobjects.com/user_avatar/talk.remobjects.com/johnmoshakis/32/2286_2.png) [@JohnMoshakis](https://talk.remobjects.com/u/JohnMoshakis)
#### Post date: [July 1, 2022, 2:59pm UTC](https://talk.remobjects.com/t/nslog-while-debugging-the-simulator/26890/6 "2022-07-01T14:59:22Z")

</div>

Yes sorry I hit send after you replied

---

<div class="post-metadata">

### Author: ![mh](https://talk.remobjects.com/user_avatar/talk.remobjects.com/mh/32/18050_2.png) [@mh](https://talk.remobjects.com/u/mh)
#### Post date: [July 1, 2022, 3:01pm UTC](https://talk.remobjects.com/t/nslog-while-debugging-the-simulator/26890/7 "2022-07-01T15:01:56Z")

</div>

```auto
Simulator is already booted.
Running /usr/bin/xcrun simctl install E602CCE9-C591-4FF6-AAD3-2702D04F2DB3 "/Users/mh/Test Projects/App2/Bin/Debug/iOS Simulator/App2.app"
Running /usr/bin/xcrun simctl launch -w --stdout=/var/folders/9f/k6_0xsw91hdbgjgkby0zs6xc0000gn/T/4E057334-11AE-4710-8839-55BAC8413DD6/stdout --stderr=/var/folders/9f/k6_0xsw91hdbgjgkby0zs6xc0000gn/T/DE7DA45A-8762-4350-925C-2E867733F807/stderr E602CCE9-C591-4FF6-AAD3-2702D04F2DB3 org.me.App2
reading StdOut from /Users/mh/Library/Developer/CoreSimulator/Devices/E602CCE9-C591-4FF6-AAD3-2702D04F2DB3/data/var/folders/9f/k6_0xsw91hdbgjgkby0zs6xc0000gn/T/4E057334-11AE-4710-8839-55BAC8413DD6/stdout
reading StdErr from /Users/mh/Library/Developer/CoreSimulator/Devices/E602CCE9-C591-4FF6-AAD3-2702D04F2DB3/data/var/folders/9f/k6_0xsw91hdbgjgkby0zs6xc0000gn/T/DE7DA45A-8762-4350-925C-2E867733F807/stderr

```

all looks proper to me :(.

---

<div class="post-metadata">

### Author: ![mh](https://talk.remobjects.com/user_avatar/talk.remobjects.com/mh/32/18050_2.png) [@mh](https://talk.remobjects.com/u/mh)
#### Post date: [July 1, 2022, 3:04pm UTC](https://talk.remobjects.com/t/nslog-while-debugging-the-simulator/26890/8 "2022-07-01T15:04:43Z")

</div>

I see there’s a new `--console` option for simctl launch though. I’ll see if I can make that one work.

---

<div class="post-metadata">

### Author: ![mh](https://talk.remobjects.com/user_avatar/talk.remobjects.com/mh/32/18050_2.png) [@mh](https://talk.remobjects.com/u/mh)
#### Post date: [July 1, 2022, 3:40pm UTC](https://talk.remobjects.com/t/nslog-while-debugging-the-simulator/26890/9 "2022-07-01T15:40:41Z")

</div>

Can’t get `--console` to work reliably.

i run

```auto
/usr/bin/xcrun simctl launch -w --console E602CCE9-C591-4FF6-AAD3-2702D04F2DB3 org.me.App2
org.me.App2: 56814

```

from terminal and its fine, and console output work ( **but** I still only get NSLog, not the actual stdout). if I tun it from inside Fire I never get the response message with the pid (which I get fine when running it with `--stdout`). :(.

I’ll keep digging deeper, later.
