Get back udid from command line

Hello, I would like to know (java-client) how to get back the device udid from command line in java-client.

I tried : System.out.println(capabilities.getCapability(“udid”)); but I keep getting null.

Command :

appium -p 4727 -U(or --udid) 0a9af1180bfffdcbc -bp 4728