Question: My sister who lives in Cuba, wants me to bring her an iPhone on my next trip. I am looking at ones that are unlocked, open box as they are less expensive, but I need to know if it has to say "GSM unlocked." 

Thanks for any help. I just don't want to take one that won't work on Cuba's cellular network.

Answer: 
@klanomath has the correct command in the comments above.

```
diskutil partitionDisk $(hdiutil attach -nomount ram://SIZE) 1 GPTFormat APFS 'RAMDisk' '100%'

```

My results:

```
$ diskutil partitionDisk $(hdiutil attach -nomount ram://12128430) 1 GPTFormat APFS 'RAMDisk' '100%'
Started partitioning on disk15
Unmounting disk
Creating the partition map
Waiting for partitions to activate
Formatting disk15s2 as APFS with name RAMDisk
Mounting disk
Finished partitioning on disk15
/dev/disk15 (disk image):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        +6.2 GB     disk15
   1:                        EFI EFI                     209.7 MB   disk15s1
   2:                 Apple_APFS Container disk16        6.0 GB     disk15s2

```

[![enter image description here](https://i.stack.imgur.com/vXOfG.png)](https://i.stack.imgur.com/vXOfG.png)
@klanomath's answer will work, but it's needlessly complicated. There's no need for a RAM disk to have partitions, or a partitioning table, or an EFI boot partition. (Go ahead, try *booting* from a RAM disk! I'll wait.)

All that's needed here is a partitionless disk image, formatted in APFS and consisting of a single APFS container, enclosing a single APFS volume. That's easy with the "diskutil apfs create" verb. Furthermore, we should add a tweak to prevent macOS from wasting cycles trying to Spotlight-index that volume. Putting those two things together yields the following single command line (note that I'm using "SIZE" as a placeholder):

```
 diskutil apfs create $(hdiutil attach -nomount ram://SIZE) RAMDisk && touch /Volumes/RAMDisk/.metadata_never_index

```

That's it. "SIZE" will be the integer number of 512-byte blocks you want the RAM disk to comprise. For example, a RAM disk of 1GiB (1,073,741,824 bytes) would be specified with the number "2097152" (without the quote marks).