HarmonyOS 鸿蒙Next无法取得UDID

发布于 1周前 作者 vueper 来自 鸿蒙OS

HarmonyOS 鸿蒙Next无法取得UDID

大家好!华为nova9手机已通过USB连接到电脑,toolchains路径已添加到Path环境变量中,但在命令提示符中无法获得真机的UDID?谢谢!

cke_2772.png

11 回复
感觉像是hdc没有识别到设备,首先确认下是否是HarmonyOS设备吗,然后检查下设备的开发者选项是否打开,是否允许调试!

非常感谢!手机采用Nova9,版本:2.0.1.239;Studio版本:3.0.0.991;SDK API版本:3.1.1.1;手机是HarmonyOS设备;手机开发者选项已确认打开;也有可能是因为使用虚拟机的原因,USB还无法连接到真机;在虚拟机中,已可以查看到连接的手机NAM-AL00;准备找另外一台电脑和另外一台华为手机再试一下!

版主您好!我的是NOVA9 手机(HarmonyOS 2.0.1)已打开USB调试模式,连接电脑后,选择了传输文件,设备管理器已经显示:ADB Interface,但是hdc shell bm get -udid还是显示:error: no devices/emulators found; DevEco Studio是3.0.0.991版本,hdc命令储存路径:C:\Users\Administrator\AppData\Local\HarmonyOS\Sdk\toolchains\3.1.1.1此路径已经添加到Path环境变量中,麻烦指点一下问题在哪里?Thanks!另外,也安装了adb工具也一样,连接不到真机;

都独立的电脑系统Win10 专业版;不再是虚拟机!

HarmonyOS的分布式文件系统让我在多设备间共享文件变得更加方便。

没连接到设备,看看有没有打开USB调试
hdc不行就用adb,adb也行,命令自己搜搜看。用adb前把hdc的进程关掉,不然adb shell 后没设备。

您好!adb提示非内部或外部命令,也不是可运行的程序;

所以就是你没安装ABD喽。看看网上教程安装一下就可以了。

您好,已安装ADB工具:如何关闭hdc的进程?(任务管理器没有看到hdc的进程运行)adb shell后还是没有设备,麻烦指点一下,谢谢! C:\Users\Administrator>adb Android Debug Bridge version 1.0.26 -d - directs command to the only connected USB device returns an error if more than one USB device is present. -e - directs command to the only running emulator. returns an error if more than one emulator is running. -s - directs command to the USB device or emulator with the given serial number. Overrides ANDROID_SERIAL environment variable. -p - simple product name like ‘sooner’, or a relative/absolute path to a product out directory like ‘out/target/product/sooner’. If -p is not specified, the ANDROID_PRODUCT_OUT environment variable is used, which must be an absolute path. devices - list all connected devices connect [:] - connect to a device via TCP/IP Port 5555 is used by default if no port number is specified. disconnect [[:]] - disconnect from a TCP/IP device. Port 5555 is used by default if no port number is specified. Using this ocmmand with no additional arguments will disconnect from all connected TCP/IP devices. device commands: adb push - copy file/dir to device adb pull [] - copy file/dir from device adb sync [ ] - copy host->device only if changed (-l means list but don’t copy) (see ‘adb help all’) adb shell - run remote shell interactively adb shell - run remote shell command adb emu - run emulator console command adb logcat [ ] - View device log adb forward - forward socket connections forward specs are one of: tcp: localabstract: localreserved: localfilesystem: dev: jdwp: (remote only) adb jdwp - list PIDs of processes hosting a JDWP transport adb install [-l] [-r] [-s] - push this package file to the device and install it (’-l’ means forward-lock the app) (’-r’ means reinstall the app, keeping its data) (’-s’ means install on SD card instead of internal storage) adb uninstall [-k] - remove this app package from the device (’-k’ means keep the data and cache directories) adb bugreport - return all information from the device that should be included in a bug report. adb help - show this help message adb version - show version num DATAOPTS: (no option) - don’t touch the data partition -w - wipe the data partition -d - flash the data partition scripting: adb wait-for-device - block until device is online adb start-server - ensure that there is a server running adb kill-server - kill the server if it is running adb get-state - prints: offline | bootloader | device adb get-serialno - prints: adb status-window - continuously print device status for a specified device adb remount - remounts the /system partition on the device read-write adb reboot [bootloader|recovery] - reboots the device, optionally into the bootloader or recovery program adb reboot-bootloader - reboots the device into the bootloader adb root - restarts the adbd daemon with root permissions adb usb - restarts the adbd daemon listening on USB adb tcpip - restarts the adbd daemon listening on TCP on the specified port networking: adb ppp [parameters] - Run PPP over USB. Note: you should not automatically start a PPP connection. refers to the tty for PPP stream. Eg. dev:/dev/omap_csmi_tty1 [parameters] - Eg. defaultroute debug dump local notty usepeerdns adb sync notes: adb sync [ ] can be interpreted in several ways: - If is not specified, both /system and /data partitions will be updated. - If it is “system” or “data”, only the corresponding partition is updated. environmental variables: ADB_TRACE - Print debug information. A comma separated list of the following values 1 or all, adb, sockets, packets, rwx, usb, sync, sysdeps, transport, jdwp ANDROID_SERIAL - The serial number to connect to. -s takes priority over this if given. ANDROID_LOG_TAGS - When used with the logcat option, only these debug tags are printed. C:\Users\Administrator>adb shell error: device not found C:\Users\Administrator>hdc kill C:\Users\Administrator>adb shell * daemon not running. starting it now on port 5037 * * daemon started successfully * error: device not found C:\Users\Administrator>

HarmonyOS 鸿蒙Next无法取得UDID可能由多种原因造成,包括权限配置不当、SDK版本问题或设备不支持等。请确保在应用的清单文件中正确配置了获取UDID的权限,并尝试更新SDK到最新版本。同时,检查设备是否支持获取UDID。由于隐私和安全性的考虑,鸿蒙系统可能限制了对UDID的直接访问。如果问题依旧没法解决,请考虑使用其他设备标识符或联系华为开发者支持获取更专业的帮助。如果问题依旧没法解决请加我微信,我的微信是itying888。

回到顶部