禁用Google App测量调试日志记录

25

在Xcode 7.2中,我该如何禁用这些调试/应用程序测量的干扰显示:

在Xcode 7.2中,我如何关闭这些干扰性的调试/应用程式測量显示:

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

最近我一直感到不舒服...

谢谢!

编辑:我已尝试使用-noGMRDebugEnabled标志、重新安装应用程序且不使用-GMRDebugEnabled,重置内容和设置、重启Xcode...但什么也没用 :-(

enter image description here


iOS从Xcode运行应用程序时,会显示一条消息要求启用调试日志记录。 - Larme
1
修改 GMRDebugEnabled 参数不会改变任何东西... - Nahouto
我尝试了GMRDebugDisabled,但似乎没有起作用。我不确定是与我使用的Google SignIn SDK相关还是与新版本的Xcode有关。 当我将GMRDebugEnabled添加到我的scheme中(如xcode建议的https://dev59.com/SpPea4cB1Zd3GeqP9gSc中所示的警告)时,所有这些问题都出现了,但无法禁用。 总之,无论设置GMRDebugDisabled参数还是取消选中GMRDebugEnabled都似乎不起作用。 - Nahouto
GMRDebugDisabled 不起作用。 - Arti
仍然不起作用... :-( - Nahouto
显示剩余3条评论
3个回答

3

在Swift中,要禁用添加到UIApplicationDelegate启动的Google测量功能:

GMRConfiguration.sharedInstance().setIsEnabled(false)

3
最后,我在Google API文档中找到了它。
在GoogleService-Info.plist文件中,您需要添加一个名为IS_MEASUREMENT_ENABLED的键,将其设置为布尔值,并选择NO值。 这将禁用应用程序测量功能并在控制台中显示:
2016-07-03 10:51:38.522 MyApp[313:] <GMR/INFO> App measurement disabled

感谢你们提供的所有答案!

1
这将禁用整个库,而不是调试日志记录。 - Guilherme Puglia
Google Measurement(GMR)。请注意,自从Google Cocoapod版本3.0.3(https://github.com/CocoaPods/Specs/blob/master/Specs/Google/3.0.3/Google.podspec.json)以来,Google测量已被Firebase Analytics取代。 - Guilherme Puglia
谢谢,我确实不打算安装Google测量,只需要Google登录... - Nahouto

0

要移除调试模式,您可以使用以下调用删除UserDefault条目(只需运行一次):

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


1
这三个都不起作用。请查看我编辑过的问题。 - Nahouto
奇怪,noGMRDebugEnabled 对我有效。调试状态记录在NSUserDefaults中,请确保您清除了standardUserDefaults并在此之后不使用GMRDebugEnabled运行应用程序。 - Guilherme Puglia
你能否再确认一下,你是否正在更改适用于正确的XCode目标的命令行?它应该在你所截图窗口的右上方列中。 - Guilherme Puglia
我三次检查了目标,很抱歉但它不起作用。我将尝试通过创建一个新项目来进一步调查... - Nahouto
如果Guilherme的答案对任何人有用,请留下评论! - Nahouto

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接