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

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

Related

How to force an app to simulate in iPhone simulation using an iPad using Expo?

I'm currently using Expo to build an iPhone app.
I'm not supporting iPad and I have it so when it builds on iPad it runs in an iPhone Simulation.
The problem is I can't develop with Expo using this approach.
The app shows up as an iPad app, but this is not the mode being shipped to users.
According to this I might have some luck adding ios.supportsTablet to the app.json file and setting it to false but it didn't change anything.
Is there another configuration value I'm missing to force iPhone simulation mode on an iPad?
I'd rather not eject if I don't have to.
According to this, there currently isn't a way to live develop using "iPhone mode" on an iPad.
The Expo Client app can’t change its tablet support on the fly,
unfortunately, so it will always adapt your project to the iPad
viewport.
So, following the above forum here is how you get around it:
Run exp build:ios -t simulator
Open Simulator
Select Hardware/Device/iOs 11.x/iPad x generation
Unpack the generated build from the first command
You should have a file named yourApp.app
Drag that file into the iPad you are running in Simulator
It will install the app on the device and you can then view your creation
This is faster than doing a whole build cycle with TestFlight just to see your changes.
But it still leaves a bit to be desired.

Appcelerator App Conversion iOS to Android.

One of our developer developed an app in appcelerator using alloy framework for iOS which works fine. Now we want to run the same app in Android, since the appcelerator is a cross platform tool, we wish to make the Android version of the App. I tried searching about it and explored the applcelerator ide for options but couldn't find it. Can some one please guide me into the right direction?
First of all have a look at this link : http://docs.appcelerator.com/platform/latest/#!/guide/Supporting_Multiple_Platforms_in_a_Single_Codebase this will guide you to update the application for multiple platforms.
Their are basically two different ways to port any application from android to iOS or vise-versa, but before that just let me clear one more thing to you about tiapp.xml.
In the tiapp.xml of your project you need to updated the Development Target by checking for which platform you are developing the application for (iPhone, iPad, android, Mobile Web).
Option 1 :
Cross Platform is build to make code re-usable (i.e. re-use same code for all the platforms), but we have exceptions with many things. Their are lot of components that work fine in iOS but when you use them in android then you will face errors. So in that case you just need to apply conditions for android and iOS like below :
if(OS_ANDROID)
// do something
else if(OS_IOS)
// do something
What you need to do is that you need run the application in android simulator and test the application for these changes and then apply the changes accordingly.
Basically a developer has to target the UI for both the platforms, as their will not be any logical differences between the two. Also their will be UI changes between the same components, like for example a picker in iOS will not look the same as it will when you look it in an android application.
Option 2 :
Now in the project you have assets folder with the platform that you have selected in the tiapp.xml (i.e. iPhone, android etc).
You can create similar structure in the style and view folder, create two folders iOS and android in both the directory (i.e. style and view).
First, move .tss of style folder (except app.tss and index.tss) in the iOS folder, then copy the files in the android folder also.
Repeat the similar process with the View folder also.
Now you have two different structures (i.e. view and styles) according to their platform. Now you can run the application in android simulators and resolve the error that you face.
Hope this small information helps the cause, you can also have look at the documentation of all the components from below link :
http://docs.appcelerator.com/platform/latest/#!/api/Titanium.UI.TableView

Xcode - Capabilities settings

I am using Unity to build an Xcode project. I already implemented in-app purchase and added the StoreKit framework to the project.
But the "Capablities" settings in Xcode shows that the "In-App Purchase" toggle is off.
My purchase on sandbox does work. But I don't know what effect does this "In-App Purchase" button have.
Unity does not have an automatic way to set Capablities settings and I don't want to set it every time.
Should I turn it on?

How to measure graphic performance of Mac app?

In an iOS Xcode app, you can use the Core Animation Instrument to measure graphics performance issues such like laggy UITableView scrolling. I want to do the same on the Mac for some layer backed views I am debugging. In particular I would like to measure frame rate. Any ideas how to do this since the Core Animation instrument isn't available for Mac apps?
Frame Meter is available within "Quartz Debug"
Menu Xcode > Open Developer Tool > More Developer Tools …
Will open developer.apple.com and you'll have to sign in
Download "Graphics Tools for Xcode - January 2013"
Then use "Quartz Debug" for a Frame Meter

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