25

On Xcode 7.2, how can I disable these debug/app measurements intempestive displays :

2016-01-07 11:52:53.085 MyApp[1457:] <GMR/INFO> App measurement v.1302000 started
2016-01-07 11:52:53.091 MyApp[1457:] <GMR/INFO> To enable debug logging set the following application argument: -GMRDebugEnabled (see http://goo.gl/Y0Yjwu)
2016-01-07 11:52:53.091 MyApp[1457:] <GMR/DEBUG> Debug logging enabled
2016-01-07 11:52:53.092 MyApp[1457:] <GMR/DEBUG> App measurement is monitoring the network status
2016-01-07 11:52:53.188 MyApp[1457:] <GMR/DEBUG> App measurement is ready to receive events
2016-01-07 11:52:53.201 MyApp[1457:] <GMR/DEBUG> No network. Upload task will not be scheduled
2016-01-07 11:52:53.202 MyApp[1457:] <GMR/DEBUG> Scheduling user engagement timer
2016-01-07 11:52:53.202 MyApp[1457:] <GMR/DEBUG> Timer scheduled to fire in approx. (s): 3600
2016-01-07 11:52:53.203 MyApp[1457:] <GMR/INFO> App measurement enabled
2016-01-07 11:52:53.237 MyApp[1457:] <GMR/DEBUG> Scheduling user engagement timer
2016-01-07 11:52:53.242 MyApp[1457:] <GMR/DEBUG> Canceling active timer
2016-01-07 11:52:53.245 MyApp[1457:] <GMR/DEBUG> Timer scheduled to fire in approx. (s): 3600
2016-01-07 11:52:53.270 MyApp[1457:] <GMR/DEBUG> Network status has changed. code, status: 3, Connected
2016-01-07 11:52:53.272 MyApp[1457:] <GMR/DEBUG> Timer scheduled to fire in approx. (s): 1614.930058836937
2016-01-07 11:52:53.272 MyApp[1457:] <GMR/DEBUG> Upload task scheduled to be executed in approx. (s): 1614.930058836937

It bothers me since a while...

Thanks !

Edit : I tried the -noGMRDebugEnabled flag, reinstalling the app without -GMRDebugEnabled, reset Content and settings, restarting Xcode ... nothing works :-(

enter image description here

user102008
  • 30,736
  • 10
  • 83
  • 104
Nahouto
  • 1,375
  • 2
  • 18
  • 31
  • http://stackoverflow.com/questions/34789022/ios-running-app-from-xcode-show-me-a-message-to-enable-debug-logging ? – Larme Feb 04 '16 at 13:40
  • 1
    modify this `GMRDebugEnabled` argument does not change anything... – Nahouto Feb 04 '16 at 13:57
  • Wondering if you can set it to `GMRDebugDisabled` instead? Is it linked to a Google's SDK? And if you remove it? – Larme Feb 04 '16 at 13:58
  • J'ai tenté le GMRDebugDisabled mais rien ne semble fonctionner. Je ne sais pas si c'est lié au Google SignIn SDK (que j'utilise) ou a la nouvelle version de Xcode. Tout ça est apparu quand j'ai ajoute le GMRDebugEnabled dans mon scheme (comme suggéré dans ce warning http://stackoverflow.com/questions/34789022/ios-running-app-from-xcode-show-me-a-message-to-enable-debug-logging) mais impossible de désactiver. To sum up, neither setting GMRDebugDisabled argument or unchecking GMRDebugEnabled seem to work. This problem first appears when adding GMRDebugEnabled in my scheme as suggested by xcode. – Nahouto Feb 04 '16 at 14:31
  • > GMRDebugDisabled not working – Arti Feb 04 '16 at 15:15
  • And putting `-GMRDebugEnabled NO` instead? – Larme Feb 04 '16 at 15:48
  • doesn't work either... :-( – Nahouto Feb 04 '16 at 16:26
  • anyone, please help;) – Arti Feb 05 '16 at 19:45

3 Answers3

3

In Swift to disable the Google Measurements I've added in the UIApplicationDelegate launch :

GMRConfiguration.sharedInstance().setIsEnabled(false)
Laurent LK
  • 31
  • 4
3

Finally, I found it in the Google API docs.

In the GoogleService-Info.plist file, you have to add a key named IS_MEASUREMENT_ENABLED, set it as a boolean, and select NO value. This will disable App measurement feature and display in the console :

2016-07-03 10:51:38.522 MyApp[313:] <GMR/INFO> App measurement disabled

Thanks for all your answers !

Nahouto
  • 1,375
  • 2
  • 18
  • 31
  • 1
    This disable the the entire library, not the debug logging. – Guilherme Puglia Jul 08 '16 at 17:54
  • Google Measurement (GMR). Keep in mind that since Google Cocoapod version 3.0.3 (https://github.com/CocoaPods/Specs/blob/master/Specs/Google/3.0.3/Google.podspec.json), Google Measurement was replaced with Firebase Analytics. – Guilherme Puglia Jul 11 '16 at 20:23
  • thanks, I indeed did not intend to install Google Measurement, but only Google Sign In... – Nahouto Jul 12 '16 at 07:34
0

To remove the debug mode, you can delete the UserDefault entry using the following call (you only need to run it once):

[[NSUserDefaults standardUserDefaults] removeObjectForKey:@"/google/measurement/debug_mode"];

  • 1
    Nothing of these 3 works. Please see my edited question – Nahouto Feb 11 '16 at 08:47
  • Weird, noGMRDebugEnabled works for me. The debug state is recorded in the NSUserDefaults, make sure you are cleaning the standardUserDefaults and not running your application with GMRDebugEnabled after that. – Guilherme Puglia Feb 12 '16 at 19:30
  • Can you double check if you are changing the command line for the appropriate XCode target? It should be in above the right column in the window you take the screenshot. – Guilherme Puglia Feb 19 '16 at 00:38
  • I triple checked the target, and sorry but it does not work. I will try to investigate further by creating a new project... – Nahouto Feb 21 '16 at 10:31
  • If Guilherme's answer works for anyone, please let a comment ! – Nahouto Feb 23 '16 at 12:35