so I am working on a jb app that requires writing to the file system (/var/mobile/Library/Downloads specifically), and I tried hard coding it in like someone recommended but I cant seem to make it work, i know how to do so to the Documents directory in my app but not the file system, any ideas? thank you!
edit 1 - as reference: the way that the Safari DL Plugin does it
try this path
/private/var/mobile/Library/Downloads
You need to check if the directory already exists or not before writing to it. You can use NSFileManager class for file/directory operations. You also need to check for the permissions on that folder, your app if not running as root cannot write to folders which only root has access to.
Related
I have compiled the labstreaminglayer library for an iOS app, which works fine. But I would like to do some configuration as described here. But I can't get the library to find the lsl_api.cfg file.
Just putting it in any of the folders in XCode doesn't work, even though I can see that is there by searching for it and printing the path. I can set the LSLAPICFG environment variable but again anything I can think to put in there for a relative path doesn't point to the right place and I can't find any other env variable in this list which gives the absolute path...
With the benefit of a nights sleep I realised I can just edit liblsl and add some logging to figure out what is going on. So liblsl tries to look for the config file in the ~ folder, giving the path:
/private/var/mobile/Containers/Data/Application/GUID1/
While the lsl_api.cfg file is copied to:
/private/var/containers/Bundle/Application/GUID2/APPNAME.app/lsl_api.cfg
And libsl can't seem to access files in the GUID2 folder at all, something to do with sandboxing perhaps?
But both liblsl and the App can both access the /Documents folder (perhaps because I enabled iTunes File Sharing?) so I can just chuck the cfg file in there and update libsl to find it. With the added benefit that I can just edit it on my mac.
So I'm still not sure what I would do if I didn't want to put the cfg file in the /Documents folder but at least this works!
I am new for centos installation. I downloaded a minimul version of centos 6.5, around 339.7mb of size. I am trying to install this with GUI interface but I got an error after selecting the drive option, which comes after selecting the country.
This is complete message,
Unable to read package metadata. This may be due to missing repodata directory. Please ensure that your install tree has been correctly generated.
Failare:
repodata/743fec56b2af0ce8d6ec82c47a4efafc2a4d18cddfa9683f29611cb18d1a33de-primary.sqlite.bz2 from anaconda-CentOS-201311271240.i386: [Ermo 256] No more mirrors to try.
Sorry but I am new here, so I can't put the exact image here.
I believe that i had this same issue and was able to solve it.
The files under the /repodata folder are missing their file extensions and are not matching their full names in the "TRANS.TBL" file, under this same dir.
Rename all the files to match what is in the "TRANS.TBL" file, then try the install over again.
Please let everyone know if this works for you.
In the past i would just put a URL in that pointed to the correct files on a server, i feel that most people take this workaround and that's why it's not as hot of an item as it should be. I hope this gets fixed in the .ISO.
Thank you,
YourFriend
It worked for me.
I renamed all 8 files.
i.e. 0e371b19e547b9d7a7e8acc4b8c0c7c074509d33653cfaef9e8f4fd1d62d95de
0e371b19e547b9d7a7e8acc4b8c0c7c074509d33653cfaef9e8f4fd1d62d95de-primary.sqlite.bz2
The correct file name is given in file "repomd" under folder repodata
example - location href="repodata/b124f0ec5323cfee56b420906a3103f0daef656dde3f7ac8220120aa7504e57a-primary.xml.gz"
I had exactly the same issue ;
under "repodata" directory opened "repmod" xml file
Searched file name within repmond xml file
Found matching strings
Renamed 8 files as specified in .xml file
and it worked like a charm
Thanks to "Your Friend"
I had the same problem. Even if you manage to get past this step, you will encounter at a later point other errors related to filenames.
The root cause was using Unetbootin to create the bootable media. I switched to Rufus and everything works fine now.
If a device is jailbroken, the file system is unlocked and open for you to see and modify. If I wanted to write an app that wrote a file to the /private/var/mobile/Library/Preferences/ folder, do I have to use a command other than [fileManager copyItemAtURL:fileTempPathURL toURL:filePathURL error:NULL];
? I'm using this command, but it is not working... Thanks for your help!
If you're on a jailbroken device, you can write to any place in the system. You can do this in many different ways, from the C FILE pointer to all kinds of iOS Foundation methods, like the one you mentioned in your question.
The only thing you'll have to mind is that your application has to be installed in the /Applications directory and not in the ~/Applications directory, what iTunes and Xcode will do by default. Only by putting them in that folder, along with the Apple base applications like MobileSafari, MobileMusicPlayer, etc. your app will launch from the springboard with those root privileges. You can put it in the /Applications folder through SSH.
If you do not manually put your app in the root application folder and your app resides in its own subfolder in ~/Applications like normal App Store applications do, your app will launch in a sandbox. This sandbox will then prevent you from accessing any file outside your application's sandbox.
I'm reading through some of the documentation about File Management on iOS. When you create an application for the simulator, does the application get created somewhere on my hard drive? If so, where is it?
Also, does this have access to the Documents directory? Like if I create some test .txt file, and want to see it in the App->Documents folder, is that possible? Thanks.
Yes. Look here:
~/Library/Application Support/iPhone Simulator/4.3.2/Applications
Change the 4.3.2 to be the version of the Simulator you are using.
Within that folder you will find your apps, except the they are named cryptically. Open one of those folders and you will find your app, named as you recognize it, and the Documents, Library and tmp folders. Documents is where you find the docs that your app creates and uses. You can, in fact, makes changes to the files in the Documents folder or just access their content to see what your app sees or writes.
Under XCode 6, the document directory for your app is quite hidden:
~/Library/Developer/CoreSimulator/Devices//data/Containers/Data/Application//
You can find the directory for your app with this command:
$ sudo find ~/Library/Developer/CoreSimulator/Devices -name <APP_NAME>.app | grep -o '.*/'
I always use one folder on my filesystem for an Xcode project. It contains all project files. When I zip it and send it to a friend, she can't just ipen the xcodeproj file. It opens, but all paths are broken and build fails because all the classes don't find the #include'd files. But when I download i.e. some example projects from apple, these work perfectly. What am I doing wrong?
UPDATE:
I'm doing it like this:
1) I create a project and specify an directory on my desktop
2) In that directory I create an "images" directory and add images to it
3) I pull this images directory out and drag it into the Resources Groups&Files. Xcode asks if I want to copy it to destination folder, I click no. Because it's already there. All other things are set to default.
4) all other things are just created within xcode, and xcode just puts all classes in the Classes directory of my project.
5) when I want to add images, I first put them in the directory of the project, and from there drag them into the Images group in xcode. That's to make sure xcode doesn't mess them up with everything else. Otherwise it would just copy them to the root of my project directory rather than inside the Images directory, which doesn't make sense. In fact, the whole Groups&Files filesystem doesn't make sense at all, it's one big mess. Apple's biggest mistake in Xcode so far. That's why I have to do such stupid things.
We don't really know exactly what you're doing so it's hard to see what you're doing wrong.
Perhaps inspect the xcode project files directly, see if you have hardcoded paths. That's a sure fire problem. Make sure you copy resources into the project instead of referencing them externally, etc.
I expect that you have "search path" build setting set to an absolute path on your machine, rather than a path relative to the project. Best way to tell is to post a portion of the build transcript from the failed build and look at the -I directives. If those paths don't exist on your friend's machine, then they should be changed from absolute paths to paths that start with ${SRCROOT}.
Are you just trying to build on the second machine or are you trying to deploy to a device on the second machine? If you are trying to deploy to a device (iPhone or iPod Touch) then it probably has something to do with Code Signing and Certificates.