NativeScript / NativeScript/nativescript-cli

NS devices bug | erratic device connection

未关闭
#5,717 2 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

feature known issue
主要语言
JavaScript
星标
1.1k
派生
204
平均合并
1 天 9 小时
30 天内合并 PR
8

描述

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

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

ns devices 命令开始,并按照跟踪信息中显示的 ios-device-discoveryIOSDeviceOperations 路径进行排查。在 macOS 上复现无线 iPhone 场景,将行为与相关 issue #4252 进行比较,并验证设备发现是否一致,以及应用是否可以在远程设备上运行。

由索引模型根据 Issue 内容生成。

评估

技术栈
ios, javascript, macos, node.js
领域
cli, mobile
Issue 类型
缺陷
难度
4/5
预计耗时
3-5 天
活跃度
停滞
描述清晰度
需要澄清
新手友好度
30/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。