Unity Debug log not showing in iOS build - ios

guys I've been struggling with the following issue for couple of days and hope that somebody could help me.
I want to get my app logs from running iOS device. If I run the app from the Xcode, then I see my logs in debug view as expected.
However, when I download a build from my testflight app I'm not able to access the logs anymore. Google suggest that I use Xcode -> Devices -> Log of a device, but there are only system events log and no messages from my app.
Running Unity 5.5.2.p2, Xcode 8.2.1. with ios 10 and 9 tested.
Would appreciate any help, because this issue is really exhausting.

After a bit more searching I found out that it's not possible, unfortunately. But I've managed to make a solution, hope it helps somebody.
Apple's native NSLog prints all the logs to a console app even after the app was downloaded from TestFlight.
I made a simple iOS plugin wich catches all the debug logs and forwards them to a NSLog. Make sure you call
LogManager.Init()
somewhere on app start.
Hope this will help somebody. The plugin is here
https://drive.google.com/open?id=0B7Yn93mXrM82ODZlbDVTNmo0QlU

Archiving for TestFlight means Build Configuration is release.
SO you won't be able to see the dubug log on testflight build.
Follow this link to make a debuggable TestFlight build.
Or simply add DEBUG=1 on Release section under Preprocessor Macros

Related

Firebase crashlytics script in iOS(2021) not working via Testflight

I am trying to integrate firebase crashlytics into iOS app.
During integration I added run script to upload crashes automatically.
I connected my iPhone_XR to Xcode and ran in release mode. Then I force crashed.I repeated it several times. After few hours of waiting I was able to see the crashes. Confirming that this is working as expected I archived and released this build(DEV) to testflight via xcode.
I did the same force crashed after installing via testflight but this time its not working... Most of the people suggested to upload manually but I am afraid I can't do that as I don't have access to client application(PROD) and also maintaining the crashes report manually is a tidious process to me
Please help me what exactly is happening with Firebase crashlytics. I checked many blogs and github issues for understanding. Most of them are saying to upload manually dSYM files.
Note: GoogleServices file is inside some folder so I gave the path of that in script. I tried to add directly without any sub-folders also but issue still persists.
4-MAR crashes are from my phone which are crashed during testing.
I am supposed to receive some crashes on 5-MAR which are crashed via Testflight but it's saying missing dSYM files
Please help with this issue. I am not unable to find proper solution from past 2 months
Try this script:
${PODS_ROOT}/FirebaseCrashlytics/run
${PODS_ROOT}/FirebaseCrashlytics/upload-symbols -gsp $PROJECT/GoogleService-Info.plist -p ios "${DWARF_DSYM_FOLDER_PATH}/${DWARF_DSYM_FILE_NAME}"
Also, Firebase recently updated their SDK.

How to fix an error while uploading flutter app in in AppStore?

Last week I have been trying to publish my app Flutter app in App Store.
What do I have
app is compilable and works as expected on my iPhone and in emulator
apple dev account - OK
all done with certificates and apple dev page content (app screenshots and description added)
Archive was created in x-code without any errors
The last step to upload my app from x-code to apple dev page finished with an errors. Screenshot is attached
I have found some suggestions to remove
Pods_Runner.framework from project but i am not sure it will help
I do not understand what should I do to make it work. If anyone faced with this issue before please leave comment
So it was true! Pods_Runner.framework should be deleted from "Frameworks, Libraries^ and Embedded Content".
Have no idea how it get there, but on official flutter docs about how to upload iOS app there is a screenshot of this configuration screen and there is not
Pods_Runner.framework file on it.
I hope this will help someone who want to publish to Appstore!

Unity Firebase Analytics 6.15.2 crash

I have implemented Firebase Analytics 6.15.2 into my project, then I have builded the Xcode project and have run it on the device, everything went perfect, but when I try to open the app afterwards, without it running from Xcode - it crashes after 20 seconds of launch screen.
So I have no logs and anything, I somehow figured out it's an issue with Firebase and downgraded the pods in the Xcode project to Firebase 5.3.0, it worked.
I have other projects where the same issue is occurring.
So my question is, how do I fix it? Because there is no way it's happening to everyone, I might be doing something wrog here and I just don't see it.
I use Unity 2020.1.2f1
Firebase Core + Analytics 6.15.2 via Package Manager (also tried installing it manually, still the same)
Other plugins I am using are Facebook and ironSource
ps. The funny thing that it crashes on all devices, but it passes Apple review because they test it in some kind of debug mode, but when it's in release mode - it crashes.
Have you tried to reinstall Firebase Analytics 6.15.2? Also, you can try to restart your device and try to make it work again.
You need to add the debug symbols to your app debug archive file:
Select your Target -> Build Settings -> Build Options -> Debug
Information Format
Then Select DWARF with dSYM file for the debug mode.

App Crashes Only On Testflight Build

I have created an app on swift and tested it extensively using iPhone 6, iPhone 6 plus and iPhone 5 devices and all the simulators offered in Xcode. The app runs fine and does not crash when uploaded locally. (iOS 8)
I finally submitted a build for Testflight. The app consistently crashes at the same place after downloading the app through the Testflight build.
Is there a known issue where uploaded builds run differently than locally created builds? And how can I debug the issue with the Testflight build?
I guess its a swift compiler issue. To verify first go to Edit Scheme then change the Build configuration to Release mode in Run tab and then install the build locally. You will get to know where exactly its crashing.
I solved the issue by changing the swift compiler optimization from fastest to none. I'm not sure if this is an ideal long term solution, but the build no longer crashes.
In my case this happened after starting to use Xcode 11. It was a UISearchDisplayController (deprecated since iOS 8) that seems to work on a device or simulator in debug mode, but not in the release build. Xcode 11.3 doesn't give any inline warning in the code.
The crash was hard to find, because the search controller wasn't used any more, it was orphaned code.
It might be the Bitcode related issue. Check if your all third-party libraries support bitcode then and then only set bitcode to YES else set to NO.
Actually Bitcode is an intermediate representation of a compiled program. Apps you upload to iTunes Connect that contain bitcode will be compiled and linked on the App Store.
For all those who face this similar issue, can follow these steps
Go to Xcode->widows->organiser then select crashes tab then select your app.
If you have added your apple account in Xcode->preferences-> accounts then you Xcode will download all crash reports even for the testflight build.
It will have the stack trace you don't need to symbloicate it like old times.
PS:- the most common which I have seen is UISearchDisplayController issue
For anyone still having this issue working with React Native, you can run this command to run it in release mode, the same when you archive a build. That way you can debug the issue easier:
react-native run-ios --configuration Release
In my case, changing Legacy Build System to New Build System (for Xcode 10) solves my issue where Testflight build behaves differently. Might be helpful to someone.
I got it (partially!). Actually "release" implementation of UI_USER_INTERFACE_IDIOM() in swift project crashes the app.
However, still I have no clue why our app store app (objective c language based) does NOT crash.
My only guess is that it's a glitch in UI_USER_INTERFACE_IDIOM() API implementation with some language specific coding (swift vs objective c) by Apple.
Anyways, I would replace all UI_USER_INTERFACE_IDIOM() with UIDevice(). userInterfaceIdiom. I hope this helps someone!
If anyone else is having the same problem, here's what my fix was:
I finally got the problem down to a loop with a if statement, akin to this -
while(condition)
{
if (check)
{
code!
}
//There was no code here
}
Notice that there's no code at the end of the loop (where the comment is). Once I added a random bit of code (in this case, incrementing a variable for output), the problem stopped.
while(condition)
{
if (check)
{
code!
}
i += 1;
output statement
}
I think this has to be a compiler error, or else my "fix" shouldn't be a fix at all. But here it is in case it helps anyone else!
Instead of i += 1; in the empty while loops.
I did this in my empty while Loop: RunLoop.current.run(until: Date(timeIntervalSinceNow: 1))
And now the TestFlight App does not bomb!
A shorter time might also work such as: RunLoop.current.run(until: Date(timeIntervalSinceNow: 0.25))
Release build actually takes a different entitlement file than debug build entitlement while debugging in local.
While uploading an archive build it will take release build settings and release entitlement file by default. Make sure you have all the release settings correctly edited in the configurations.

Crashlytics is not sending Crash report from iPhone

I've setup the Crashlytics in my one iOS application and installed the application on a real device. My Crashlytics Dashboard is displaying that, I've successfully added the app. However, it's not sending crash report. My internet speed is not so good. But I can check my emails from this device. Can anybody guess, where is the problem?
Xcode debugger does NOT allow Crashlytics to process crash reports. Yeah, that seem weird even to me when I read that first time but it is a fact (Source). That's is the reason we never see crash report When:
- running app in Simulator
- running app on iDevice by directly build and run from Xcode with debugger on.
To make sure a crash is reported during your testing (copied from Crashlytics support site):
1. Launch simulator
2. Press stop
3. Launch your app and force a crash
4. Relaunch the app from simulator
5. See the crash report in the web dashboard.
EDIT:
Added a reference; Crashlytics also provides a short article on a quick way to force a crash.
My be it's late but work 100%
Make some changes in project build settings like in below image
and follow these instructions.
The primary reason any crash reporter won't work on iOS is due to interference from different crash reporters. However, with Crashlytics specifically there could be something specific to them causing the crash report not getting reported.
Xcode debugger does NOT allow Any Crash Reporter to process crash reports. This is because XCode overrides any hooks into the crash handling call backs. This only happens when:
running app in Simulator (with debugger on)
running app on iDevice by directly build and run from Xcode with debugger on.
To make sure a crash is reported during your testing (http://support.crashlytics.com/knowledgebase/articles/92523-why-can-t-i-have-xcode-connected-):
Launch simulator
Press stop
Launch your app and force a crash
Relaunch the app from simulator
See the crash report in the web dashboard.
While a super old video it's still relevant, here's a video of the steps above (example from Crittercism): https://www.youtube.com/watch?v=sU6Su3PBFH4
For me, the problem was that the device was connected to my Mac :)
From this source:
Also, if you have your device connected to your Mac, XCode's debugger
will step in as well. So just disconnect the device before testing :)
I found solution using following steps
1. Go to Edit Scheme
2. Run -> Info
3. Change Build Configuration to release.
Now run the app crash it. You will receive mail.
We recently ran into this issue and I found that somewhere along the way the build script was removed. Adding it back in with the following fixed the issue for us:
./Crashlytics.framework/run <your_api_key> <build_secret>
Note : When using Cocoapods you will want to us the following instead of the above (source):
./Pods/CrashlyticsFramework/Crashlytics.framework/run
Adding a build script:
To add a Run Script Build Phase in Xcode 6, select your application target in your project, then select "Build Phases".
Click the small "plus" icon and select "New Run Script Build Phase".
You should now see a Run Script section in the middle of your Build Phase options, as shown above.
Inside the body of the Run Script Build Phase, paste in the script.`
The above quote comes from Crashlytics's visual tutorial, referenced in this post.
Note: I originally posted this answer verbatim for Crashlytics error code: 202 when Submitting files.
From the RayWenderlich site:
You won’t get any crash reports if Xcode intercepts the crash event!
To make all the examples below work, you have to build and run the
application, then click the stop button on Xcode. This way you will
have the latest version installed on the the device. Once that is
done, you can launch the app on the device itself, and then crash it
all you want! All the crashes on your iOS device will be caught and
sent to the server component of the service that you have integrated
into the app. Crash reports are usually sent to the server the next
time you start the app, so the steps to follow to generate a crash
report on the server are as follows: Build and run on Xcode. Press the
stop button. Run the app on your iOS device. Make the app crash. Run
the app again.
Crashlytics works for me until now.
I don't know why but now it doesn't work.
You should turn debug-mode on by
[Crashlytics sharedInstance].debugMode = YES;
My problem is here Crashlytics error code: 202 when Submitting files :(
Make sure you are not forcing the crash too early.
Set [Crashlytics sharedInstance].debugMode to YES;
Watch for
Crashlytics] Settings loaded
on the Xcode console logs.
Then force the crash and restart the app, and the crash will be reported now.
I ran into a similar problem when trying the test crash code.
Crashlytics.sharedInstance().crash()
I was running my app from a device, without Xcode, and the crash wouldn't show up on Crashlytics Dashboard. What worked for me was the following tip from Crashlytics website:
Make sure to launch the app after crashing it, so that the crash can
be uploaded
I commented out the above crash() call, and re-ran the app. Then the crash showed up in the Dashboard.
This is for xcode 9, from crashlytics 3.4.0
After doing this, be patient and wait for a few minutes.
Have you tried running [[Crashlytics sharedInstance] crash] on a device and seeing if that gets reported? There are a few reasons why Crashlytics might not work including other crash reporters etc.
If you don't upload the dSYM file, Crashlytics will not show your crash even though the report successfully uploaded.
You could run into this problem, if you have set up your build-script to only run on your CI server. Then if you have copied your app to your phone via xcode and you run it without being attached to the debugger, the report will be uploaded but ignored, because of the missing dSYM file.
Sometimes, it takes some time for the logs to show up. I am able to find them after 15-20 mins
One of the issue I feel that in the Run Script Phase, it should be a separate Run Script Phase for CrashLytics. When had the run script
./Fabric.framework/run
With some of my other script, everything was ok, CrashLytics log show report submitted, but nothing was in the web interface.
When I add another Run script phase only with Fabric run, it appears like a magic :)
My first try was with cocoapods, but that did not work.
When I manually add all the framework and a separate run script phase that worked.
This worked for me,
If you're testing on iDevice, just unplug iDevice with your Xcode and run your app.
Now, If crashed it will be updated on dashboard.
I solved by deselecting "Run Script only when installing" option in Run script (one for Fabric(crashlytics))

Resources