Get storage device size within macOS sandboxed app bundle?

108 views Asked by At

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

0

There are 0 answers