我是否需要先请求一个真实的广告以从 logcat 获取设备 ID,以便我可以添加测试设备?

Do i need to first request a real Ad to get the Device ID from the logcat so i can add a testdevice?

文档中说您应该以这种方式添加测试设备。

但是要从 logcat 获取此 ID,我必须先请求一个真实的广告吗?请求真实广告不是违反他们自己的政策吗?

Add your test device

Load your ads-integrated app and make an ad request. Check the logcat output for a message that looks like the one below, which shows you your device ID and how to add it as a test device:

I/Ads: Use AdRequest.Builder.addTestDevice("33BE2250B43518CCDA7DE426D04EE231") to get test ads on this device."

有 a) 可以使用的测试广告单元和 b) 它知道何时 运行 处于调试模式。

此消息可能会在显示任何广告单元之前显示在日志中,但会在实例化客户端时显示。