简体   繁体   中英

How to get iPhone name from osx terminal?

I am writing a simple script to download photos from an iPhone and then copy them to my server. I'd like to find the name of the iPhone that I currently have plugged in. So when I save my pictures I can save them in a folder named "currentDate/Dave's iPhone", "currentDate/Other iPhone", etc.

Wondering if there is a way to get the connected device's name from terminal. Ie. when I look at my device in Xcode or Image Capture it says my device name is Dave's iPhone.

Use libimobiledevice-macosx and its ideviceinfo utility:

$ ideviceinfo | grep -i DeviceName

If you get linker errors while running the executable, you may need to set the DYLD_LIBRARY_PATH environment variable to the path where you downloaded the library.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM