Document folder iOS Simulator
Solution 1
Set and hit a breakpoint in the app, and write the following in the Xcode Console (next to the Variables View):
po NSHomeDirectory()
Then in Finder hit Shift+CMD+G, paste the path returned above without the quotation marks and hit enter.
Solution 2
Open up Terminal.app and run:
xcrun simctl get_app_container booted [app identifier]
You can even setup an alias to change to the directory, like:
alias cdmyapp='cd $(xcrun simctl get_app_container booted com.mycompany.myapp)'
Solution 3
I have 2 solution
- Simpholders or free and open source alternative OpenSim
- A simple script that opens the finder window with the recently launched application on the iOS simulator
deviceId=$(xcrun simctl list devices | grep Booted | sed -n 's/^.([A-F0-9]{8}-([A-F0-9]{4}-){3}[A-F0-9]{12}).$/\1/p') applicationFolder=~/Library/Developer/CoreSimulator/Devices/$deviceId/data/Containers/Data/Application/ applicationFolder=$applicationFolder$(ls -Art $applicationFolder | tail -n 1) open $applicationFolder
Solution 4
If you're using ZSH, you could try this script. https://gist.github.com/nickcheng/cbc0717d2c9f79613cf2c042503b5422
Lorenzo
Software developer with big experience in Vb.net, C#, C, C++, Obj-C. Firware developer with big experience in microcontroller ST (STM32), Microchip (PIC12/16/18), Atmel (ATMega). TI (MSP430). Hardware developer for embedded system. Author of the first App in Apple Store with a BACnet stack - iBACNet Explorer & Display.
Updated on January 19, 2020Comments
-
Lorenzo over 4 years
How is possible to find quickly the document folder (in the mac) of an App when I'm using the simulator? When I need to explore the document folder during the simulation of the App now I use a variable of the App to find the document folder path and I read the path during the debug (using a variable) but I think is not the best solution.