Where to log application logs on iOS from unity - c#

Our application writes logs to a file at a folder called UnityEngine.Application.persistentDataPath.
Now on Android we can open the file browser and open the log file. Not so on iOS. Short of Jailbreaking the phone to access all folders
Is there a way to access log file in that folder on iOS?
If not, is there another place where I can create that log file, so that the same is accessible e.g. from the file apps? Would Environment.SpecialFolder.MyDocuments work?
Note I am trying to write the file from C# code within unity environment, and ideally would NOT want to jump into NSLog to do this. Just a plain vanilla FileHelper.AppendAllText(LOG_FILE_NAME, "message"); I seek your help in finding a good value for that LOG_FILE_NAME.
Alternatively, rather than us trying to write the logs in a file, is there something better out there in Unity that works cross platform? Something like an inbuilt log file writer sink?

iOS: Application.persistentDataPath points to /var/mobile/Containers/Data/Application//Documents
You can access the ios containers with xcode.
Open xcode, install the app on the device, then open "Window"->"Devices". You can now click on the gear wheel -> "Download Container.."

Niklas has provided you the answer to #1 which is how to access the file on your iOS device.
If you want to make your files accessible to other apps you should check out the UIFaileSharingEnabled functionality for your app.
https://developer.apple.com/documentation/bundleresources/information_property_list/uifilesharingenabled

Related

Saving file in arbitrary folder uwp

I'm writing UWP app (C# and C++/CX).
My app gives user an opportunity to save video recorded by some connected camera.
I use OpenCV VideoWriter for it because I have to add video effects to C# SoftwareBitmap (comes to me from MediaFrameReader).
Thats how I'm creating VideoWriter in C++/CX code:
videoWriter.open(
pathToCreatedFile, // Works with "videos", but not with "desktop" or other
encodingProperties.codec,
encodingProperties.fps,
cv::Size{ (int)frameSize.Width, (int)frameSize.Height }
);
If I pick default Windows "Videos" library for saving, everything is good, but when I try to use "Desktop" folder for example or any other specific location, my output .mp4 file is 0KB.
Is it possible to save file in random directory in UWP and how can I reach it?
P.S. My minimal version is November update.
By design, you don't have access to arbitrary file folders from a UWP. You can request specific media libraries via a declared capability easily: documentsLibrary, documentsLibrary, picturesLibrary, and/or picturesLibrary.
There is no option for accessing the desktop directly.
The broadFileSystemAccess capability would allow this, but this is a restricted capability which means it will be difficult to publish it to the Windows Store (if that's your plan).
See Microsoft Docs.

Save computer-accessible file from iPhone

I would like to let a user save a file from my iOS app (Xamarin.Forms) to a computer. Since this seems impossible directly, I'd like to let him save the file on the device, so that he can then connect the device to a computer and copy it. But this seems a problem as well (except for images and videos). I tried checking iCloud, but that looks extremely complicated (and overkill).
So, is there some simple way to do this anyway? If not, is there some simple workaround? (I don't have experience with this; please don't discount any obvious solutions.)
iOS offers iTunes file sharing, How to enable file sharing for my app?
This will show all your files in your apps document directory in iTunes. Allowing a user to add and retrieve files from your app.

Stream and run Managed.Dll?

Let's say I have a want to make a licesing system where my user authecticates against my ASP.Net website from my desktop application.
Would it than be possible to stream a Managed .Dll (C# .Dll) File or .Exe I guess and make it run on my Clients Computer without saving the file to disk?
So when my User stops using it he should not have access to the file.
If so what should I look into to make this happen?
Browser security don't allow you to do this.
But you can use a litle exe which download lib, and using reflection load it and run.

Windows Form Application : Publish issue

I'm very new to Visual Studio 2010. I decided to create a simple WFA with C#.
Everything work fine with Images and Audio playback. My intention is to create a standalone application and send it to my friend as a gift. Problem I facing now is that when I tried to publish the application, the Images / Audio is still using the same location in my PC. So it won't play nor display any images.
Any comment on this or guide for me? I did try search for solution but doesn't seems to have any luck.
This is the code that I used to play Audio :
SoundPlayer ply = new SoundPlayer(#"C:\Users\Liam619\Documents\Visual Studio 2010\Projects\BirthdayApp\BirthdayApp\Resources\BirthdaySong.wav");
If I remove or change the path, the Application will hit error for locating the Audio file.
There may be several solutions to your problem.
a) embed the sound into a resource. As a beginner, resources may be a bit tricky to get it right the first time. But I want to encourage you reading something about it. You'll need resources when you want to translate your first program.
b) create an installer which copies the sound file to the installation directory. Try InnoSetup. If you're a programmer, sooner or later, you'll need to create a Setup anyway. Always worth knowing how to do that.
In that case, you still need the path to the sound file, but if you install your EXE into the same path as the sound file, see getting the application's executable directory.
everything in the database whether images or audio refers to your own server database.you have to send the database too with the app and the correct version .NET framework needs to be installed on the target PC.

Copy files from PC to iPad App Document Folder

I want to programmatically (c# or vb.net) copy files to an apps document folder on the iPad. The app has file sharing turned on.
I have looked through the iTunes SDK, but haven't found anything that would seem to allow you to access an app.
There is an application called DiskAid that does this so I know it's possible. I just don't know where to begin and I cannot seem to find much info.
If anyone has any info on where to look or what I would use to do this please let me know.
I would first suggest you enable the iPod to be used for external storage. This can be done through iTunes.
-Connect your iPod to your computer and open iTunes.
-Click on the iPod device in the iTunes source list on the left side of the screen.
-Click the Settings tab at the top of the screen.
-Under Settings, check the box that says "Enable disk use."
Then just use in C#:
File.Copy("Source File Here", "iPod Destination Here");

Categories