Forum Archive

Device serial Name

filippocld223

Is there a way to get the device serial number from Pythonista?

ccc

This approach used to work until Apple tightened up file system security around iOS 7.

Unfortunately it does not work any more.

import commands, os, subprocess

the_command = '/usr/sbin/system_profiler SPHardwareDataType'

print(commands.getstatusoutput(the_command))
print(os.system(the_command))
print(subprocess.call(the_command.split()))

You might look at uuid and see if that is good enough for your purposes: https://docs.python.org/2/library/uuid.html

filippocld223

Thanks.