Mac app unable to read app bundle resources - swift

I have a sandboxed Mac application that will no longer launch fully on Sierra. It seems as though it's unable to read the app bundle directories.
There is a folder located at ~/library/Containers/com.company.app/Data/Gallery/. On fresh installs the app is unable to read from this directory with Sierra, where on OS versions previous to Sierra it could. Current installs updating the app also have access to the directory.
This is related to an entitlement that we're missing but after trying the following it's still not working. When we disable sandboxing the app launches and works as expected.
We've tried these by adding them manually to the entitlements.plist;
com.apple.security.temporary-exception.files.home-relative-path.read-write
com.apple.security.temporary-exception.files.absolute-path.read-write
com.apple.security.temporary-exception.shared-preference.read-write
Any help would be greatly appreciated. This issue is currently blocking any future app updates. Unfortunately a recent update somehow snuck through review processes with this bug so we're in hot water...
Thanks a lot!

Related

xcode continues project loading forever

I have a source code of a swift application which developed for iOS using swift 3.
I want to run it inside Xcode however it remains in loading state forever.
I have tried solutions provided in question Xcode freezes on startup while loading project however the situation did not change.
The developer of this source code told me that he used Xcode 9.x to develop application so he suggested me to try a 9.x version of Xcode. I guess Xcode should be backward compatible however I want to know does using Xcode 9.x changes the situation or I should look for reason somewhere else?
Using answer in apple.stackexchange.com did the trick:
Removing the ~/Library/Saved Application
State/com.apple.dt.Xcode.savedState/directory might help.
I tried all the solutions outlined here and none of them worked. However, I managed to fix this issue and here is what worked for me: If you're on an Apple OS and have iCloud sync enabled on your desktop/documents/any folder where you're loading Xcode from, the iCloud sync could be causing this issue.
I installed a fresh copy of my RN project in a directory not synced by iCloud and subsequently the issue was resolved; my build-time was down to a couple of seconds!
rm -rf ~/Library/Developer/xcode
in terminal worked for me, based on this answer
As of July, 2022, nothing else worked for me but, taking my project outside of the iCloud Drive and putting it into a directory without it. As it is mentioned above, iCloud sync interferes with the XCode running and stalls it.
I wasted almost 2 hrs and tried everything on stack over flow
SIMPLE SOLUTION
Just turn OFF icloud from your mac os so that it it will not sync the project.
To turn off icloud
Go to setting
Icloud
turn off sync
Thats all enjoy
I tried to delete:
~/Library/Developer/Caches/com.apple.dt.Xcode
~/Library/Developer/Xcode/DerivedData
~/Library/Developer/Saved Application State/com.apple.dt.Xcode.savedState
~/workspace/MyProject.xcodeproj/project.xcworkspace/xcuserdata
and once it helped. But another time it didn't help, so I also tried to reinstall Xcode, which also didn't help.
It turned out that the problem was that I was installing the app via WiFi or Bluetooth. When I connected my device via cable, the Xcode popped up to life and the "loading forever" stopped.
My xcode got hang when I force quit it. After that it was showing only "loading".
Here is fix to start xcode from beginning.
cd /
cd Applications
cd Xcode.app
cd Contents/MacOS
sudo ./Xcode
it will open xcode default window to open a new project.

Why does Trigger.IO app need to be uninstalled when upgrading on iOS?

I'm testing a Trigger.IO app built with Forge v1.4 on an iPod running iOS 6. I've been installing the .ipa through a distribution provision profile.
Occasionally, after installing an updated version, the app would launch but not run correctly. I traced this behaviour to the window.forge being absent, presumably due to a bad initialization. I would then make sure to kill the app process before installing updates and my recollection is that this seemed to make the problem go away.
Now, I've added the Facebook and Splash modules and my app now consistently won't go past the splash screen after I install an upgraded version unless I forcibly uninstall the old version first. Presumably, it dies before creating the webview. Any idea why I would need to uninstall my app first before upgrading? Is this a known behaviour?
I want to make sure that my users don't experience this when upgrading.
My app runs happily without Forge, and doesn't have any particular dependencies on localStorage data. I don't have a Mac and have been installing via iTunes in Windows, so I don't think I can access logging information.
You should have a look at this post:
How application get update from apple store?
The quick answer is when you update an app, you install the new bundle but you keep the user data stored previously such as a local DB. If you changed the local DB in the new app (or anything else) your app can crash when updated but is fine when downloaded from scratch.

simulating app upgrade in iOS

I am trying to simulate an upgrade from version 2.0 to 2.1. I have version 2.0 hosted in testflight, so I did install it in my device. Then I tried running the app from xcode. However what happened is that the app did not get overlapped, instead it created two apps with the same name. How can I make it such that when I run the app from xcode it overlays the old version?
I've made sure that the bundle identifier is the same.
Well the info you can get while updating can be found # this link here.
when user updates an app, Documents folder is stored as is, including
NSUserDefaults (but, sometimes user download app via iTunes and
replace the whole application, crying 'OMG! update killed all my
levels progress!'); Application bundle is erased and replaced by new
one (anyway, it is readonly for user); Re-deployment of new build
version will be enough;
You can't access the appstore inside the simulator because: # link here
It's a simulator not an emulator. Even if there was an App Store in
the Simulator, none of the apps in the store would work since they are
compiled for ARM CPUs while the Simulator runs x86 code.
Another stack overflow # link here states:
Build and install your old version, generate some data, and then
install the new version on top of it.
For testing before submitting to the Appstore I generally download
from the AppStore again the old version, and then install with Xcode
the newer version - for your next update... ;-)
And another stack overflow (that I lost the link for) states:
No, the simulator runs i386 binaries and iPhone appstore apps are ARM
binaries apps.
iOS apps are compiled to machine code, Android apps are run in a
Virtual Machine using byte code and are translated to machine code at
the time they are run.
So no, I don't believe you can run it in the simulator, how ever you can have older projects saved on the iPhone and test both out. And the apple documentation is # this link here.
Read this: https://developer.apple.com/library/ios/technotes/tn2285/_index.html
You cannot simulate update in XCode (neither in simulator or connected device). You have to create IPA file and simulate update process via iTunes.

Error in installing app through iphone configuration utility

i am creating a build for a app and installing it in device from iphone configuration utility and it is working very well.
but , in my friends device it is not working , he has same provisioning profile what i have,
in his iphone configuration utility when he goes for install it is showing error
Could not install application on device. Error: a signed resources has been added , modified or deleted.
any solution for this ?
may i install provision profile again ? or any other problem ? it is working fine in my mac
On windows 7 I was getting the same error and the only way to solve it was deleting the application information stored at c:\users\\AppData\Local\Temp , there you will find a folder named as the ios application giving problems, delete it and also delete the app from iphone configuration utility and you are done
This worked for me:
Change the name to a shorter one on desktop
Delete the older file if present on iPhone Configuration Utility
Re-install
Receive message "A signed resource has been added, modified, or deleted" when trying to debug an App on iPhone
thanks to Istalla Raju...
but still , it may be a problem of iphone configuration utility.
i am not sure about this.
Change the name of the source file and try installing again. It worked for me.

iPhone app doesn't stay installed (icon disappears)

I'm trying to install Zxing on my iphone from source (I know I can get it at the app store, but I want to modify some things in it).
The problem I'm having is that the app won't stay installed on the phone. It will run without a problem, but no icon will appear after I quit the app. I thought it had to do with my manually editing the codesign information in the project.pbxproj but after the developers changed the codesign identity they had left in the checked in version, the problem still persists.
I tried deploying an app I had developed from scratch and that worked fine.
I'm new to this, so any help would be much appreciated. You can download the zxing code from here:
svn checkout http://zxing.googlecode.com/svn/trunk/ zxing-read-only
Have you downloaded a copy from the App Store? I had one app (built from Xcode) that wasn't staying around after a sync and I found it was because iTunes was looking at my application syncing preferences and it wasn't selected to sync (as I had the Xcode build version on there, I didn't want to sync that version). However, it presumably removes the built app because I said I didn't want to sync any version of it.
Checking the checkbox to sync the app in iTunes kept the Xcode built version on there without installing the App Store version.
Hope this helps.
I think the problem had to do with my iPhone firmware. It might be a bug from Apple as I got an email from truphone saying that users were experiencing similar problems. I re-installed firmware, and could install it fine, and sync other apps. As soon as I did a restore from a previous backup, it broke again... what a pain. Case closed.