Unable to debug via IntelliJ

1,830 views
Skip to first unread message

Matt Sams

unread,
May 1, 2015, 2:54:47 PM5/1/15
to rob...@googlegroups.com
Every time I try to debug my iOS app on the simulator via IntelliJ I get the following error:

Error running simulator: Unable to open debugger port (127.0.0.1:51084): java.net.SocketException "Socket closed"

The port of course, changes each time.

I am able to 'run' the app just fine. Only debugging fails. I've spent all day clearing caches and recompiling this thing to no avail. Any ideas would be appreciated.

Thanks.

Mario Zechner

unread,
May 3, 2015, 5:51:33 AM5/3/15
to rob...@googlegroups.com
You project should have a folder called robovm-build/ containing a lot file for each debug run. Could you post the file for one of the failing runs?

Could you list all versions of software involved in this? (RoboVM, IntelliJ, Xcode etc.)

Can you start the app in debug mode if you clear all breakpoints?

Do you have any special networking configuration setup? The debugger needs to be able to use the loopback device at localhost/127.0.0.1.

Mario Zechner

unread,
May 3, 2015, 5:52:34 AM5/3/15
to rob...@googlegroups.com
And one more, after you launch in debug mode and the debugger fails, can you launch the app from the Sim directly by clicking its icon?

Matt Sams

unread,
May 4, 2015, 8:45:00 AM5/4/15
to rob...@googlegroups.com
Hi Mario, thanks for the reply.

Debug log from this morning: http://pastebin.com/ZbgL3iuE

IntelliJ: 14.1.2
RoboVM: 1.1.0
RoboVM Plugin: 1.1.0
Xcode: 6.3.1 (6D1002)
OS X: 10.10.3

The debug mode app will not start on its own from the simulator once the socket connection fails. The run mode app still does.

Clearing all breakpoints showed no change. The app splash screen shows, it sits for a moment or two, then goes back to the home screen. No errors are reported via console.

No special networking setup that I'm aware of. I can successfully ping localhost and 127.0.0.1.

Mario Zechner

unread,
May 4, 2015, 10:02:05 AM5/4/15
to rob...@googlegroups.com
Hi Matt,

thanks for the logs. It appears that the app crashes before the debugger has a chance to connect to it. I'll need the simulator crash log to figure out what's up. To get that you'll have to do the following:

1) Run the app in debug mode on the simulator and let it crash. Keep the simulator open
2) In the simulator, go to "Debug -> Open System Log", the system.log should be opened in the "Console" app
3) In the left sidebar, go to ~/Library/Logs/DiagnosticReports/
4) Locate your apps crash file. It's name is composed of your apps name and a timestamp, e.g. http://sht.tl/K3sSyN

Please post the contents here.

Thanks!
Mario

Matt Sams

unread,
May 4, 2015, 10:42:06 AM5/4/15
to rob...@googlegroups.com
The simulator doesn't seem to be producing any crash logs for my app in that location or any other that I can discern. 

My CoreSimulator.log under ~/Library/Logs/CoreSimulator shows the following over and over:

  1. May  4 10:30:20 Development-Mac-Mini.local CoreSimulatorService[29704] <Notice>: com.apple.CoreSimulator.CoreSimulatorService 117.15~1 starting.
  2. May  4 10:30:21 Development-Mac-Mini.local com.apple.dt.Xcode[28688] <Warning>: CoreSimulatorService connection interrupted.  Resubscribing to notifications.
  3. May  4 10:30:21 Development-Mac-Mini.local com.apple.iphonesimulator[28528] <Warning>: CoreSimulatorService connection interrupted.  Resubscribing to notifications.


Mario Zechner

unread,
May 4, 2015, 11:01:48 AM5/4/15
to rob...@googlegroups.com
Hm, without a crash log it's going to be hard to diagnose the issue. Is there a way for us to reproduce the problem? E.g. a sample project that fails for you? Does a plain libGDX app work?

Also, just to clarify. Running the app from IDEA in debug mode on the Sim crashes on startup. Starting the app after that directly on the Sim also crashes the app? In that case you should definitely get a crash log in the location I mentioned earlier.

Matt Sams

unread,
May 4, 2015, 11:40:40 AM5/4/15
to rob...@googlegroups.com
I did some more testing. I created a new project using the RoboVM plugin and at first it failed to connect for debugging but still ran from the simulator in debug mode. A second time I was able to connect with the debugger. I went back to my project and rebuilt everything. Removed the existing app from the simulator. RoboVM console showed it compiling some classes it hadn't notified me of previously. Weird, but ok. Again attempted to run with debugger attached and it failed. This time however I was able to launch the app from the simulator without a debugger attached. 

Found some possibly related info in system.log showing where the app is killed: http://pastebin.com/VpLmrkGs

I can package the project and give you a link, but I'd prefer to not do so publicly if possible as it's a company project.

Thanks for your continued help.

Mario Zechner

unread,
May 4, 2015, 12:19:40 PM5/4/15
to rob...@googlegroups.com
Could you also post the RoboVM debug log for this launch? My guess is that the app takes to long to startup. The simulator has a 30 second startup limit after which the app gets killed. The log you posted tells me that this is the case (signal 9).

Debugging on a device should work as we can work around the limit there.

We will do a release this week which brings a few optimizations that should help with this issue. Let's see if that fixes the issue for you. If not we can resort to looking at your project.

Thanks for helping us diagnose this!

Matt Sams

unread,
May 4, 2015, 1:09:55 PM5/4/15
to rob...@googlegroups.com
The log for that launch: http://pastebin.com/whwrwEcY

If the limit is 30 seconds then I can see it looks like it's taking too long for sure. Anything I can do on my side to speed that up?

We unfortunately don't have an actual test device yet so I'll have to work without simulator debugging for now otherwise.

Thanks.

Mario Zechner

unread,
May 4, 2015, 3:52:08 PM5/4/15
to rob...@googlegroups.com
There's currently no workaround. The next release (this Wednesday) may fix it. Not closing the simulator after launch also helps. Finally, if you work off of an HDD, you may want to try using a RAM disk http://docs.robovm.com/advanced-topics/ramdisks.html
Reply all
Reply to author
Forward
0 new messages