Search Unity

  1. Unity 2019.2 is now released.
    Dismiss Notice

Build From Command Line Disabling Analytics

Discussion in 'Unity Analytics' started by luckycarp_vke, Aug 15, 2019.

  1. luckycarp_vke

    luckycarp_vke

    Joined:
    Jul 31, 2019
    Posts:
    8
    Hi,

    I'm the build engineer at our game studio and I've been setting up analytics for us. I reliably get core and custom events when the game is run from the windows editor after people link their editor to the project. I also get analytics events when I build the game out to an apk via the editor and put it on an android device. However I have yet to get any analytics events from mobile devices where the game was built via command line. The devices are connected to the net and I do get events from editor built versions of the game, so the only thing I can think that would cause this is that our mobile builds that are run from the command line which doesn't seem to automatically link builds with a user's account or licenses.

    I'd like to know more about the differences between building the game from the editor and how to setup the command line to link the built game to our project the same way the editor does.

    Thanks
     
  2. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    5,440
    Please confirm with Charles Proxy on a device with a build done from the command line. Are you passing a username/password in the command line? Please provide the syntax that you are using, and I will try here also. We read the service settings at build time from /ProjectSettings/UnityConnectSettings.Asset , please provide the contents of that file after a command line build https://support.unity3d.com/hc/en-us/articles/115002917683-Using-Charles-Proxy-with-Unity
     
  3. luckycarp_vke

    luckycarp_vke

    Joined:
    Jul 31, 2019
    Posts:
    8
    I'll get a charles proxy test setup. Builds I've tested for this have had this syntax:

    E:\Unity\Editor\Unity.exe -quit -batchmode -username 'MyUnityLogin@studio.com' -password 'MyUnityPassword' -executeMethod Build.BuildDevelopmentAndroid -logFile output.log -projectPath

    heres the output in the unity connect settings asset file from that build

    Code (JavaScript):
    1. %YAML 1.1
    2. %TAG !u! tag:unity3d.com,2011:
    3. --- !u!310 &1
    4. UnityConnectSettings:
    5.   m_ObjectHideFlags: 0
    6.   serializedVersion: 1
    7.   m_Enabled: 1
    8.   m_TestMode: 0
    9.   m_EventOldUrl: https://api.uca.cloud.unity3d.com/v1/events
    10.   m_EventUrl: https://cdp.cloud.unity3d.com/v1/events
    11.   m_ConfigUrl: https://config.uca.cloud.unity3d.com
    12.   m_TestInitMode: 0
    13.   CrashReportingSettings:
    14.     m_EventUrl: https://perf-events.cloud.unity3d.com
    15.     m_Enabled: 1
    16.     m_LogBufferSize: 10
    17.     m_CaptureEditorExceptions: 1
    18.   UnityPurchasingSettings:
    19.     m_Enabled: 0
    20.     m_TestMode: 0
    21.   UnityAnalyticsSettings:
    22.     m_Enabled: 1
    23.     m_TestMode: 0
    24.     m_InitializeOnStartup: 1
    25.   UnityAdsSettings:
    26.     m_Enabled: 0
    27.     m_InitializeOnStartup: 1
    28.     m_TestMode: 0
    29.     m_IosGameId:
    30.     m_AndroidGameId:
    31.     m_GameIds:
    32.       AndroidPlayer:
    33.       iPhonePlayer:
    34.       tvOSPlayer:
    35.     m_GameId:
    36.   PerformanceReportingSettings:
    37.     m_Enabled: 0
    38.  
     
  4. luckycarp_vke

    luckycarp_vke

    Joined:
    Jul 31, 2019
    Posts:
    8
    I'm not sure what a charles proxy test will tell me though, when running from an editor built version that same android device gives me analytics events and when I run from a command line built game it doesn't.
     
  5. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    5,440
    A Charles capture will confirm and let us know more about what is going on. It will confirm if Analytics is enabled or disabled or if there is something else going on.
     
  6. luckycarp_vke

    luckycarp_vke

    Joined:
    Jul 31, 2019
    Posts:
    8
    ok I have 4 items total from 2 development builds, one with my credentials on the command line (1441), one with the credentials of someone on the team who had a pro liscense and supplied their login info and serial number to the command line (1160)
     
  7. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    5,440
    So what are your conclusions from looking at the files? I can't tell which is which. I was looking for the Charles capture file with a .chls extension. It likely contains private information, so send it in a private message, along with your observations on the test.
     
  8. luckycarp_vke

    luckycarp_vke

    Joined:
    Jul 31, 2019
    Posts:
    8
    on trying to connect they both give this error:
    javax.net.ssl.SSLHandshakeException: Received fatal alert: certificate_unknown

    also the csv files are named according to which build they belong to (the first build was actually 1141, not 1441, that was a typo)
     
  9. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    5,440
    Again, what are your conclusions when comparing the files, what differences did you see? Please follow the directions here https://support.unity3d.com/hc/en-us/articles/115002917683-Using-Charles-Proxy-with-Unity . You need to install the Root certificate on the host PC (Help/SSL Proxying/Install Charles root certificate) and REBOOT. Then you need to install the cert on the device as described in the article by browsing to chls.pro/ssl on the device. In Charles, under SSL Proxying Settings, be sure to set *.unity3d.com:* . If your device is Android 7 (Nougat) and above, you'll need to change the AndroidManifest.xml and build from Android Studio (which is a bit of a pain, probably easier to find an older Android device)
     
  10. luckycarp_vke

    luckycarp_vke

    Joined:
    Jul 31, 2019
    Posts:
    8
    The only differences between the two are that 1141 has an extra POST message at the beginning that completes, everything else and they fail exactly the same way.
     
  11. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    5,440
    Got it. I will look forward to the Charles capture