In my app people can download some audio-lessons from my server. After a file is saved i move it to app's document directory. Now i want my app to have the first file downloaded with the app, so user have one lesson out of the box. I've added that file to main app directory (from xcode), and at the app startup i copy it to app's document directory. That all works fine, and now the problem: when i try to delete the copy of my audio file from main app directory i get the following error "The operation couldn’t be completed. Operation not permitted".
How that can be solved?
The task you are trying to achieve is not possible with iOS or any hacks that I know of. Even if it were, your app would be rejected by Apple since they do not allow an app to change contents of the main bundle in an app directory.
Related
I have added one plist file called temp.plist into my app's bundle. I have added some data into that plist file.but i don't want that file to be bundled into my app for production builds(because that file can increase the size of an app). i just want that file into my app's bundle for integration builds only.
Is there any way to achieve this?
Should i add any scripts in the build phase? depending upon the configuration(Integration or Production) that file should be added and removed from the app's bundle.
I don't have any context on this so can anybody help me with this.
I have created an Xcode project which reads data from a JSON file. My app is working fine in the view preview and when simulated. My question is, does the JSON file automatically get stored with my app when I publish to the App Store? Or do I have to host the JSON file elsewhere (cloudKit, Firebase, etc)?
In other words, is my JSON file a part of the app, in the same way that the app Icon and app assets are part of the app?
In the image below, I have stored my JSON files in a folder called "resources". Will this "resources" be part of the app when it is uploaded to the App Store?
FYI ... I am very, VERY new to Swift and Xcode! Sorry for the stupid question.
Where my JSON file is located in Xcode
As long as the file is bound to the app target then it will be part of the application bundle. You do this by opening the file in Xcode and then in the property inspector ticking the app target in the Target Membership section.
Be aware when you do this you will need to access the file as part of the bundle and not via its file system location.
if let filepath = Bundle.main.path(forResource: "myFile", ofType: "ext") {
// load file
In my flutter iOS app, every time the app is launched, it would call PathProvider.getApplicationDocumentsDirectory() to get the app documents directory to access to the previously saved data. If I install the app on an iOS device(not update here), the app could work exactly as expected. But if I updated the app from Apple Store or from Xcode, the app cannot longer be launched successfully. When I try to debug, I found the app caught exceptions at working with the drectory returned by PathProvider.getApplicationDocumentsDirectory(). Anybody could give some suggestions for fixing this? Thanks in advance.
For more information, when launched, my app has to execute createSync(recursive=true) if it does not find some app documents directories where I would store user-generated data. The app documents directories are returned by PathProvider.getApplicationDocumentsDirectory. However, after I updated the app, and when launched the app, PathProvider.getApplicationDocumentsDirectory() could still return a directory which has appropriate pattern, but the returned directory may not be the right directory since my app failed to find previously created folders there, so the app had to create the relevant directory for storing user-generated data again, and then I always got the error as below
FileSystemException: Creation failed (OS Error: Operation not permitted, errno = 1)
when I tried to create the directory with createSync(recursive=true), and no matter the version of path_provider was 1.20 or 1.10, the phenomenon persisted. Please help.
I assume the error you got is both happened in iOS simulator & iOS device ?
Get the path
Would you mind try to run on iOS simulator, and print out the path of the folder you try to access.
Open the folder in Finder
And with the printed folder path, you can open the folder with Finder by Cmd + G.
The error
Your mentioned error usually is because accessing the folder not belong to the app.
Let's see more after you print out the folder path.
I am working with a developer on an iOS app and upon completion, all source code, files, etc. should be turned over to me so that I can continue development in the future with another developer if necessary. I need help understanding exactly which files I should receive.
Should I be ok with .ipa file? Or maybe .app file? Or the Xcode project file? What will ensure that I have all I need to continue development in the future?
You will receive the project folder, which contains a .xcodeproj file and other files such as images assets. You can download a demo project from here.
You won't receive an .ipa file because the .ipa files are the ones you download from the App Store (they have been archived), hence no one can see their code so people can't steal it.
I am building an app called 'ToyBox.
When I build for iOS, I get a ToyBox.app directory which contains a ToyBox executable and the other typical iOS-related files (Info.plist, pkg.info, etc.), in addition to my app icons, assets and source code directories.
However the directory also contains another ToyBox.app sub-directory, which itself contains a ToyBox executable and iOS-related files and my assets directory.
It looks like Corona is recursively compiling my app. This happens whether I build for device or the Xcode iOS simulator. There is no problem running the resulting executable on my device (iPad4) or simulating it in Xcode but when I tried to submit my app to the App Store it was rejected with the following error:
"Invalid Bundle Structure - The binary file
'ToyBox.app/ToyBox.app/ToyBox' is not permitted. Your app may contain
only one executable file."
The error is valid - there are two executables!
(At the risk of confusing the issue, I have another, seemingly related, issue: if I build my app (either for device or Xcode simulator) then later build the app with a different name, in the same directory, the second build will include the first build and the build process will take a very long time to complete. If I was to build the app again with a third name, both previous app builds wold be included and the build would take a very (very) long time).
I can probably work around the issue by deleting the extra files, but this seems like a hack and I'd like to know what's going on.
I am using Corona Version 2013.1087 (2013.4.17).
Make sure you are not saving your Built app to the folder with your source code. You cannot put the output from building an app into the same folder with your source or you will get this error.