當前位置: 首頁>>技術教程>>正文


通過 USB 安裝 Nexus 5x

, , ,

問題描述

我正在嘗試通過 mtp 在我的筆記本電腦上安裝一部新的 nexus 5x 手機。當我將其插入時,nautilus 將其識別為 nexus 5x,並且左側會出現一個選項。但是,當我單擊它時,通常出現文件的區域是空白的,即使那裏應該有文件,我也無法創建文件。有趣的是, lsusb 返回:

Bus 004 Device 002: ID 8087:8000 Intel Corp. 
Bus 004 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 003 Device 002: ID 8087:8008 Intel Corp. 
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 003: ID 5986:055c Acer, Inc 
Bus 001 Device 002: ID 0cf3:3004 Atheros Communications, Inc. 
Bus 001 Device 023: ID 18d1:4ee1 Google Inc. Nexus 4
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

奇怪的是,lsusb 認為它是 nexus 4,而 nautilus 正確地看到了 5x。也許它還不支持?我在我的係統日誌中發現了以下內容:

Oct 27 20:26:25  kernel: [584014.476624] usb 1-3: new high-speed USB device number 23 using xhci_hcd
Oct 27 20:26:25  kernel: [584014.606208] usb 1-3: New USB device found, idVendor=18d1, idProduct=4ee1
Oct 27 20:26:25  kernel: [584014.606217] usb 1-3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
Oct 27 20:26:25  kernel: [584014.606221] usb 1-3: Product: Nexus 5X
Oct 27 20:26:25  kernel: [584014.606225] usb 1-3: Manufacturer: LGE
Oct 27 20:26:25  kernel: [584014.606228] usb 1-3: SerialNumber: 0067460eb26d49e8
Oct 27 20:26:25  systemd-udevd[13357]: failed to execute '/lib/udev/socket:@/org/freedesktop/hal/udev_event' 'socket:@/org/freedesktop/hal/udev_event': No such file or directory
Oct 27 20:26:25  org.gtk.vfs.Daemon[3123]: PTP: reading event an error 0x02ff occurredUnable to open ~/.mtpz-data for reading, MTPZ disabled.
Oct 27 20:26:25  org.gtk.vfs.Daemon[3123]: Device 0 (VID=18d1 and PID=4ee1) is a Google Inc (for LG Electronics/Samsung) Nexus 4/5/7/10 (MTP).
Oct 27 20:26:25  org.gtk.vfs.Daemon[3123]: Error 1: Get Storage information failed.
Oct 27 20:22:10  gnome-session[3211]: (deja-dup-monitor:4213): GLib-CRITICAL **: Source ID 3199 was not found when attempting to remove it
Oct 27 20:26:26  gnome-session[3211]: (nautilus:13398): Gtk-CRITICAL **: gtk_icon_theme_get_for_screen: assertion 'GDK_IS_SCREEN (screen)' failed
Oct 27 20:26:26  gnome-session[3211]: (nautilus:13398): GLib-GObject-WARNING **: invalid (NULL) pointer instance
Oct 27 20:26:26  gnome-session[3211]: (nautilus:13398): GLib-GObject-CRITICAL **: g_signal_connect_object: assertion 'G_TYPE_CHECK_INSTANCE (instance)' failed
Oct 27 20:26:26  dbus[2053]: [system] Activating via systemd: service name='org.freedesktop.hostname1' unit='dbus-org.freedesktop.hostname1.service'
Oct 27 20:26:26  systemd[1]: Starting Hostname Service...
Oct 27 20:26:26  systemd-udevd[13404]: failed to execute '/lib/udev/socket:@/org/freedesktop/hal/udev_event' 'socket:@/org/freedesktop/hal/udev_event': No such file or directory
Oct 27 20:26:26  org.gtk.Private.GPhoto2VolumeMonitor[3123]: (process:3493): GVFS-GPhoto2-WARNING **: device (null) has no BUSNUM property, ignoring
Oct 27 20:26:26  dbus[2053]: [system] Successfully activated service 'org.freedesktop.hostname1'
Oct 27 20:26:26  systemd[1]: Started Hostname Service.

我在 Eurocom Electra 2 上使用 Ubuntu 15.04。

另外,比我更有名望的人可以創建 nexus-5x 標簽嗎?謝謝@KGIII

編輯:我試過用 mtpfs 掛載;錯誤類似於我在日誌中看到的錯誤,並且沒有發生掛載。

$ mtpfs nexus5x/
Unable to open ~/.mtpz-data for reading, MTPZ disabled.
Listing raw device(s)
Device 0 (VID=18d1 and PID=4ee1) is a Google Inc (for LG Electronics/Samsung) Nexus 4/5/7/10 (MTP).
   Found 1 device(s):
   Google Inc (for LG Electronics/Samsung): Nexus 4/5/7/10 (MTP) (18d1:4ee1) @ bus 1, dev 25
Attempting to connect device
ignoring libusb_claim_interface() = -6PTP_ERROR_IO: failed to open session, trying again after resetting USB interface
LIBMTP libusb: Attempt to reset device
Android device detected, assigning default bug flags
Error 1: Get Storage information failed.
Error 2: PTP Layer error 02fe: get_handles_recursively(): could not get object handles.
Error 2: Error 02fe: PTP: Protocol error, data expected
Listing File Information on Device with name: (NULL)
LIBMTP_Get_Storage() failed:-1

我還嘗試從源代碼下載最新的 libmtp,但它似乎仍然無法正常工作——我說出現是因為我不完全確定會發生什麽。我試過 mtp-files:

libmtp version: 1.1.10

Device 0 (VID=18d1 and PID=4ee1) is a Google Inc (for LG Electronics/Samsung) Nexus 4/5/7/10 (MTP).
mtp-files: Successfully connected
Android device detected, assigning default bug flags
Listing File Information on Device with name: (NULL)
Error 1: Get Storage information failed.
OK.

最佳思路

實際上,它正在工作!

當您將 N5X(屏幕解鎖)連接到您的 Linux 機器時,N5X 將默認使用 USB 充電(我認為這是一項安全功能)。 N5X 將出現在您的 Linux 文件管理器中,但不會顯示內部存儲。如果您拉下 N5X 上的通知欄,您應該會看到它顯示 USB 充電。如果您選擇,您應該提供其他選項,包括用於文件傳輸的 MTP、用於照片傳輸的 PTP 和 MIDI。

感謝達瓦魯克。

編輯\n我絕對同意這些評論。完全令人困惑。我也是。

參考資料

本文由Ubuntu問答整理, 博文地址: https://ubuntuqa.com/zh-tw/article/12985.html,未經允許,請勿轉載。