Skip to content

tns debug ios: nativescript inspector doesn't open on High Sierra and Xcode 9.2 #3240

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
shoudaos opened this issue Dec 3, 2017 · 32 comments

Comments

@shoudaos
Copy link

shoudaos commented Dec 3, 2017

Tell us about the problem

When run tns debug ios it tries to open Nativescript Inspector and immediately closes it and throws an error.

Which platform(s) does your issue occur on?

iOS

Please provide the following version numbers that your issue occurs with:

  • CLI: 3.3.1
  • Cross-platform modules: 3.1.1
  • Runtime(s): tns-ios: 3.3.0

Please tell us how to recreate the issue in as much detail as possible.

I'm trying to debug nativescript tutorial app nativescript-template-ng-tutorial, and when run tns debug ios it has problems.

Is there code involved? If so, please share the minimal amount of code needed to recreate the problem.

https://youtu.be/XgSjqBD3z0M.
On 17th second it opens and closes the nativescript inspector at the same time.

@dtopuzov
Copy link
Contributor

dtopuzov commented Dec 4, 2017

Hi @shoudaos

To be honest I have no idea what can cause the problem, but as temporary workaround I can suggest you using tns debug ios --chrome.

We will update the issue once we have idea what can be wrong.

btw, Can you reproduce the same issue with hello-world project?
Can you also try npm cache clean before debug?

@dnadoba
Copy link
Contributor

dnadoba commented Dec 4, 2017

I have exactly the same issue. The inspector crashes because of the missing symbol _CTFontCreateForCSS
https://gist.github.com/dnadoba/b41a86b7b8e7d1caf34234746102d502#file-nativescript-inspector-log

I can reproduce the issue with the hello-world project.
npm cache clean --force does not solve the problem.

tns debug ios --chrome does work but always creates a new URL.
I have to copy & paste the URL into chrome after every code change. Do I miss something?

@Natalia-Hristova
Copy link

@dnadoba
changing the URL when run tns debug ios --chrome is known and this is how it works right now.

@anthonyball
Copy link

Same issue here - missing symbol _CTFontCreateForCSS

Occurred after updating to the latest Xcode.

@shoudaos
Copy link
Author

shoudaos commented Dec 4, 2017

@anthonyball Do you mean 9.1 version? What version of XCode did you have with working inspector?

@anthonyball
Copy link

It was 9.0 I think. The update of Xcode happened at the same time as upgrading from Sierra to High Sierra so it could have been that or a combination of the two.

@shoudaos
Copy link
Author

shoudaos commented Dec 4, 2017

@anthonyball, I updated xcode to 9.2, nothing changed, so will try to downgrade to 9.0

@anthonyball
Copy link

Same here, let me know if the downgrade does the trick please

@shoudaos
Copy link
Author

shoudaos commented Dec 5, 2017

@anthonyball what can I say. Downloaded xcode 9.0 xip archive, then installed it, and when run tns run ios it can't find any ios simulator. i tried tns run ios even with --device simulatorID, nothing works.
When returned to 9.2 version all began to work again. But the issue with Inspector was remained.
It makes me crazy. I don't know what to do

@shoudaos
Copy link
Author

shoudaos commented Dec 5, 2017

@anthonyball can you try to downgrade yourself? maybe i made mistake somewhere

@brandontulsi
Copy link

facing same exact issue

@anthonyball
Copy link

Going to take a look at this tomorrow and see if downgrading to Xcode 9 will work or not. I’ll let you know.

@anthonyball
Copy link

Couldn't get an emulator loaded in Xcode 9 either when I downgraded. Nor could I get it to fire when loading the app straight onto a physical device. Currently going back to 9.2 and I expect the _CTFontCreateForCSS issue to remain.

@shoudaos
Copy link
Author

shoudaos commented Dec 6, 2017

@dtopuzov help us, pleeeease :)

@dtopuzov dtopuzov added the bug label Dec 14, 2017
@dtopuzov dtopuzov changed the title tns debug ios: nativescript inspector doesn't open tns debug ios: nativescript inspector doesn't open on High Sierra and Xcode 9.2 Dec 15, 2017
@dtopuzov
Copy link
Contributor

Fix merged: NativeScript/ios-jsc#838

It will be available in {N} 3.4.0, which will be released next week.

@dtopuzov dtopuzov added this to the 3.4.0 milestone Dec 15, 2017
@anthonyball
Copy link

Fantastic news! Thanks!

@shoudaos
Copy link
Author

Yeah baby! Thanks!

@shoudaos
Copy link
Author

@dtopuzov, There is still this issue remained. Run tns debug ios --inspector and it trows the same error

@thejonroberts
Copy link

The --inspector debug is crashing (immediately, with same error about _CTFontCreateForCSS) for me as well, after the 3.4.0 update (core, ios, & android). tns doctor check is all good.

High Sierra 10.13.2, Xcode 9.2.
Using nvm with node v8.9.3 and rbenv with ruby 2.3.3p222.

@pentool
Copy link

pentool commented Jan 18, 2018

I'm getting this error after issuing tns debug ios --inspector [--start]:

ADMIN$ tns debug ios --inspector --start
Searching for devices...

Setting up proxy...
Press Ctrl + C to terminate, or disconnect.

Using inspector from cache.
Command failed: open -a '/Users/ADMIN/.local/share/.nativescript-cli/ios-inspector/node_modules/tns-ios-inspector/NativeScript Inspector.app' --args '/Users/ADMIN/.local/share/.nativescript-cli/ios-inspector/node_modules/tns-ios-inspector/WebInspectorUI/Main.html' 'slider' '/var/folders/73/s92dkf012yb7r5nh8gldbnxm0000gn/T/118018-858-13rnqvp.tbos.sock'
LSOpenURLsWithRole() failed for the application /Users/ADMIN/.local/share/.nativescript-cli/ios-inspector/node_modules/tns-ios-inspector/NativeScript Inspector.app with error -10825.

Xcode 8.2.1 / iOS 9.3.5
OS X 10.11.6 (El Crapitan)
TNS 3.4.1

@dtopuzov
Copy link
Contributor

Reopen, since it looks we still have issues.

@dtopuzov dtopuzov reopened this Jan 18, 2018
@dtopuzov
Copy link
Contributor

dtopuzov commented Jan 18, 2018

@shoudaos @thejonroberts @pentool
In order to use the fix released with {N} 3.4 you should have both CLI and tns-ios updated to 3.4.*.

Can you confirm your test project is updated, can you reproduce it with hello-world app?

Can you also try to install the inspector as devDependency and test again:

cd <your project>
npm i tns-ios-inspector@latest --save-dev

@pentool
Copy link

pentool commented Jan 18, 2018

I didn't have tns-ios-inspector installed. I didn't know that was needed since I installed {N} using the basics setup. Anyhow, I have installed it per your instruction, but it did not make any difference.

  1. I have made sure my project and CLI is updated to 3.4.1 and verified it with tns doctor.
  2. I have ran the debug cmd before and after installing tns-ios-inspector. In both cases I got the same results (as below).

When running tns debug ios --inspector --start (including the --start flag) the output as follows (basically same as before):

ADMIN$ tns debug ios --inspector --start
Searching for devices...

Setting up proxy...
Press Ctrl + C to terminate, or disconnect.

Using inspector from cache.
Command failed: open -a '/Users/ADMIN/.local/share/.nativescript-cli/ios-inspector/node_modules/tns-ios-inspector/NativeScript Inspector.app' --args '/Users/ADMIN/.local/share/.nativescript-cli/ios-inspector/node_modules/tns-ios-inspector/WebInspectorUI/Main.html' 'sliding' '/var/folders/73/s92dkf012yb7r5nh8gldbnxm0000gn/T/118018-2468-171ow6z.wvgd.sock'
LSOpenURLsWithRole() failed for the application /Users/ADMIN/.local/share/.nativescript-cli/ios-inspector/node_modules/tns-ios-inspector/NativeScript Inspector.app with error -10825.

When running tns debug ios --inspector (without the --start flag) the output is:

ADMIN$ tns debug ios --inspector
Searching for devices...
Preparing project...
Successfully prepared plugin nativescript-theme-core for ios.
Successfully prepared plugin tns-core-modules for ios.
Successfully prepared plugin tns-core-modules-widgets for ios.
Project successfully prepared (iOS)
Building project...
Xcode build...

Project successfully built.
Installing...
Successfully installed on device with identifier 'E31D1F86-3295-4646-AA53-F25E072FE3A7'.
Successfully transferred all files.
Starting iOS Simulator

Setting up proxy...
Press Ctrl + C to terminate, or disconnect.

Using inspector from cache.
Starting iOS Simulator

Setting up proxy...
Press Ctrl + C to terminate, or disconnect.

Using inspector from cache.
Unable to apply changes on device: E31D1F86-3295-4646-AA53-F25E072FE3A7. Error is: Command failed: open -a '/Users/ADMIN/.local/share/.nativescript-cli/ios-inspector/node_modules/tns-ios-inspector/NativeScript Inspector.app' --args '/Users/ADMIN/.local/share/.nativescript-cli/ios-inspector/node_modules/tns-ios-inspector/WebInspectorUI/Main.html' 'sliding' '/var/folders/73/s92dkf012yb7r5nh8gldbnxm0000gn/T/118018-2489-1nn0b8m.271k.sock'
LSOpenURLsWithRole() failed for the application /Users/ADMIN/.local/share/.nativescript-cli/ios-inspector/node_modules/tns-ios-inspector/NativeScript Inspector.app with error -10825.
.
Jan 18 07:45:35 sliding[2653]: assertion failed: 15G18013 13E233: libxpc.dylib + 57882 [66C28065-C9DB-3C8E-926F-5A40210A6D1B]: 0x7d
error: attach failed: unable to attach
error: Process must be launched.

At this point my console seem to hang because I'm not able to Ctrl+C out of it.

Also verified by creating a basic hello-word app. I get the same result. For the basic hello-world, I also tried it first without and then with the tns-ios-inspector installed.

Xcode 8.2.1 / iOS 9.3.5
OS X 10.11.6 (El Crapitan)
TNS 3.4.1

@mbektchiev
Copy link
Contributor

@pentool It seems that the package is still not found in your application. The inspector which is launched is from /Users/ADMIN/.local/share/.nativescript-cli/ios-inspector. Can you try deleting this directory? This will force TNS CLI to download it again. Also can you check it's package.json to see which version of tns-ios-inspector has been cached there?

Running tns debug ios --inspector --start --log trace may help in diagnosing what is causing usage of the wrong version if it's different than the latest (3.4.3)

@pentool
Copy link

pentool commented Jan 18, 2018

I have deleted the tns-ios-inspector cached folder at /Users/ADMIN/.local/share/.nativescript-cli/ios-inspector and reinstalled it for the basic hello-world project.

It seems this time it is trying to launch it from the correct/project folder, but it still giving me the same issue.

ADMIN$ tns debug ios --inspector
Searching for devices...
Preparing project...
Project successfully prepared (iOS)
Building project...
Xcode build...
=== BUILD TARGET sliding OF PROJECT sliding WITH CONFIGURATION Debug ===

..usual warnings here...

Project successfully built.
Installing...
Successfully installed on device with identifier 'E31D1F86-3295-4646-AA53-F25E072FE3A7'.
Successfully transferred all files.
Starting iOS Simulator

Setting up proxy...
Press Ctrl + C to terminate, or disconnect.

Starting iOS Simulator

Setting up proxy...
Press Ctrl + C to terminate, or disconnect.

Unable to apply changes on device: E31D1F86-3295-4646-AA53-F25E072FE3A7. Error is: Command failed: open -a '/Users/ADMIN/Development/NativeScript/sliding/node_modules/tns-ios-inspector/NativeScript Inspector.app' --args '/Users/ADMIN/Development/NativeScript/sliding/node_modules/tns-ios-inspector/WebInspectorUI/Main.html' 'sliding' '/var/folders/73/s92dkf012yb7r5nh8gldbnxm0000gn/T/118018-2770-315ngh.cfhbp.sock'
LSOpenURLsWithRole() failed for the application /Users/ADMIN/Development/NativeScript/sliding/node_modules/tns-ios-inspector/NativeScript Inspector.app with error -10825.
.
Jan 18 07:51:32 Maxi sliding[2906]: assertion failed: 15G18013 13E233: libxpc.dylib + 57882 [66C28065-C9DB-3C8E-926F-5A40210A6D1B]: 0x7d
error: attach failed: unable to attach
error: Process must be launched.

The tns-ios-inspector's package.json file is showing v3.4.3.

@mbektchiev
Copy link
Contributor

mbektchiev commented Jan 19, 2018

@pentool I just managed to reproduce the problem. It seems that the latest version of tns-ios-inspector which runs on MacOS X El Capitan is 3.1.0. If you install this version in your project, you will be able to successfully launch the inspector.

The reason that you haven't received this error earlier is that with TNS CLI 3.4.1 we've fixed a bug which prevented the inspector package from being ever updated after its first installation. (See #3302)

@pentool
Copy link

pentool commented Jan 19, 2018

@mbektchiev Hey, it works!!! Thank you!

@thejonroberts
Copy link

Inspector 3.4.3 (1) is working for me now. I just ran tns update, after updating the os to 10.13.2. If I have any issues, I will downgrade to 3.1.0. I think my issue may have been that tns-ios was not up to date. Thank you @dtopuzov and @mbektchiev!

@dtopuzov
Copy link
Contributor

Closing since problems looks resolved.

@danbockapps
Copy link

I am getting this error with newer versions of everything. I get it (sometimes!) with both tns debug ios and tns debug ios --inspector. Sometimes the Chrome debugger works. Other times I get the error messages. Other times I don't get the error messages, but I can't see any sources in the debugger. I don't think I've ever gotten Inspector work. I have tns-ios 4.0.1 and tns-ios-inspector 4.0.0. MacOS Sierra 10.12.6.

error: attach failed: unable to attach
error: Process must be launched.

@wyattp11
Copy link

wyattp11 commented May 23, 2018

Having the same issue, reinstalled pretty much everything. Haven't rebuilt project yet. Tried removing iOS folder etc as outlined above. If I try to launch inspector manually it just quits.

Sierra 10.13.4

Scratch that... working again, updated to {N} 4.0.1 got it working again. Not sure why I wasn't updated already, I updated yesterday.

@mbektchiev
Copy link
Contributor

mbektchiev commented May 25, 2018

Hi @danbockapps,

Accept my apologies for the delayed response. The error message you are receiving may be caused by a leaked lldb and/or {N} CLI processes. I suggest that you try the following one by one to see if it will help:

  1. Restart the iOS simulator application
  2. Restart your Mac
  3. As a last resort try to reset the simulator. From the menu click on Hardware | Erase All Content and Settings

As an additional note I'd like to tell you that in the upcoming 4.1.0 release of NativeScript we've made improvements in the debugging experience on iOS. They should address some of the sporadic issues with inability to start debug sessions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests