1

I am trying to get disk information from a sandboxed macOS app bundle. system_profiler SPSerialATADataType SPNVMeDataType will run in both sandboxed and non-sandboxed. However their outputs are slightly different. I am wondering how from within the sandbox I am able to get the information similar to the non-sandboxed output. Specifically I am looking at SMART status and size. Is there and entitlement I can add that specifies storage devices? What specifically is being changed being inside a sandbox that is changing the output of this command?

NON-SANBOXED

APPLE SSD SM256C:

          Capacity: 251 GB (251,000,193,024 bytes)
          Model: APPLE SSD SM256C                        
          Revision: [REVISON NUM]
          Serial Number: [SERIAL NUMBER]      
          Native Command Queuing: Yes
          Queue Depth: 32
          Removable Media: No
          Detachable Drive: No
          BSD Name: disk0
          Medium Type: Solid State
          TRIM Support: Yes
          Partition Map Type: GPT (GUID Partition Table)
          S.M.A.R.T. status: Verified
          Volumes:
            EFI:
              Capacity: 209.7 MB (209,715,200 bytes)
              File System: MS-DOS FAT32
              BSD Name: disk0s1
              Content: EFI
              Volume UUID: 0E239BC6-F960-3107-89CF-1C97F78BB46B
            disk0s2:
              Capacity: 250.79 GB (250,790,436,864 bytes)
              BSD Name: disk0s2
              Content: Apple_APFS

SANDBOXED

APPLE SSD SM256C:

          Model: APPLE SSD SM256C                        
          Revision: [REVISON NUM]
          Serial Number: [SERIAL NUMBER]      
          Native Command Queuing: Yes
          Queue Depth: 32
          Detachable Drive: No
          Medium Type: Solid State
          TRIM Support: Yes

mahal tertin
  • 3,239
  • 24
  • 41
  • You'd be probably better off using DiskArbitration Framework https://developer.apple.com/library/archive/documentation/DriversKernelHardware/Conceptual/DiskArbitrationProgGuide/ManipulatingDisks/ManipulatingDisks.html#//apple_ref/doc/uid/TP40009310-CH3-SW7 – mahal tertin Apr 02 '20 at 09:00
  • That framework seems to lack support for S.M.A.R.T status' and appears to be severely limited when inside a sandboxed app. There is a ```App Sandbox Note``` describing the limits on one of the related pages. – AnotherUser Apr 02 '20 at 13:26

0 Answers0