Change home screen wallpaper on jailbreak iphone - iphone

I am trying to write an app for jailbreak iphone.
Basically I want to change the home screen wallpaper programatically.
I have got that it can be changed by writing to some /var/Library but exactly how to write to this file in the coding and how to set the permissions
I have learnt that such app need to be run as root. What needs to be done to run the iphone app as root??

Since iOS 4.2.1, the wallpapers are "cpbitmap" files in /var/mobile/Library/SpringBoard/. I'm not aware of any Objective-C code to write to these files, but there should be something out there that you can use. Prior to 4.2.1, the wallpapers are JPEGs in the same folder.
Once you've copied over these images, a respring should make it appear.

Related

ios7 and later causes image icon errors

I sucessfully submitted my app written in swift. That app was targetted for ios8 and later. Now I want to submit the same app for ios7 and later and I have a big problem. I do not know how to solve this. Error message is:
Your binary is not optimized for iPhone 5 - New iPhone apps and apps updates submitted must support the 4 -inch display on iPhone 5 and must include a launch image referenced in the Info.plist under UILaunchImages with UILaunchImageSize value set to {320,568}. Launch images must be PNG files and located at the top-lvel of your bundle, or provided within each .lproj folder if you localize your launch images. Learn more about iPhone 5 support and app launch images by reviewing the 'iOS Human Interface Guidelines' at 'https://developer.apple.com/library/ios/documentation/UserExperience/Conceptual/MobileHIG/IconsImages/IconsImages.html#//apple_ref/dpc/uid/TP40006556-CH14-SW5' and the 'iOS App Programe Guide' at 'https://developer.apple.com/library/ios/documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/App-RelatedResources/App-RelatedResources.html#//apple_ref/doc/uid/TP40007072-CH6-SW12'.
I'm pretty sure you need to add all the image formats prior to IOS 7, could be wrong...
https://developer.apple.com/ios/human-interface-guidelines/graphics/launch-screen/

ios registering document in document files

I am working on app that reads gpx (topografix) file attached to an email. I have successfully registered this document type to my app so whenever I select such a file I get the option to open it by this app on iPhone. It works fine on my iPhone but on iPad my app is not recognised for opening such a file so my app does not appear on the list of apps that are capable to open it. This app uses iPhone environment and is set for iPhone not for universal environment. By changing on universal environment does not change anything. Why is my app not recognised in the list?
Well the conversion of an iphone app to ipad app has to be done if you want to make it universal.
refer this

iPhone Simulator: App/Documents disappear

Is it standard that a XCode-Build empties the documents folder of the app on iphone simulator?
How can I prevent that?
when ever you re-build the application or make any other application with same app id ,the document folder for that is not erased .It will be removed only when the app is removed from the simulator.

Programmatically changing the iOS lock-screen

I'm building an app which would have to have the ability to show my own views on the iPhone lock screen. I've seen lots of apps which let you customize the lockscreen and so forth and these were App Store apps so i'm guessing it has to possible.
I just can't figure out what to use in the iOS SDK to even try implementing this.
Oh and P.S: same goes for wallpapers—can we change this from inside our app?
It can be changed programmatically (change to SpringBoard), but it won't make the way to the (official) AppStore. So if you want to build an app that can change something like the lock screen wallpaper or the ring tone which you usually need the Settings app for, you have to publish your application via Cydia, not Apple's store.
For a sample code block, see this answer.

Importing AddressBook data into the iPhone Simulator

Is there an easy way to import AddressBook data into the iPhone Simulator?
Right now my only assumption is to manually modify the SQLite files found in the /Library/Application Support/iPhone Simulator/User/Library/AddressBook.
I was looking for the exact solution, and this worked perfectly for me on a non-jailbroken phone. It works by extracting your iPhone address book from an unencrypted backup.
Quit the iOS Simulator
Download iPhone/iPod Touch Backup Extractor
Run it, and select the last option "iOS Files"
Create a folder on your desktop and extract all files to that folder
When complete, go to your extract folder and navigate to Library/AddressBook
Copy both files (AddressBook.sqlitedb and AddressBookImages.sqlitedb) to:
~/Library/Application Support/iPhone Simulator/{SDK}/Library/AddressBook
Run the Contacts application in iOS Simulator
DummyContacts is an application that allows you to add Contacts to AddressBook and can be a handy tool for all iOS devices as well as simulators. DummyContacts is a life saver and pretty easy to setup. One click adds 100 records and one click also removes all 100. It also supports iOS6. So check it out at : https://github.com/Janak-Nirmal/DummyContacts .
Here's a simple app I've made which you can install in the simulator
https://github.com/cristianbica/CBSimulatorSeed
Just sign in to your iCloud account on the simulator and turn "Contacts on" under iCloud. All your contacts, photos etc will appear on the simulator. Obviously, this assumes you are backing up your contacts to iCloud on your iPhone. Hope it helps!
As Marc pointed in his answer https://stackoverflow.com/a/27582281/4598931 for a similar question it can be done just exporting contacts to vCard and drag and drop the generated file to iphone simulator.
or if your iPhone isn't jailbroken, you can extract the sqlite db from a backup using the shell script here: http://0xced.blogspot.com/2009/01/using-your-own-address-book-in-iphone.html
(note you'll need to change the simulator path it copies it to, as in the current SDK it's a bit different due to the addition of the OS version folder - easiest thing would be to just change it to your home directory and copy manually from there)
Right this is the only way i know with a "legit" iPhone
But if you have a jailbroken iPhone, you can download the iPhone AddressBook database with ssh, and replace the simulator one by the iphone one.