Reputation: 42165
During development of a feature in our app, for testing purposes I need to edit a file that is within the app bundle during runtime. It is a pain to enter the bundle path into the Finder "Go to" menu each time and open it.
Is there a way in my code to open a Finder window with a path, even if it is using a private API (this app is just for testing)?
NSString *bundlePath = [[NSBundle mainBundle] resourcePath];
// Open bundlePath in Finder
Upvotes: 0
Views: 527
Reputation: 830
I think that you can use a macOS application that is downe here, than you can archive and install as app on your mac, and than whenever you want you can navigate easily on simulator files.
Here is repo. https://github.com/dsmelov/simsim
Hope that will help you.
Upvotes: 2
Reputation: 1706
Alternate solution: Open terminal.
print:
NSLog(@"open %@", [[NSBundle mainBundle] resourcePath])
and copy/paste into the terminal. the open
command on OS X does the same thing as clicking on that path in finder. so just print the path to your resource.
I don't think you're likely to find a direct solution because any api that interacts nicely with os x for this type of thing will not compile for armv7,arm64 (because its x64 only of course) and even though those archetectures aren't needed for the simulator, they are listed in the architectures
section of the projects 'Build Settings' and messing with those arch/compile/linker settings is almost certainly more trouble than it would be worth.
Upvotes: 0