Android Build > Code Generation and Runtime option > Enable Startup tracking? - xamarin

I created a Xamarin forms app that I would like to send to the Google Play store.
I see this option:
Android Build > Code Generation and Runtime option > Enable Startup
tracking
Is that something that people normally select when working with XF and deploying to the Play Store?

Related

How to get a Xamarin iOS notification service extension working?

I'm trying to add a notification service extension to my Xamarin iOS so that I can receive silent notifications. I'm using OneSignal and have followed their instructions and set up everything that I think is required:
App bundle id = com.abc.abcapp
Extension bundle ID = com.abc.abcapp.OneSignalNotificationServiceExtension
Added extension project reference to app
Enabled App Groups in app & extension and set to group.com.abc.abcapp.onesignal (also registered this in Apple developer portal)
Using Automatic Provisioning for both, which seems to have registered everything properly
It builds fine. I have Visual Studio 2022 deploy it to a physical iPhone plugged into my computer. It deploys fine. But notifications don't appear to go to the extension. They just go to the App, which limit the number of silent notifications I can send to a device to a few an hour.
Some possibly useful debugging?
Getting the phone's device log in Visual Studio is really hit or miss but at one point I did see this err:
Library Validation failed: Rejecting '/private/var/containers/Bundle/Application/11D98889-9C2C-4218-A2C8-227C93CBD579/Abc.app/PlugIns/OneSignalNotificationServiceExtension.appex/libOneSignalNotificationServiceExtension.dll.dylib' (Team ID: none, platform: no) for process 'OneSignalNotific(2868)' (Team ID: CJTV38PNRD, platform: no), reason: mapped file has no cdhash, completely unsigned? Code has to be at least ad-hoc signed.
When I try to build this in MS App Center, it doesn't recognize that I have an extension and doesn't let me associate a second profile or cert. (which I think it's supposed to do?)
According to documentation You can’t modify silent notifications or those that only play a sound or badge the app’s icon.

Adding aps-environment entitlement to UITest Target in Xcode

I am testing an app that uses Push notifications. Within the main app target, the 'Push Notifications' (inside the Capabilities tab) is set to on.
I created a UITest target for UI Automation Testing. UITest targets do not contain a 'Capabilities' tab so I am unable to set this target to use push notifications. When I try and Automatically manage signing, I get the following error message:
"Automatic signing can't add the aps-environment entitlement to your provisioning profile. Switch to manual signing and resolve the issue by downloading a matching provisioning profile form the developer website."
The trouble is the Xcode managed provisioning profiles do not seem to appear in the Developer Portal anymore.
Does anyone know a way round this? Is there perhaps a build setting within the UITest Target that I can set to add the aps-environment entitlement (instead of using the Capabilities tab).
PS - looking online all accepted answers for this error are to switch on Push notifications in the 'Capabilities' tab (something we don't have in the UITest target):
e.g. Error when running ionic cordova run ios - seems to be related to push notification
Fixed this by removing the need for entitlements from the XCUITest Target. Here are the details:
Selected the UITest target >
Went to the UITest 'Build Settings' tab >
Searched for 'Code Signing Entitlements' >
Removed all entitlement values here (since only removing them from the XCUITest target not the app itself)
This fixed the error and allowed it to work.

Can't open the wearable-preview-support.jar for Android Wear

I'm trying to run the wearable-preview-support.jar from terminal and I get the error
java -jar wearable-preview-support.jar
Failed to load Main-Class manifest attribute from
wearable-preview-support.jar
Also just trying to open the jar by double clicking gives the error:
The Java JAR file "wearable-preview-support.jar" could not be launched. Check the Console for possible error messages.
No error messages were displayed in Console.
Anyone else having this problem?
The JAR isn't a self contained executable, it is a library to build the wearable apps off of. See this page for more information about how to use it. You have to reference it as a library in your Android application in order to run it, and you will have to run it in the Android virtual machine.
Here are some steps to get Android Wear working in a virtual machine. Keep in mind it might be a little underwhelming using it with a mouse since it'll be less responsive than the actual device will be (hopefully).
The jar file should be included in your Android application, you do not run it directly.
The "Android Wear Preview app" is an application you download from the Google Play Store which runs on your real device. You can only download this application if google have enabled you do. For this to happen you need to sign up at the Google wear preview signup - once you have downloaded the application, you then grant it notification access.

How to check cpu usage for scripts and gameObjects in unity?

I have created the action game in unity. But the frame rate is too low on mobile devices. How do I check how much cpu is currently using for my scripts and gameObject in unity?. Similar like how we do in "Instruments" in iOS.
there is built-in function called Profiler in unity3D though It's restricted if you are using free ver of Unity
Check http://docs.unity3d.com/Documentation/Manual/iphone-InternalProfiler.html
In the case you have Xcode on your system,You can also use Instruments for your unity project.
1.Check Development build in the build menu and build your unity project into iOS/OSX app.
2.Open Xcode and select Edit Scheme.... then choose Debug for Build Configuration
3.Do Clean and Build
4.Select the Profile and Run Instruments
If you want to check the usage of specific script you wrote,Check
BehaviourManager::Update -> MonoBehaviour::Update -> CallUpdateMethod

How to debug Unity project with iOS simulator?

As somebody said, the Unity project must be run on devices, but that is a lot of trouble. Is there any way to run a project in iOS's simulator?
Prerequisites:
Mac
XCode
Unity3D for Mac
Guide:
Go to Edit > Player settings > Inspector > iOS tab. Change the Target SDK to Simulator SDK then build the project again.
Open Build Settings and switch platform to iOS.
In the same window set Run XCode as Debug, check Development Build and Script Debugging.
Click Build and Run, choose a directory for iOS builds (for example, create a new directory named Build.iOS)
Build's a long process, take a break.
Unity3D documentation - Building your Unity game to an iOS device for testing.
It was supported until Unity3D 3.3. and iOS 4.??? But the current release 3.4 crashes. See this posting in Unity3D forum.
Anyway I find it easier to run the project in in editor player for debugging and do real testing on the device. Deploying to iPhone via XCode is always annoyingly slow. So I designed my code to distinguish at startup between device and player like
if (Application.platform == RuntimePlatform.IPhonePlayer) {
// do what ever you need
} else ...
Working with the abstract factory design pattern or singletons makes it pretty easy.

Resources