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 /
  • Help Room /
avatar image
0
Question by DroidifyDevs · Feb 08, 2016 at 11:09 PM · androidscripting problemscriptingbasicsloglogging

How to log in an android game?

Hi there!

Sorry for the noob question, but how to I view Debug.Log when I have built the game as an .APK on an Android device? If there is something else than Debug.Log, what is it? I just need to log some lines in my script while it is running on an Android device(NOT EDITOR) since I'm having issues with Google Play Leaderboard login.

Thank you so much!

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

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by mateo4632 · Feb 09, 2016 at 02:11 AM

 using UnityEngine;
 using System.Collections;
  
 public class GuiTextDebug : MonoBehaviour {
  
     private float windowPosition = -440.0f;
     private int positionCheck = 2;
     private static string windowText = "";
     private Vector2 scrollViewVector = Vector2.zero;
     private GUIStyle debugBoxStyle;
    
     private float leftSide = 0.0f;
     private float debugWidth = 420.0f;
    
     public bool debugIsOn = false;
    
     public static void debug(string newString)
     {
         windowText = newString + "\n" + windowText;
         UnityEngine.Debug.Log(newString);
     }
        
     void Start () {
         debugBoxStyle = new GUIStyle();
         debugBoxStyle.alignment = TextAnchor.UpperLeft;
         leftSide = 120; //Screen.width - debugWidth - 3;
     }
        
    
     void OnGUI () {
        
         if (debugIsOn) {
  
             GUI.depth = 0;
                        
             GUI.BeginGroup (new Rect(windowPosition, 40.0f, leftSide, 200.0f));
            
                 scrollViewVector = GUI.BeginScrollView (new Rect (0, 0.0f, debugWidth, 200.0f), scrollViewVector, new Rect (0.0f, 0.0f, 400.0f, 2000.0f));
                 GUI.Box (new Rect (0, 0.0f, debugWidth - 20.0f, 2000.0f), windowText, debugBoxStyle);
                 GUI.EndScrollView();
            
             GUI.EndGroup ();
            
            
    
             if (GUI.Button(new Rect (leftSide, 0.0f,75.0f,40.0f), "Debug")){
                 if (positionCheck == 1){
                     windowPosition = -440.0f;
                     positionCheck = 2;
                 }
                 else {
                     windowPosition = leftSide;
                     positionCheck = 1;
                 }
             }
            
             if (GUI.Button(new Rect (leftSide + 80f,0.0f,75.0f,40.0f),"Clear")){
                 windowText = "";
             }
         }
     }
  
  
 }

This is an older code but should still work just add it a game object. Let me know if this worked for you!

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 Darsak · Feb 09, 2016 at 09:25 AM

@putin2001 You can use adb command to view android device logs.

open command prompt/ terminal of your system and use adb logcat command to view logs.

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

56 People are following this question.

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

Related Questions

transform.position not working on phone (Cardboard) 0 Answers

how to make my character move up and down (Vertical) in android control 0 Answers

Rotate character 0 Answers

How do i fix this problem 1 Answer

Help with a C# script .SetActive 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