NativeScript / NativeScript/nativescript-cli

NS devices bug | erratic device connection

Đang mở
#5,717 2 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

feature known issue
Ngôn ngữ chính
JavaScript
Star
1.1k
Fork
204
Merge trung bình
1 ngày 9 giờ
Pull request đã merge (30 ngày)
8

Mô tả

Issue Description

After connecting iPhone wirelessly to Mac, ns devices results in
Cannot find connected devices. Reconnect any connected devices, verify that your system recognizes them, and run this command again.

It should consistently identify and run app on remote device.

May be related to #4252

Reproduction
  1. Connect Mac to personal hotspot iPhone
  2. In terminal, run ns devices.

Results are inconsistent. Works sometimes on first try. Sometimes works after terminal restart or reconnection. Sometimes just plain won't cooperate at all.

Relevant log output (if applicable)
edjones@Edwins-MacBook-Air blackliteracymatters % ns devices --log trace      

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*                                                                                                                                               *
*  The "TRACE" log level might print some sensitive data like secrets or access tokens in request URLs. Be careful when you share this output.  *
*                                                                                                                                               *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *


Trying to get macOS version.
Exec system_profiler SPSoftwareDataType -detailLevel mini 
 stdout: Software:

    System Software Overview:

      System Version: macOS 13.1 (22C65)
      Kernel Version: Darwin 22.2.0
      Time since boot: 3 days, 17 hours, 34 minutes

 
 stderr: 
macOS version based on system_profiler is 13.1.
Looking for project in '/Users/edjones/apps/BlackLiteracyMatters'
Project directory is '/Users/edjones/apps/BlackLiteracyMatters'.
Initializing project identifiers. Config:  {
  id: 'com.edwincjones.blackteenliteracymatters',
  appPath: 'app',
  appResourcesPath: 'App_Resources',
  android: { v8Flags: '--expose_gc', markingMode: 'none' }
}
Loading extensions.
Collecting system information...
System information:
{
  "platform": "darwin",
  "shell": "/bin/zsh",
  "os": "Darwin Edwins-MacBook-Air.local 22.2.0 Darwin Kernel Version 22.2.0: Fri Nov 11 02:04:44 PST 2022; root:xnu-8792.61.2~4/RELEASE_ARM64_T8103 arm64\n",
  "procArch": "arm64",
  "nodeVer": "18.14.1",
  "npmVer": "9.5.0",
  "nodeGypVer": null,
  "nativeScriptCliVersion": "8.4.0",
  "gitVer": "2.37.1 (Apple Git-137.1)",
  "dotNetVer": null,
  "javacVersion": "15.0.2",
  "javaVersion": "15.0.2",
  "javaPath": "/Library/Java/JavaVirtualMachines/adoptopenjdk-15.jdk/Contents/Home/bin/java",
  "adbVer": "1.0.41",
  "androidInstalled": true,
  "monoVer": null,
  "gradleVer": "7.2",
  "isAndroidSdkConfiguredCorrectly": true,
  "xcodeVer": "14.2.0",
  "xcodeprojLocation": "/OPT/HOMEBREW/opt/ruby@2.7/bin/xcodeproj",
  "itunesInstalled": false,
  "cocoaPodsVer": "1.11.3",
  "isCocoaPodsWorkingCorrectly": true,
  "isCocoaPodsUpdateRequired": false,
  "pythonInfo": {
    "isInstalled": true,
    "isSixPackageInstalled": true
  }
}
Current CLI version:  8.4.0
Project dir from hooksArgs is: undefined.
Hooks directories: [ '/Users/edjones/apps/BlackLiteracyMatters/hooks' ]
BeforeHookName for command resolveCommand is before-resolveCommand
Project dir from hooksArgs is: undefined.
Hooks directories: [ '/Users/edjones/apps/BlackLiteracyMatters/hooks' ]
AfterHookName for command resolveCommand is after-resolveCommand
Trying to handle SIGINT event. CLI overrides this behavior and does not allow handling SIGINT as this causes issues with Ctrl + C in terminal.
The stackTrace of the location trying to handle SIGINT is:
    at process.on (/USERS/EDJONES/.NVM/VERSIONS/NODE/V18.13.0/lib/node_modules/nativescript/lib/nativescript-cli.js:26:28)
    at /USERS/EDJONES/.NVM/VERSIONS/NODE/V18.13.0/lib/node_modules/nativescript/node_modules/signal-exit/index.js:158:17
    at Array.filter (<anonymous>)
    at load (/USERS/EDJONES/.NVM/VERSIONS/NODE/V18.13.0/lib/node_modules/nativescript/node_modules/signal-exit/index.js:156:23)
    at module.exports (/USERS/EDJONES/.NVM/VERSIONS/NODE/V18.13.0/lib/node_modules/nativescript/node_modules/signal-exit/index.js:62:7)
    at Object.<anonymous> (/USERS/EDJONES/.NVM/VERSIONS/NODE/V18.13.0/lib/node_modules/nativescript/node_modules/proper-lockfile/lib/lockfile.js:331:1)
    at Module._compile (node:internal/modules/cjs/loader:1254:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1308:10)
    at Module.load (node:internal/modules/cjs/loader:1117:32)
    at Module._load (node:internal/modules/cjs/loader:958:12)
spawn: /Users/edjones/.nvm/versions/node/v18.14.1/bin/node "/USERS/EDJONES/.NVM/VERSIONS/NODE/V18.13.0/lib/node_modules/nativescript/lib/detached-processes/cleanup-process.js" "/USERS/EDJONES/.NVM/VERSIONS/NODE/V18.13.0/lib/node_modules/nativescript/lib/bootstrap.js"
Initializing analytics statuses.
Analytics statuses:  { TrackFeatureUsage: 'enabled', TrackExceptions: 'enabled' }
Will send the following information to Google Analytics: {
  type: 'googleAnalyticsData',
  category: 'CLI',
  googleAnalyticsDataType: 'pageview',
  path: 'devices',
  title: 'devices',
  customDimensions: { cd5: 'CLI', cd2: 'Vue.js', cd9: 'false' }
}
spawn: /Users/edjones/.nvm/versions/node/v18.14.1/bin/node "/USERS/EDJONES/.NVM/VERSIONS/NODE/V18.13.0/lib/node_modules/nativescript/lib/services/analytics/analytics-broker-process.js" "/USERS/EDJONES/.NVM/VERSIONS/NODE/V18.13.0/lib/node_modules/nativescript/lib/bootstrap.js"
Will send the following information to Google Analytics: {
  type: 'googleAnalyticsData',
  category: 'CLI',
  googleAnalyticsDataType: 'event',
  action: 'Options',
  label: '{"log":"trace","$0":"_localpath","profileDir":"private","bundle":"webpack"}',
  customDimensions: { cd2: 'Vue.js', cd9: 'false', cd5: 'CLI' },
  value: undefined
}

Connected devices & emulators
Searching for devices...
Options for ios-device-discovery {
  platform: undefined,
  shouldReturnImmediateResult: false,
  emulator: false,
  fullDiscovery: true
}
Starting to look for iOS devices.
spawn: /Users/edjones/Library/Android/sdk/platform-tools/adb "start-server"
Result when throw error is false:
{ stdout: '', stderr: '', exitCode: 0 }
spawn: /Users/edjones/Library/Android/sdk/platform-tools/adb "devices"
Cannot find connected devices. Reconnect any connected devices, verify that your system recognizes them, and run this command again.
IOSDeviceOperations disposed.
edjones@Edwins-MacBook-Air blackliteracymatters % 
Environment

OS: macOS 13.1
CPU: (8) arm64 Apple M1
Shell: /bin/zsh
node: 18.13.0
npm: 9.2.0
nativescript: 8.4.0

android

java: 15.0.2
ndk: Not Found
apis: 29, 30, 31, 33
build_tools: 30.0.3, 31.0.0, 32.0.0
system_images:

  • android-30 | Google APIs ARM 64 v8a
  • android-S | Google APIs ARM 64 v8a

ios

xcode: 14.2/14C18
cocoapods: 1.11.3
python: 2.7.18
python3: 3.9.13
ruby: 2.7.6
platforms:

  • DriverKit 22.2
  • iOS 16.2
  • macOS 13.1
  • tvOS 16.1
  • watchOS 9.1

### Dependencies

```json
"dependencies": {
  "@fortawesome/fontawesome-svg-core": "^6.2.0",
  "@fortawesome/free-regular-svg-icons": "^6.2.0",
  "@fortawesome/free-solid-svg-icons": "^6.2.0",
  "@fortawesome/vue-fontawesome": "^2.0.9",
  "@nativescript/core": "^8.4.7",
  "@nativescript/firebase-auth": "^2.5.1",
  "@nativescript/firebase-core": "^2.5.1",
  "@nativescript/firebase-firestore": "^2.5.1",
  "@nativescript/iqkeyboardmanager": "^2.1.0",
  "@nativescript/social-share": "^2.2.0",
  "@nativescript/tailwind": "^2.0.1",
  "@nativescript/theme": "~3.0.2",
  "@nstudio/nativescript-cardview": "^2.0.1",
  "@triniwiz/nativescript-image-zoom": "^4.1.3",
  "@triniwiz/nativescript-youtubeplayer": "^4.1.4",
  "nativescript-ui-sidedrawer": "^14.2.1",
  "nativescript-vue": "^2.9.3",
  "nativescript-vuex-persistent": "^1.2.0",
  "rxjs": "^7.8.0",
  "tailwindcss": "^3.2.6",
  "vuex": "~3.6.2"
},
"devDependencies": {
  "@nativescript/android": "^8.3.1",
  "@nativescript/ios": "^8.3.3",
  "@nativescript/preview-cli": "1.0.2",
  "@nativescript/webpack": "~5.0.6",
  "nativescript-vue-template-compiler": "~2.9.0"
}
Please accept these terms

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Hướng nghiên cứu

Bắt đầu với lệnh ns devices và lần theo các đường dẫn ios-device-discoveryIOSDeviceOperations được hiển thị trong trace. Tái hiện kịch bản iPhone không dây trên macOS, so sánh hành vi với issue liên quan #4252 và xác minh rằng việc phát hiện thiết bị nhất quán, đồng thời ứng dụng có thể chạy trên thiết bị từ xa.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
ios, javascript, macos, node.js
Lĩnh vực
cli, mobile
Loại issue
Lỗi
Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Cần làm rõ
Mức phù hợp với người mới
30/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.