Update and test assets on iPhone without rebuilding the application - ios

We are developing an iPhone game and I would like to know if is possible to copy new or updated assets (images, animations, sounds or whatever) on the device and test them without rebuilding the application in XCode.
We would like to simplify the production pipeline process and we are trying to avoid our artists to rebuild the application every time they modify the assets.
Any advice is much appreciated.
Fede

Yes, I did it in one of my projects.
My strategy was easy, at the start, I stored the new assets in the app documents folder using a wifi tool specially created for that. Then, when the game needed a resource it checked if it was at the documents folder, if there was, it loaded, if not, it loaded the one from the bundle.

No, because any files that are updated in the XCode side will need to be rebundled and rebuilt. I'm surprised that this is an issue because the build process is remarkably faster between cleans. You're probably not rebuilding the entire application from scratch (ie after a Clean) each time, are you? XCode should detect any resource changes and update them on the device.

Related

How to reverse engineer an Xcode project from an app?

Xcode deleted my project and everything is gone. The only thing that I have is the app in my iPhone 6. So is there any way that I can retrieve the Xcode project of the app?
.. Update ..
i found all the files now i just need to reassemble them in a new project . but I don't know how .
Let's be clear: Xcode did not delete your project, you did, perhaps inadvertently. This does happen to most of us.
The answer is to recover from your remote Git repository or recover from Time Machine or another backup. If you do not have any backup this is your first warning that you need a backup strategy. Make this your last such warning by immediately, as in right now, creating a backup scheme, preferably two. Little is more important.
There are free remote Git repositories such as BitBucket. Setting up Time Machine is simple, just get an external disk, connect it and you will be prompted. Or use another backup scheme such as BackBlaze.
Without a backup you can recover the assets but not code from the ipa from your phone. If you are using the Asset Catalog that is not easy but can still be done.
Unfortunately,
There is no current way to un-archive an app. You must have the .xcodeproj file in order to make changes. The .ipa is useless in terms of editing or changing your app. And if there was a way to do so, it could and would be abused and many clones/copy's/fakes of popular apps will be published. The only accessible files are things in the Main Bundle which only include, .pngs, .jpg, .txt etc but no source code.

Is application bundle fully replaced on upgrade from App Store?

The following use case:
create a strings file (not localized) and deploy the application to your test device
localize the file (en.lproj or similar), make some changes to the new file and remove the original file
deploy the application on the device
What I noticed that very often (always?) the application will still use the old non-localized file. The reason is that apparently the file is still in somewhere the application bundle, even though it has been removed from the project. iOS's logic is that if a file of a specific type is looked up, it first checks in the root of the bundle for the non-localized version, and only if it doesn't find it does it go deeper into the localized folders. (Is it just me, or is this logic kind of backwards? I'm used to first looking for language specific file, and then falling back to some defaults, but it might be my Java background.)
Sometimes (always?) removing the app from the device completely doesn't help either. What does in this case is a CMD+SHIFT+K, which cleans the build folder, and after the app is built and deployed again, the correct file is used.
A worse problem would be if such a thing leads to an app crash, like some strange issues with Nibs or whatever - I have seen those as well...
The question is: what would happen if the first version of my app in the apple store had the non-localized file, and the second version localized it? When the user upgrades the app, would they get the same behavior as me during development (i.e. outdated, non-localized file used)?
I can't imagine because I think this would be a cause of a lot of grieving and bug requests, but I can't tell for sure as I haven't yet published any iOS app.
If the behavior is correct when upgrading from the store, why is it? What is so different? Are the files stored locally on my computer somewhere and used when I deploy?
Can anybody share their experiences?

optimize build time of iOS projects with large database

I am developing an app which itself is small (~20m) and builds fast on the simulator, but comes with a large database (~800m) and takes a long time to build on a device. It seems the majority of time is spent on copying(verifying) files in the database which never change. Is there a way to reduce/skip this step and accelerate the build?
Maybe while testing you could put the database in the Documents folder and copy it through iTunes or drop the files in the right folder on the simulator.
I think that way Xcode won't need to copy the file to the device, but of course it makes for a slightly more complex setup on the first run.

How to deploy a SenchaTouch App with Cordova?

A friend send me the code of a SenchaTouch App (v2.0) he made. I should make some changes as the performance is not so good. To start, I want to "deploy" the App on my iPad and see where its slow. He told me that he didn't use SenchaCmd and the Cordova version seems a little bit older, too. In the picture below you can see the project structure. How can I deploy the App to my iPad (there are no XCode project files in these folders)? In the future I will do a complete refactoring of the App but for the moment he wants me to do some little performance tweeks with his code... Any suggestions?
Andres commnt was the correct hint. I could just create a new cordova/phonagap project with the command line and then put the contents of the folder in the www directory.

Why does Xcode copy unchanged resources when building to a device?

I'm working with a rather large, asset-heavy project for iOS and I can't help but notice Xcode copying hundreds of resources (textures, spritesheets, sound files, etc..) that haven't changed at all since the last time I built to the device. It makes coding really, really slow when each build takes 2-4 minutes to pop up on the device.
Is there a way to get Xcode to recognize that it's doing redundant things or write a script that allows it to be more intelligent about how it transfers resources over to the device?
PS I realize that there may not be any built in 'appending' functionality for an app. I hope that isn't the case.
You can try add another target to the project and name it "without resources". Exclude all heavy resources from this target. First time you need start app with all resources target, next time use "without resources" target. If you added something to the project you should use first target.
iOS only supports deploying full application packages that are signed to the device. The process for deploying a debug build to the device is this.
Compile altered source code and sign binary
Alpha pre-multiply PNG images
Create a folder with application resources and binary inside
Sign the contents of the folder and create a ZIP file with the folder and signature
Copy the ZIP file (.ipa) to the device
Unfortunately, I'd imagine the time is being spent in #3 and #4 which gets created each build. I haven't seen any way to speed this up. If you have many, many PNG images, you could try telling Xcode to skip Step 2.
NeverBe's approach sounds like a great idea if your application can allow you to not include many of the resources for most of the time you're developing. You could alternatively have a second set of much smaller/dummy resources that you could switch in and out.
Sometimes, XCode really put unchanged resources to package.
Usually, when you change files by Finder, not XCode.
Make Project -> Clean to make complete rebuild

Resources