How can I find app name by UID? In "battery history" I have found that the app with UID 10058 is using a lot of battery.

How can I find the name of the app with UID equal to 10058?
Android assigns each application a UID (User ID) at install time; unlike PID (Process ID) which is transient and keeps changing all the time, UID stays constant as long as the application is not reinstalled. The UID should be unique to each application, except when the application explicitly requests to share a userid with another application (there are security restrictions around this, the two applications must be signed with the same private key, i.e. comes from the same developer).

These applications claims to show UID of applications:


https://market.android.com/details?id=redfishandroid.appexplorer
https://market.android.com/details?id=com.sayhello2theworld.te


EDIT:

Try looking at /data/system/packages.xml (you need root to view this file), each installed application should have an entry there. Say, I have Adobe Reader installed in my phone:

&lt;package name="com.adobe.reader" codePath="/mnt/asec/com.adobe.reader-1/pkg.apk" flags="262144" ts="1300539048000" version="37149" userId="10034" installer="com.google.android.feedback"&gt;
&lt;sigs count="1"&gt;
&lt;cert index="21" key="... very long random string ..." /&gt;
&lt;/sigs&gt;
&lt;perms /&gt;
&lt;/package&gt;


My phone have assigned userId="10034" to Adobe Reader.

For applications that have requested to share user id with another application, say Handcent:

&lt;package name="com.handcent.nextsms" codePath="/system/app/HandcentSMS.apk" flags="1" ts="1217592000000" version="373" sharedUserId="10064"&gt;
&lt;sigs count="1"&gt;
&lt;cert index="17" key="... very long random string ..." /&gt;
&lt;/sigs&gt;
&lt;/package&gt;


then the attribute you're looking for is sharedUserId="10064"