Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-24381] IOS: Console log hangs on trying to connect to log server.

GitHub Issuen/a
TypeBug
PriorityNone
StatusResolved
ResolutionCannot Reproduce
Resolution Date2017-02-08T16:58:00.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsiOS
Labelsn/a
ReporterSharif AbuDarda
AssigneeChris Barber
Created2017-02-07T19:23:26.000+0000
Updated2017-02-09T15:38:53.000+0000

Description

Hello, When run "ti build -p ios" in studio terminal, The console log hangs on "trying to connect on log server ....". The app loads fine in the simulator but the console log stuck and never shows the -- Start simulator log ------------------------------------------------------- and the rest of app activity in console. It just sits there. But the app works fine. Environment:
Operating System
Name = Mac OS X
Version = 10.12.3
Architecture = 64bit

CPUs = 4

Memory = 8589934592 Node.js Node.js Version = 4.7.0 npm Version = 2.15.11 Titanium CLI CLI Version = 5.0.7 Titanium SDK SDK Version = 6.0.1.GA Target Platform = iphone, ipad Xcode 8.2.1 iOS 10.2 simulators
Sample code:
var win = Ti.UI.createWindow({
backgroundColor : "#fff"
});

var abutton = Ti.UI.createButton({
title : "click"
});

win.add(abutton);

abutton.addEventListener('click', function(e) {
Ti.API.info("########### Info");
Ti.API.warn("########### Warn");
Ti.API.error("########### Error");

});

win.open();
The console doesn't show anything clicking on the button.

Attachments

FileDateSize
Screen+Shot+2017-02-06+at+17.32.47.png2017-02-07T19:21:01.000+00003013635

Comments

  1. Hans Knöchel 2017-02-08

    [~sdarda] You couldn't reproduce the issue right? Maybe the port is used by some other application, but then the log-server should check for another one (which it would [here](https://github.com/appcelerator/ioslib/blob/master/lib/simulator.js#L1561) if the connection gets refused), but it doesn't.
  2. Sharif AbuDarda 2017-02-08

    Hello [~hansknoechel], Yes, I wasn't able to reproduce. For the customer it works on his another machine under same network connection.
  3. Hans Knöchel 2017-02-08

    Thx! Oh, and I forgot: Can they try specifying an own port in the tiapp.xml to use? An example of the tiapp section:
       <ios>
           <log-server-port>29173</log-server-port>
       </ios>
       
  4. Chris Barber 2017-02-08

    I am unable to reproduce this with 6.0.1.GA, latest 6_0_X build (6.0.2), and latest master build (6.1.0). Waiting for QE to try before resolving this as cannot reproduce. You should only have to set the <log-server-port> if you are consistently having problems, but generally you just need to quit (or reset) the iOS Simulator.
  5. Eric Wieber 2017-02-08

    I also am unable to reproduce this issue with 6.0.1.GA, 6.0.2, or 6.1.0 SDKs.
  6. Chris Barber 2017-02-08

    Thank you [~ewieber]! Resolving as cannot reproduce.
  7. Quinton Sheppard 2017-02-08

    It is unfortunate the issue can not be replicated your end. If it makes any difference when I run xCode 7.3 with 5.5 GA the console logs work fine, however on xCode 8.2.1 with 6.0.1 GA it does not show any console logs or Ti.API.info messages. I have also created a stack overflow item under: http://stackoverflow.com/questions/42072477/ti-api-info-not-writing-to-console I am going to re-install the system from scratch, then I hope it will work. will just install Appcelerator and its dependancies and run a default Classic project with no other applications installed. then 'if' it works, will install application one after the other to see if there are any port issues arising - Can't see why as Appcelerator is supposed to be intelligent enough to use a different port if the current port is in use. Thanks, Quinton
  8. Chris Barber 2017-02-08

    [~qsheppard] Actually, it is: https://github.com/appcelerator/titanium_mobile/blob/master/iphone/cli/commands/_build.js#L2373-L2431. Again, reset the iOS Simulator and try again.
  9. Hans Knöchel 2017-02-08

    I'd also like to know if it always tries to connect to port 19920. If so, check which service is using this port (netstat -anp tcp | grep 19920). But if the port would be used, the log-sever would try another one.
  10. Quinton Sheppard 2017-02-09

    I did the above command in the terminal during the build running in the simulator and after I quite the simulator. During: tcp4 0 0 127.0.0.1.19920 *.* LISTEN and after came back with nothing. however I do get 19920 port coming up each time I run it.
  11. Chris Barber 2017-02-09

    [~qsheppard] Here's another idea, the following is a Node.js client that connects to the app and streams the logs:
        require('net').connect(process.argv[2] || 10571)
        	.on('data', data => process.stdout.write(data.toString()))
        	.on('error', err => console.log('error!', err))
        	.on('end', () => console.log('disconnected from server'));
        
    Save that to client.js and run it node client.js 19920. I'd be curious if that works.
  12. Quinton Sheppard 2017-02-09

    Thanks Chris for that, I get the following in response... ARKDEV25:test_proj quintons_local$ node client.js 19920 error! { [Error: connect ECONNREFUSED ::1:19920] code: 'ECONNREFUSED', errno: 'ECONNREFUSED', syscall: 'connect', address: '::1', port: 19920 }
  13. Quinton Sheppard 2017-02-09

    and if the following helps... ps aux | grep node quintons_local 48962 0.9 0.0 2432804 2028 s000 S+ 3:22pm 0:00.00 grep node quintons_local 1853 0.0 0.7 3158080 58516 ?? S 11:44am 0:01.56 /Applications/Utilities/Adobe Creative Cloud/CCLibrary/CCLibrary.app/Contents/MacOS/../libs/node /Applications/Utilities/Adobe Creative Cloud/CCLibrary/CCLibrary.app/Contents/MacOS/../js/server.js quintons_local 923 0.0 0.6 3124056 47832 ?? S 11:33am 0:01.79 /Applications/Utilities/Adobe Creative Cloud/CCXProcess/CCXProcess.app/Contents/MacOS/../libs/node /Applications/Utilities/Adobe Creative Cloud/CCXProcess/CCXProcess.app/Contents/MacOS/../js/main.js root 104 0.0 0.1 2469688 5076 ?? Ss 11:30am 0:10.73 /System/Library/CoreServices/ionodecache -k /var/db/ionodecache.json
  14. Chris Barber 2017-02-09

    If you can't connect, then the app isn't running. You need to launch the app before trying to connect with the client. Have you tried resetting your iOS Simulator?

JSON Source