Page 1 of 1

How can you get the name of the phone?

Posted: 10 Oct 2014 01:05
by srazzell
Hey Martin, is there a way to get the name of the phone automagic is running on? There has to be a command you can execute, similar to the way you got the IP address of the phone.

Re: How can you get the name of the phone?

Posted: 10 Oct 2014 14:20
by Martin
Hi,

What do you mean by name of the phone, the device model?

A lot of information about the device can be found in text file /system/build.prop. You could use an action Init Variable Text File to read the entire file and use regular expressions or substring functions in a script to extract the relevant part. Reading this file is also a good starting point to see what kind of values are available. On a Nexus 5 this file looks about like this:
# begin build properties
# autogenerated by buildinfo.sh
ro.build.id=KTU84P
ro.build.display.id=KTU84P
ro.build.version.incremental=1227136
ro.build.version.sdk=19
ro.build.version.codename=REL
ro.build.version.release=4.4.4
ro.build.date=Fri Jun 13 07:05:49 UTC 2014
ro.build.date.utc=1402643149
ro.build.type=user
ro.build.user=android-build
ro.build.host=kpfj3.cbf.corp.google.com
ro.build.tags=release-keys
ro.product.model=Nexus 5
ro.product.brand=google
ro.product.name=hammerhead
ro.product.device=hammerhead
ro.product.board=hammerhead
ro.product.cpu.abi=armeabi-v7a
ro.product.cpu.abi2=armeabi
ro.product.manufacturer=LGE
...
It's much easier to read one single value with command getprop, for example using action Execute Command: getprop ro.product.model. The value (Nexus 5 in my case) can be accessed in variable stdout (if you use the default variable name).

Regards,
Martin

Re: How can you get the name of the phone?

Posted: 10 Oct 2014 15:40
by srazzell
Perfect. Just what I was looking for. Thanks.

Re: How can you get the name of the phone?

Posted: 10 Oct 2014 16:42
by srazzell
Any idea on how to get the Bluetooth MAC Address of the phone itself?

Re: How can you get the name of the phone?

Posted: 12 Oct 2014 10:06
by Martin
Action Init Variable System Setting with Category Secure and Name bluetooth_address should work.