Dave Thomas
Dave Thomas

Reputation: 3837

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.

Upvotes: 0

Views: 2519

Answers (2)

Krishan Madushanka
Krishan Madushanka

Reputation: 389

xcrun simctl list devices

use this command in terminal

Upvotes: 1

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.

Upvotes: 3

Related Questions