gpt4 book ai didi

android - "react-native log-android"错误 "adb' logcat -c "failed. adb' logcat -c 运行正常。 [Ubuntu]

转载 作者:行者123 更新时间:2023-12-04 18:44:27 29 4
gpt4 key购买 nike

我正在尝试运行 react-native log-android 来测试在我的 react-native 手机应用程序上上传谷歌照片。我得到错误

warn The following packages use deprecated "rnpm" config that will stop working from next release:
- react-native-fetch-blob: https://github.com/wkh237/react-native-fetch-blob#readme
- react-native-google-signin: https://github.com/react-native-community/react-native-google-signin
Please notify their maintainers about it. You can find more details at https://github.com/react-native-community/cli/blob/master/docs/configuration.md#migration-guide.



info Starting logkitty
/bin/sh: 1: /home/diamonddoesnt/Library/Android/sdk/platform-tools/adb: not found
error Command failed: '/home/diamonddoesnt/Library/Android/sdk/platform-tools/adb' logcat -c
/bin/sh: 1: /home/diamonddoesnt/Library/Android/sdk/platform-tools/adb: not found
. Run CLI with --verbose flag for more details.
Error: Command failed: '/home/diamonddoesnt/Library/Android/sdk/platform-tools/adb' logcat -c
/bin/sh: 1: /home/diamonddoesnt/Library/Android/sdk/platform-tools/adb: not found





at spawnLogcatProcess (/home/diamonddoesnt/Desktop/prog/it project/react/project/COMP30022-DiamondDoesnt/family3/node_modules/logkitty/build/android/adb.js:36:11)
at runAndroidLoggingProcess (/home/diamonddoesnt/Desktop/prog/it project/react/project/COMP30022-DiamondDoesnt/family3/node_modules/logkitty/build/android/adb.js:21:10)
at logkitty (/home/diamonddoesnt/Desktop/prog/it project/react/project/COMP30022-DiamondDoesnt/family3/node_modules/logkitty/build/api.js:137:85)
at Object.logAndroid [as func] (/home/diamonddoesnt/Desktop/prog/it project/react/project/COMP30022-DiamondDoesnt/family3/node_modules/@react-native-community/cli-platform-android/build/commands/logAndroid/index.js:37:44)
at Command.handleAction (/home/diamonddoesnt/Desktop/prog/it project/react/project/COMP30022-DiamondDoesnt/family3/node_modules/react-native/node_modules/@react-native-community/cli/build/cliEntry.js:160:21)
at Command.listener (/home/diamonddoesnt/Desktop/prog/it project/react/project/COMP30022-DiamondDoesnt/family3/node_modules/commander/index.js:315:8)
at Command.emit (events.js:189:13)
at Command.parseArgs (/home/diamonddoesnt/Desktop/prog/it project/react/project/COMP30022-DiamondDoesnt/family3/node_modules/commander/index.js:651:12)
at Command.parse (/home/diamonddoesnt/Desktop/prog/it project/react/project/COMP30022-DiamondDoesnt/family3/node_modules/commander/index.js:474:21)
at setupAndRun (/home/diamonddoesnt/Desktop/prog/it project/react/project/COMP30022-DiamondDoesnt/family3/node_modules/react-native/node_modules/@react-native-community/cli/build/cliEntry.js:210:24)


但是当我在控制台中输入 adb logcat -c 或 adb 'logcat -c 时它工作正常。
diamonddoesnt@diamonddoesnt-ThinkPad-X260:~/Desktop/prog/it project/react/project/COMP30022-DiamondDoesnt/family3$ adb logcat -c
diamonddoesnt@diamonddoesnt-ThinkPad-X260:~/Desktop/prog/it project/react/project/COMP30022-DiamondDoesnt/family3$ adb' logcat -c


我想我已经将它包含在路径中,我的 .bashrc 看起来像
## added
export PATH="$PATH:~/.local/lib"
export PATH="$PATH:~/.local/lib/python3.6/site-packages/yTermPlayer"
export PATH="/home/diamonddoesnt/Desktop/prog/it project/flutter/flutter/bin:$PATH"
export PATH="$PATH:~/Downloads/android-studio/bin"
export ANDROID_HOME=$HOME/Library/Android/sdk
export PATH=$PATH:$ANDROID_HOME/emulator
export PATH=$PATH:$ANDROID_HOME/tools
export PATH=$PATH:$ANDROID_HOME/tools/bin
export PATH=$PATH:$ANDROID_HOME/platform-tools
export PATH=$PATH:$ANDROID_HOME/platform-tools/adb
export PATH=${PATH}:/Library/Android/sdk/tools:/path/to/android-sdk/platform-tools



所以我不确定为什么它给我这个错误。

最佳答案

脚本正在尝试运行 /home/diamonddoesnt/Library/Android/sdk/platform-tools/adb , 完全合格。您的 adb 在您的 PATH 中,但它不存在。当您尝试使用完全限定的路径运行程序时,如果在其中找不到它,它不会检查您的 PATH。当您将其作为 adb 运行时,它确实会检查您的 PATH,解释其中的差异。要修复它,请执行 which adb找出二进制文件的真正位置,并重新配置脚本以使用该文件。

关于android - "react-native log-android"错误 "adb' logcat -c "failed. adb' logcat -c 运行正常。 [Ubuntu],我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57949103/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com