Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Cannot debug with --debug-brk on any platform, any device  #9708

Copy link
Copy link
Open
@dlcole

Description

@dlcole
Issue body actions

Issue Description

I'm using Nativescript 8.1.5. I ran tns create to create a new Plain JavaScript, Tabs project. I added the Android and iOS platforms. Pure vanilla, new project.

I then ran tns debug <platform> --device <device id> --debug-brk to stop the Chrome debugger at the application start, on both Android and iOS, and on both emulator and real devices. In all cases, the debugger failed to intercept the application start.

This is running on a macOS Monterey 12.0.1 (latest version) and Chrome 96.0.4664.110 (latest version).

Reproduction

See issue description, above.

Relevant log output (if applicable)

With iOS emulator

[~/Documents/NativeScriptProjects/newapp]$ tns debug ios --emulator --debug-brk
Searching for devices...
Preparing project...
webpack is watching the files...
resolving "./app.scss" to "./app.ios.scss"
assets by path *.js 6.64 MiB
  asset vendor.js 5.95 MiB [emitted] (name: vendor) (id hint: defaultVendor)
  asset bundle.js 694 KiB [emitted] (name: bundle)
  asset runtime.js 12.4 KiB [emitted] (name: runtime)
assets by path fonts/*.ttf 374 KiB
  asset fonts/fa-solid-900.ttf 204 KiB [emitted] [from: app/fonts/fa-solid-900.ttf] [copied]
  asset fonts/fa-brands-400.ttf 131 KiB [emitted] [from: app/fonts/fa-brands-400.ttf] [copied]
  asset fonts/fa-regular-400.ttf 39.1 KiB [emitted] [from: app/fonts/fa-regular-400.ttf] [copied]
asset tns_modules/inspector_modules.js 1.22 KiB [emitted] (name: tns_modules/inspector_modules)
Entrypoint bundle 6.64 MiB = runtime.js 12.4 KiB vendor.js 5.95 MiB bundle.js 694 KiB
Entrypoint tns_modules/inspector_modules 5.96 MiB = runtime.js 12.4 KiB vendor.js 5.95 MiB tns_modules/inspector_modules.js 1.22 KiB
runtime modules 2.72 KiB 8 modules
orphan modules 356 bytes [orphan] 6 modules
modules by path ./node_modules/ 2.26 MiB 296 modules
modules by path ./app/ 250 KiB
  optional modules 124 KiB [optional] 10 modules
  ./app/__@nativescript_webpack_virtual_entry_javascript__ 224 bytes [built] [code generated]
  ./app/app.js 3.15 KiB [built] [code generated]
  ./app/ sync .(xml|js|s?css)$ 635 bytes [built] [code generated]
  ./app/app.ios.scss 120 KiB [built] [code generated]
  ./app/browse/browse-view-model.js 192 bytes [built] [code generated]
  ./app/home/home-items-view-model.js 1.55 KiB [built] [code generated]
  ./app/search/search-view-model.js 192 bytes [built] [code generated]
external "~/package.json" 42 bytes [optional] [built] [code generated]
webpack 5.65.0 compiled successfully in 5374 ms
Webpack compilation complete. Watching for file changes.
File change detected. Starting incremental webpack compilation...
resolving "./app.scss" to "./app.ios.scss"
assets by status 7 MiB [cached] 7 assets
Entrypoint bundle 6.64 MiB = runtime.js 12.4 KiB vendor.js 5.95 MiB bundle.js 694 KiB
Entrypoint tns_modules/inspector_modules 5.96 MiB = runtime.js 12.4 KiB vendor.js 5.95 MiB tns_modules/inspector_modules.js 1.22 KiB
cached modules 2.5 MiB (javascript) 2.72 KiB (runtime) [cached] 353 modules
built modules 859 bytes [built]
  ./app/__@nativescript_webpack_virtual_entry_javascript__ 224 bytes [built]
  ./app/ sync .(xml|js|s?css)$ 635 bytes [built]
webpack 5.65.0 compiled successfully in 144 ms
Webpack compilation complete. Watching for file changes.
(node:32575) [DEP0148] DeprecationWarning: Use of deprecated folder mapping "./" in the "exports" field module resolution of the package at /Users/david/Documents/NativeScriptProjects/newapp/node_modules/tslib/package.json.
Update this package.json to use a subpath pattern like "./*".
(Use `node --trace-deprecation ...` to show where the warning was created)
Installing pods...
Analyzing dependencies
Downloading dependencies
Generating Pods project
Integrating client project

[!] Please close any current Xcode sessions and use `newapp.xcworkspace` for this project from now on.
Pod installation complete! There are 0 dependencies from the Podfile and 0 total pods installed.

[!] The Podfile does not contain any dependencies.

[!] Automatically assigning platform `iOS` with version `9.0` on target `newapp` because no platform was specified. Please specify a platform for this target in your Podfile. See `https://guides.cocoapods.org/syntax/podfile.html#platform`.
Updating runtime package.json with configuration values...
Project successfully prepared (ios)
Building project...
Xcode build...
./.build_env_vars.sh: line 448: declare: UID: readonly variable
NSLD: Swift bridging header '*-Swift.h' not found under '/Users/david/Library/Developer/Xcode/DerivedData/newapp-ebvzzqphdvukmuczpkukrbgvqhwu/Build/Intermediates.noindex/newapp.build/Debug-iphonesimulator/newapp.build/Objects-normal/x86_64'
Generating metadata...~/Documents/NativeScriptProjects/newapp/platforms/ios/internal/metadata-generator-x86_64/bin ~/Documents/NativeScriptProjects/newapp/platforms/ios
Python version: 2.7.18 (default, Oct  2 2021, 04:20:39) 
[GCC Apple LLVM 13.0.0 (clang-1300.0.29.1) [+internal-os, ptrauth-isa=deploymen
Generating metadata for x86_64
Metadata Generator Arguments: 
./objc-metadata-generator -verbose -output-bin /Users/david/Documents/NativeScriptProjects/newapp/platforms/ios/build/Debug-iphonesimulator/metadata-x86_64.bin -output-umbrella /Users/david/Documents/NativeScriptProjects/newapp/platforms/ios/build/Debug-iphonesimulator/umbrella-x86_64.h -docset-path /Users/david/Library/Developer/Shared/Documentation/DocSets/com.apple.adc.documentation.iOS.docset Xclang -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.2.sdk -mios-simulator-version-min=9.0 -std=gnu99 -target x86_64-apple-ios13.0-macabi -I/Users/david/Documents/NativeScriptProjects/newapp/platforms/ios/build/Debug-iphonesimulator/include -I/Users/david/Documents/NativeScriptProjects/newapp/platforms/ios/internal/Swift-Modules -I/Users/david/Documents/NativeScriptProjects/newapp/platforms/ios/internal -I/Users/david/Documents/NativeScriptProjects/newapp/platforms/ios/../../App_Resources/iOS/src -I/Users/david/Documents/NativeScriptProjects/newapp/platforms/ios/../../node_modules/@nativescript/core/platforms/ios/src -F/Users/david/Documents/NativeScriptProjects/newapp/platforms/ios/build/Debug-iphonesimulator -F/Users/david/Documents/NativeScriptProjects/newapp/platforms/ios/internal/ -F/Users/david/Documents/NativeScriptProjects/newapp/platforms/ios/build/Debug-iphonesimulator -F/Users/david/Documents/NativeScriptProjects/newapp/platforms/ios/../../node_modules/@nativescript/core/platforms/ios -DCOCOAPODS=1 -DDEBUG=1 
Clang Arguments: 
"-v", "-x", "objective-c", "-fno-objc-arc", "-fmodule-maps", "-ferror-limit=0", "-Wno-unknown-pragmas", "-Wno-ignored-attributes", "-Wno-nullability-completeness", "-Wno-expansion-to-defined", "-D__NATIVESCRIPT_METADATA_GENERATOR=1", "-isysroot", "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.2.sdk", "-mios-simulator-version-min=9.0", "-std=gnu99", "-target", "x86_64-apple-ios13.0-macabi", "-I/Users/david/Documents/NativeScriptProjects/newapp/platforms/ios/build/Debug-iphonesimulator/include", "-I/Users/david/Documents/NativeScriptProjects/newapp/platforms/ios/internal/Swift-Modules", "-I/Users/david/Documents/NativeScriptProjects/newapp/platforms/ios/internal", "-I/Users/david/Documents/NativeScriptProjects/newapp/platforms/ios/../../App_Resources/iOS/src", "-I/Users/david/Documents/NativeScriptProjects/newapp/platforms/ios/../../node_modules/@nativescript/core/platforms/ios/src", "-F/Users/david/Documents/NativeScriptProjects/newapp/platforms/ios/build/Debug-iphonesimulator", "-F/Users/david/Documents/NativeScriptProjects/newapp/platforms/ios/internal/", "-F/Users/david/Documents/NativeScriptProjects/newapp/platforms/ios/build/Debug-iphonesimulator", "-F/Users/david/Documents/NativeScriptProjects/newapp/platforms/ios/../../node_modules/@nativescript/core/platforms/ios", "-DCOCOAPODS=1", "-DDEBUG=1", 
Merged 860 categories.
Result: 47699 declarations from 159 top level modules
Done! Running time: 6.32407 sec 
Saving metadata generation's stderr stream to: /Users/david/Documents/NativeScriptProjects/newapp/platforms/ios/build/Debug-iphonesimulator/metadata-generation-stderr-x86_64.txt
~/Documents/NativeScriptProjects/newapp/platforms/ios
ld: warning: dylib (/Users/david/Documents/NativeScriptProjects/newapp/platforms/ios/build/Debug-iphonesimulator/TNSWidgets.framework/TNSWidgets) was built for newer iOS Simulator version (12.0) than being linked (9.0)
note: Using new build system
note: Using codesigning identity override: 
note: Planning
note: Build preparation complete
note: Building targets in dependency order
Project successfully built.
The build result is located at: /Users/david/Documents/NativeScriptProjects/newapp/platforms/ios/build/Debug-iphonesimulator/newapp.app
Installing on device 4639270D-07F1-4253-AEDC-744FB306AEB1...
Successfully installed on device with identifier '4639270D-07F1-4253-AEDC-744FB306AEB1'.
Successfully transferred all files on device 4639270D-07F1-4253-AEDC-744FB306AEB1.
Restarting application on device 4639270D-07F1-4253-AEDC-744FB306AEB1...
org.nativescript.newapp: org.nativescript.newapp: 32766
'--chrome' is the default behavior. Use --inspector to debug iOS applications using the Safari Web Inspector.

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

Opened localhost 41000
To start debugging, open the following URL in Chrome:
devtools://devtools/bundled/inspector.html?ws=localhost:41000

Successfully synced application org.nativescript.newapp on device 4639270D-07F1-4253-AEDC-744FB306AEB1.
Frontend client connected.
NativeScript debugger was not able to get inspector socket port on device 4639270D-07F1-4253-AEDC-744FB306AEB1 for application org.nativescript.newapp.
Cannot connect to device socket. The error message is 'Device socket port cannot be found.'.



With iOS device: 

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

Opened localhost 41000
To start debugging, open the following URL in Chrome:
devtools://devtools/bundled/inspector.html?ws=localhost:41000

Successfully synced application org.nativescript.newapp on device 892bccc3f7f0e36c91ee71a32b598b769097ce07.
Frontend client connected.
NativeScript debugger has opened inspector socket on port 18183 for org.nativescript.newapp.
Backend socket created.

(App starts after delay, chrome never "catches" )

With Android device: 

[~/Documents/NativeScriptProjects/newapp]$ tns debug android --device 988820343543344b30 --debug-brk
Searching for devices...
Your application will be deployed only on the device specified by the provided index or identifier.
Preparing project...
webpack is watching the files...
resolving "./app.scss" to "./app.android.scss"
assets by path *.js 6.28 MiB
  asset vendor.js 5.59 MiB [emitted] (name: vendor) (id hint: defaultVendor)
  asset bundle.js 694 KiB [emitted] (name: bundle)
  asset runtime.js 12.4 KiB [emitted] (name: runtime)
assets by path fonts/*.ttf 374 KiB
  asset fonts/fa-solid-900.ttf 204 KiB [emitted] [from: app/fonts/fa-solid-900.ttf] [copied]
  asset fonts/fa-brands-400.ttf 131 KiB [emitted] [from: app/fonts/fa-brands-400.ttf] [copied]
  asset fonts/fa-regular-400.ttf 39.1 KiB [emitted] [from: app/fonts/fa-regular-400.ttf] [copied]
Entrypoint bundle 6.28 MiB = runtime.js 12.4 KiB vendor.js 5.59 MiB bundle.js 694 KiB
runtime modules 2.72 KiB 8 modules
orphan modules 356 bytes [orphan] 6 modules
modules by path ./node_modules/ 2.12 MiB 293 modules
modules by path ./app/ 250 KiB
  optional modules 124 KiB [optional] 10 modules
  ./app/__@nativescript_webpack_virtual_entry_javascript__ 224 bytes [built] [code generated]
  ./app/app.js 3.15 KiB [built] [code generated]
  ./app/ sync .(xml|js|s?css)$ 635 bytes [built] [code generated]
  ./app/app.android.scss 120 KiB [built] [code generated]
  ./app/browse/browse-view-model.js 192 bytes [built] [code generated]
  ./app/home/home-items-view-model.js 1.55 KiB [built] [code generated]
  ./app/search/search-view-model.js 192 bytes [built] [code generated]
external "~/package.json" 42 bytes [optional] [built] [code generated]
webpack 5.65.0 compiled successfully in 5374 ms
Webpack compilation complete. Watching for file changes.
(node:33198) [DEP0148] DeprecationWarning: Use of deprecated folder mapping "./" in the "exports" field module resolution of the package at /Users/david/Documents/NativeScriptProjects/newapp/node_modules/tslib/package.json.
Update this package.json to use a subpath pattern like "./*".
(Use `node --trace-deprecation ...` to show where the warning was created)
File change detected. Starting incremental webpack compilation...
resolving "./app.scss" to "./app.android.scss"
Updating runtime package.json with configuration values...
Project successfully prepared (android)
assets by status 6.64 MiB [cached] 6 assets
Entrypoint bundle 6.28 MiB = runtime.js 12.4 KiB vendor.js 5.59 MiB bundle.js 694 KiB
cached modules 2.36 MiB (javascript) 2.72 KiB (runtime) [cached] 350 modules
javascript modules 859 bytes
  ./app/__@nativescript_webpack_virtual_entry_javascript__ 224 bytes [built]
  ./app/ sync .(xml|js|s?css)$ 635 bytes [built]
webpack 5.65.0 compiled successfully in 139 ms
Webpack compilation complete. Watching for file changes.
Building project...
Gradle build...
         + setting applicationId
         + applying user-defined configuration from /Users/david/Documents/NativeScriptProjects/newapp/App_Resources/Android/app.gradle
         + adding nativescript runtime package dependency: nativescript-optimized-with-inspector
         + adding aar plugin dependency: /Users/david/Documents/NativeScriptProjects/newapp/node_modules/@nativescript/core/platforms/android/widgets-release.aar
Warning: Mapping new ns http://schemas.android.com/repository/android/common/02 to old ns http://schemas.android.com/repository/android/common/01
Warning: Mapping new ns http://schemas.android.com/repository/android/generic/02 to old ns http://schemas.android.com/repository/android/generic/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/02 to old ns http://schemas.android.com/sdk/android/repo/addon2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/02 to old ns http://schemas.android.com/sdk/android/repo/repository2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/02 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01
Warning: Mapping new ns http://schemas.android.com/repository/android/common/02 to old ns http://schemas.android.com/repository/android/common/01
Warning: Mapping new ns http://schemas.android.com/repository/android/generic/02 to old ns http://schemas.android.com/repository/android/generic/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/02 to old ns http://schemas.android.com/sdk/android/repo/addon2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/02 to old ns http://schemas.android.com/sdk/android/repo/repository2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/02 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Project successfully built.
The build result is located at: /Users/david/Documents/NativeScriptProjects/newapp/platforms/android/app/build/outputs/apk/debug/app-debug.apk
Installing on device 988820343543344b30...
Successfully installed on device with identifier '988820343543344b30'.
Restarting application on device 988820343543344b30...
# NativeScript Debugger started #
device: 988820343543344b30 debug port: 40000

To start debugging, open the following URL in Chrome:
devtools://devtools/bundled/inspector.html?ws=localhost:40000

Successfully synced application org.nativescript.newapp on device 988820343543344b30.

(App starts, chrome never "catches" )

With Android emulator: 

[~/Documents/NativeScriptProjects/newapp]$ tns debug android --device emulator-5554  --debug-brk
Searching for devices...
Your application will be deployed only on the device specified by the provided index or identifier.
Preparing project...
webpack is watching the files...
resolving "./app.scss" to "./app.android.scss"
assets by path *.js 6.28 MiB
  asset vendor.js 5.59 MiB [compared for emit] (name: vendor) (id hint: defaultVendor)
  asset bundle.js 694 KiB [compared for emit] (name: bundle)
  asset runtime.js 12.4 KiB [compared for emit] (name: runtime)
assets by path fonts/*.ttf 374 KiB
  asset fonts/fa-solid-900.ttf 204 KiB [compared for emit] [from: app/fonts/fa-solid-900.ttf] [copied]
  asset fonts/fa-brands-400.ttf 131 KiB [compared for emit] [from: app/fonts/fa-brands-400.ttf] [copied]
  asset fonts/fa-regular-400.ttf 39.1 KiB [compared for emit] [from: app/fonts/fa-regular-400.ttf] [copied]
Entrypoint bundle 6.28 MiB = runtime.js 12.4 KiB vendor.js 5.59 MiB bundle.js 694 KiB
runtime modules 2.72 KiB 8 modules
orphan modules 356 bytes [orphan] 6 modules
modules by path ./node_modules/ 2.12 MiB 293 modules
modules by path ./app/ 250 KiB
  optional modules 124 KiB [optional] 10 modules
  ./app/__@nativescript_webpack_virtual_entry_javascript__ 224 bytes [built] [code generated]
  ./app/app.js 3.15 KiB [built] [code generated]
  ./app/ sync .(xml|js|s?css)$ 635 bytes [built] [code generated]
  ./app/app.android.scss 120 KiB [built] [code generated]
  ./app/browse/browse-view-model.js 192 bytes [built] [code generated]
  ./app/home/home-items-view-model.js 1.55 KiB [built] [code generated]
  ./app/search/search-view-model.js 192 bytes [built] [code generated]
external "~/package.json" 42 bytes [optional] [built] [code generated]
webpack 5.65.0 compiled successfully in 5594 ms
Webpack compilation complete. Watching for file changes.
File change detected. Starting incremental webpack compilation...
resolving "./app.scss" to "./app.android.scss"
assets by status 6.64 MiB [cached] 6 assets
Entrypoint bundle 6.28 MiB = runtime.js 12.4 KiB vendor.js 5.59 MiB bundle.js 694 KiB
cached modules 2.36 MiB (javascript) 2.72 KiB (runtime) [cached] 350 modules
javascript modules 859 bytes
  ./app/__@nativescript_webpack_virtual_entry_javascript__ 224 bytes [built]
  ./app/ sync .(xml|js|s?css)$ 635 bytes [built]
webpack 5.65.0 compiled successfully in 144 ms
Webpack compilation complete. Watching for file changes.
Updating runtime package.json with configuration values...
Project successfully prepared (android)
(node:33653) [DEP0148] DeprecationWarning: Use of deprecated folder mapping "./" in the "exports" field module resolution of the package at /Users/david/Documents/NativeScriptProjects/newapp/node_modules/tslib/package.json.
Update this package.json to use a subpath pattern like "./*".
(Use `node --trace-deprecation ...` to show where the warning was created)
Restarting application on device emulator-5554...
# NativeScript Debugger started #
device: emulator-5554 debug port: 40000

To start debugging, open the following URL in Chrome:
devtools://devtools/bundled/inspector.html?ws=localhost:40000

Successfully synced application org.nativescript.newapp on device emulator-5554.

(Chrome opens but does not "catch" and app starts)

Environment

OS: macOS 12.0.1
CPU: (8) x64 Intel(R) Core(TM) i7-4770HQ CPU @ 2.20GHz
Shell: /bin/bash
node: 16.13.0
npm: 8.1.0
nativescript: 8.1.5

# android
java: 1.8.0_192
ndk: Not Found
apis: 28
build_tools: 28.0.3
system_images: 
  - android-28 | Google APIs Intel x86 Atom

# ios
xcode: 13.2.1/13C100
cocoapods: 1.8.4
python: 2.7.18
python3: 3.9.5
ruby: 2.6.8
platforms: 
  - DriverKit 21.2
  - iOS 15.2
  - macOS 12.1
  - tvOS 15.2
  - watchOS 8.3

Dependencies

"dependencies": {
  "@nativescript/core": "~8.1.1",
  "@nativescript/theme": "~3.0.1"
},
"devDependencies": {
  "@nativescript/android": "8.1.1",
  "@nativescript/ios": "8.1.0",
  "@nativescript/webpack": "~5.0.0"
}

Please accept these terms

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.