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
1
Question by marcusz · Oct 23, 2015 at 02:31 PM · unity 4.6build settingsdevelopment builddefine

DEVELOPMENT_BUILD define never set

I would like to compile-out a lot of C# test code in the release version of my game. I don't wan't to have to remember to change custom defines and I would like Unity Cloud Build to automatically do the right thing. I thought the best way was to use the "Development Build" checkbox in Build Settings. This is a test:

 #if DEVELOPMENT_BUILD
     ??? A
 #else
     ??? B
 #endif

I expected this code to get a compilation error at ??? A when "Development Build" is checked but this never happens. What is wrong? Is there another way to solve my need?

Here is the documentation: http://docs.unity3d.com/Manual/PlatformDependentCompilation.html

"You can also use the DEVELOPMENT_BUILD define to identify whether your script is running in a player which was built with the “Development Build” option enabled."

I'm using Unity 4.6.9 on Mac OS X 10.11.1

Comment
Add comment
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

4 Replies

· Add your reply
  • Sort: 
avatar image
2

Answer by p_025 · Mar 20, 2016 at 05:08 AM

I think the DEVELOPMENT_BUILD define only gets set/cleared when you actually do a build with the checkbox checked/cleared. Otherwise it will still be set to what it was the last time you did a build, regardless of the state of the checkbox.

This may be considered a bug. Consider reporting it to Unity.

Comment
Add comment · Share
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
2

Answer by OndrejP · Jan 20, 2020 at 03:18 PM

I'm using this

 #if DEVELOPMENT_BUILD || UNITY_EDITOR
 Debug.Log("Some logging");
 #endif
Comment
Add comment · Share
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
1

Answer by RMGK · Jul 30, 2019 at 11:05 PM

Yea, just confirmed. DEVELOPMENT_BUILD only gets used in compiled builds. I'm not sure why Unity did that. To identify debug builds at runtime, use Debug.isDebugBuild or DEVELOPMENT_BUILD. In Editor use UnityEditor.EditorUserBuildSettings.development. To solve your specific issue, I would use UnityEditor.EditorUserBuildSettings.development to set a define symbol in a cloud build preprocessor.

https://docs.unity3d.com/Manual/UnityCloudBuildPreAndPostExportMethods.html

Comment
Add comment · Share
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
0

Answer by roointan · Mar 28, 2020 at 06:55 AM

The documentation is clearly stating DEVELOPMENT_BUILD is used for "player", not "editor". This is not a bug I think, just a directive only to be used for builds.

Comment
Add comment · Share
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

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

8 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Is it possible to hide the Development Build stamp while still including debug symbols? 0 Answers

Build Settings or Project descriptor file in Unity 1 Answer

Build Settings Error 0 Answers

Input.accelerometer x,y,z always returning zero 1 Answer

Simple UI not appearing once deployed to iOS (4.6.2) 1 Answer


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