Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by $$anonymous$$ · Apr 07, 2017 at 02:43 PM · androidvrcommand-lineplayersettings

How do I enable VR in player settings on an android build target through C# on the command line?

 // Set the Virtual Reality flag
 PlayerSettings.virtualRealitySupported = true;

So, I've got the above line in a static method utilized by a build script. As part of the build I have to enable VR support on the android build target. The problem I'm running into is that the above code only enables VR support for the PC/Linux/Mac builds, and not the android build target, so the APK generated by the following code is not VR enabled.

 BuildPipeline.BuildPlayer(new string[] { "baseScene.unity" }, apkPath, BuildTarget.Android, BuildOptions.None);

I've looked in the PlayerSettings.Android class, and there's no .virtualRealitySupported flag. It's only in the base PlayerSettings class, and doesn't seem to carry over to the Android buildTarget.

I cannot set the flag manually. It's an automated process that pulls source from git and builds a fresh project through the command line. No manual interaction is allowed.

How do I enable virtual reality support for an android build target in my build script?

Comment
Add comment · Show 1
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image $$anonymous$$ · Apr 06, 2017 at 09:52 PM 0
Share

I think I figured out how to switch build targets on command line with the -buildTarget argument. However, -buildTarget seems to be crashing unity if I issue it and the documentation on it doesn't say if it has any additional requirements or not.

I get the following (quite worthless) stack trace when I try to compile a new project form the command line with -buildTarget android:

Targeting platform: android
Assertion failed on expression: 'pos < this->m_num_bits'

(Filename: C:\buildslave\unity\build\Runtime/Utilities/dynamic_bitset.h Line: 612)

Crash!!!
SymInit: Symbol-SearchPath: '/$$anonymous$$onoEmbedRuntime;.;/BrandNewProj;
========== OUTPUTING STAC$$anonymous$$ TRACE ==================

0x00000001401939F0 (Unity) GetPrecompiledAssembly$$anonymous$$ask
0x00000001401AC47B (Unity) ForceRecompileAllScriptsAndDlls
0x0000000140FA4D63 (Unity) UnityConnectSettings::OnEditorBuildTargetChanged
0x000000014149A044 (Unity) EditorUserBuildSettings::SetActiveBuildTarget
0x0000000141483487 (Unity) Application::InitializeProject
0x0000000141548C87 (Unity) Win$$anonymous$$ain
0x0000000141863E94 (Unity) strnlen
0x00007FF9B2BD8364 ($$anonymous$$ERNEL32) BaseThreadInitThunk
0x00007FF9B2DA70D1 (ntdll) RtlUserThreadStart

========== END OF STAC$$anonymous$$TRACE ===========

0 Replies

· Add your reply
  • Sort: 

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

2 People are following this question.

avatar image avatar image

Related Questions

Oculus Plugin causes crash in Jenkins when building APK 0 Answers

Can handheld.PlayfullScreenMovie() work with Vr view to play 360 degree video using google vr sdk? 0 Answers

How to automate export of android project through command line, which is done by following menu item on UI: "File -> Build Settings -> Export" (shown in attached image) 1 Answer

Sending information from android game to android app via Bluetooth/Wifi-Direct 0 Answers

Android: Disable Autorotate Animation 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges