Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > find universal binaries with spotlight?

find universal binaries with spotlight?
Thread Tools
Senior User
Join Date: Oct 2004
Location: Portugal
Status: Offline
Reply With Quote
Apr 21, 2006, 04:17 AM
 
I would like to use spotlight (through the terminal - mdfind) to find universal binaries.

Anyone knows how to do this?

mdfind doesn't seem to be able to differentiate the architecture in the app...

it only finds by kind=app and shows the apps regardless of being UB or native

anyone knows?
     
Clinically Insane
Join Date: Oct 2001
Location: San Diego, CA, USA
Status: Offline
Reply With Quote
Apr 21, 2006, 09:52 AM
 
It doesn't get listed by mdls, so I assume the information isn't in the Spotlight store, unfortunately.
Chuck
___
"Instead of either 'multi-talented' or 'multitalented' use 'bisexual'."
     
Madrag  (op)
Senior User
Join Date: Oct 2004
Location: Portugal
Status: Offline
Reply With Quote
Apr 21, 2006, 10:52 AM
 
I used mdls to find its metadata, and those were my thoughts...
I know a way of doing it with find:

2>/dev/null find /myPath -type f -perm +111 -exec lipo -info '{}' ';' | grep -w i386

but it lists also inside ome packages, and I would like to list only the "main" app.
also find is very slow...

any thoughts of an alternative way?
     
Professional Poster
Join Date: Mar 2002
Location: Brantford, ON. Canada
Status: Offline
Reply With Quote
Apr 21, 2006, 11:57 AM
 
Well if you have all your apps in one folder, you can just sort by kind and the finder will throw all PPC apps to the bottom.
     
Professional Poster
Join Date: Oct 1999
Location: :ИOITAↃO⅃
Status: Offline
Reply With Quote
Apr 21, 2006, 12:18 PM
 
System Profiler will list all of your GUI apps according to kind.
On the command line, do
system_profiler SPApplicationsDataType
to get a list that indicates Universal/PowerPC/Intel.
     
Clinically Insane
Join Date: Oct 2001
Location: San Diego, CA, USA
Status: Offline
Reply With Quote
Apr 21, 2006, 01:05 PM
 
I was going to suggest you use _LSCopyAllApplicationURLs and check each one, but the system_profiler idea is probably better.
Chuck
___
"Instead of either 'multi-talented' or 'multitalented' use 'bisexual'."
     
Madrag  (op)
Senior User
Join Date: Oct 2004
Location: Portugal
Status: Offline
Reply With Quote
Apr 22, 2006, 06:32 AM
 
those are only good for the apps installed in the Applications folder in the startup HD...
I would like to list in a specific folder or other HD, sorry for not specifying that.

_LSCopyAllApplicationURLs, what is this?
     
Clinically Insane
Join Date: Oct 2001
Location: San Diego, CA, USA
Status: Offline
Reply With Quote
Apr 22, 2006, 01:32 PM
 
It's a Launch Services function for finding all applications.
Chuck
___
"Instead of either 'multi-talented' or 'multitalented' use 'bisexual'."
     
Professional Poster
Join Date: Oct 1999
Location: :ИOITAↃO⅃
Status: Offline
Reply With Quote
Apr 22, 2006, 06:19 PM
 
What is this for exactly? Perhaps if we knew your ultimate purpose we could be more useful.
     
Madrag  (op)
Senior User
Join Date: Oct 2004
Location: Portugal
Status: Offline
Reply With Quote
Apr 23, 2006, 09:12 AM
 
Originally Posted by Mithras
What is this for exactly? Perhaps if we knew your ultimate purpose we could be more useful.
You're right!
At the beginning it wasn't important to specify the objective, but now I think it might help:

It is an application to show the installed apps (with the option to chose which folder/HD), the main goal is to show the UB installed, that's why I can't rely on the system profiler, becasue it just lists the ones in the Applications folder, and some people (me included), have apps elsewhere.

As for the _LSCopyAllApplicationURLs, after searching, I found some usefull (still not enough though) info. Thanks for pointing that Chuckit!, if you could shed some more light about that solution I would appreciate (it isn't very well documented...).
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 09:37 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2