chockenberry / Provisioning

A Quick Look plug-in for .mobileprovision files
1.55k stars 67 forks source link

The device information collected by Xcode can't be displayed in the list of devices #2

Closed chockenberry closed 11 years ago

chockenberry commented 11 years ago

Xcode stores device information in user defaults:

$ defaults read com.apple.dt.XCode DVTSavediPhoneDevices

This information can't be read by the plug-in since it's now running in a sandbox. The NSUserDefaults class documentation states:

A sandboxed app cannot access or modify the preferences for any other app. (For example, if you add another app's domain using the addSuiteNamed: method, you do not gain access to that app's preferences.)

This information also can't be read using NSTask and NSPipe: the console logs "Sandbox: defaults(####) deny file-read-data" errors when the preference file is accessed.

nptacek commented 11 years ago

Would it be possible to supply the code that reads the information from defaults as an AppleScript and access it via NSUserScriptTask (https://developer.apple.com/library/mac/documentation/Foundation/Reference/NSUserScriptTask_Class/Reference/Reference.html#//apple_ref/occ/cl/NSUserScriptTask)? Session 206 (Secure Automation Techniques in OS X) from WWDC 2012 has some good information on this method.

chockenberry commented 11 years ago

I gave up on running the plug-in in a sandbox (by signing the code.) For now, this issue can be closed since the plug-in can now read Xcode's defaults. I bet it gets re-opened in the future, though.