"xcrun simctl get_app_container" with group identifier not working

487 Views Asked by At

it says I can use group identifier to get exactly the group I want:

➜  ~ xcrun simctl get_app_container booted
Print the path of the installed app's container
Usage: simctl get_app_container <device> <app bundle identifier> [<container>]

container   Optionally specify the container. Defaults to app.
  app                 The .app bundle
  data                The application's data container
  groups              The App Group containers
  <group identifier>  A specific App Group container
  ^^^^^^^^^^^^^^^^^^

I believe this's the "group identifier":

➜  ~ xcrun simctl get_app_container booted com.apple.DocumentsApp groups
group.com.apple.DocumentManager /Users/zcfan/Library/Developer/CoreSimulator/Devices/E94453B7-DF52-4A88-AE9E-C1A752DFB613/data/Containers/Shared/AppGroup/4818FE0A-BC9B-4F13-A39C-71C162E76616
group.com.apple.FileProvider.LocalStorage   /Users/zcfan/Library/Developer/CoreSimulator/Devices/E94453B7-DF52-4A88-AE9E-C1A752DFB613/data/Containers/Shared/AppGroup/6EE8B2AE-4CE2-4D07-9198-88E80455FF03
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

But if I call with it, simctl just print the help message again:

➜  ~ xcrun simctl get_app_container booted com.apple.DocumentsApp group.com.apple.FileProvider.LocalStorage
Print the path of the installed app's container
Usage: simctl get_app_container <device> <app bundle identifier> [<container>]

container   Optionally specify the container. Defaults to app.
  app                 The .app bundle
  data                The application's data container
  groups              The App Group containers
  <group identifier>  A specific App Group container

I tried other combinations too, same result:

  • xcrun simctl get_app_container booted com.apple.DocumentsApp group group.com.apple.FileProvider.LocalStorage
  • xcrun simctl get_app_container booted com.apple.DocumentsApp group.com.apple.FileProvider.LocalStorage
  • xcrun simctl get_app_container booted com.apple.DocumentsApp groups LocalStorage
  • xcrun simctl get_app_container booted com.apple.DocumentsApp group LocalStorage
  • xcrun simctl get_app_container booted com.apple.DocumentsApp LocalStorage
  • xcrun simctl get_app_container booted com.apple.DocumentsApp groups com.apple.FileProvider.LocalStorage
  • xcrun simctl get_app_container booted com.apple.DocumentsApp group com.apple.FileProvider.LocalStorage
  • xcrun simctl get_app_container booted com.apple.DocumentsApp com.apple.FileProvider.LocalStorage

I couldn't find any group identifier demo anywhere, is this option really working? Am I using the wrong identifier? A working demo would be great, thank you.


For now I have to manipulate the result of groups to get what I want:

xcrun simctl get_app_container booted com.apple.DocumentsApp groups | grep LocalStorage | awk -F'\t' '{print $2}'

It gives me the path of "On My Phone" filesystem of simulator:

enter image description here

Open it with Finder, I can do whatever I want to simulator FS.

open "`xcrun simctl get_app_container booted com.apple.DocumentsApp groups | grep LocalStorage | awk -F'\t' '{print $2}'`/File Provider Storage" -a Finder

enter image description here

0

There are 0 best solutions below