When run tns debug ios it tries to open Nativescript Inspector and immediately closes it and throws an error.
iOS
I'm trying to debug nativescript tutorial app nativescript-template-ng-tutorial, and when run tns debug ios it has problems.
https://youtu.be/XgSjqBD3z0M.
On 17th second it opens and closes the nativescript inspector at the same time.
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?
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?
@dnadoba
changing the URL when run tns debug ios --chrome is known and this is how it works right now.
Same issue here - missing symbol _CTFontCreateForCSS
Occurred after updating to the latest Xcode.
@anthonyball Do you mean 9.1 version? What version of XCode did you have with working inspector?
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.
@anthonyball, I updated xcode to 9.2, nothing changed, so will try to downgrade to 9.0
Same here, let me know if the downgrade does the trick please
@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
@anthonyball can you try to downgrade yourself? maybe i made mistake somewhere
facing same exact issue
Going to take a look at this tomorrow and see if downgrading to Xcode 9 will work or not. I鈥檒l let you know.
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.
@dtopuzov help us, pleeeease :)
Fix merged: https://github.com/NativeScript/ios-runtime/pull/838
It will be available in {N} 3.4.0, which will be released next week.
Fantastic news! Thanks!
Yeah baby! Thanks!
@dtopuzov, There is still this issue remained. Run tns debug ios --inspector and it trows the same error
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.
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
Reopen, since it looks we still have issues.
@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
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.
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
@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)
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.
@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 https://github.com/NativeScript/nativescript-cli/pull/3302)
@mbektchiev Hey, it works!!! Thank you!
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!
Closing since problems looks resolved.
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.
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.
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:
Hardware | Erase All Content and SettingsAs 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.
Most helpful comment
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!