我花了很长时间来计算如何在Mac上设置adb,所以我想写一下如何设置它可能对某些人有用.adb是在手机/模拟器上安装和运行Android应用程序的命令行工具
在我工作的地方,我们使用Google Apps for Work.在过去9个月中,我们一直在使用Gmail API(每天约2,000个请求)为我们的支持电子邮件帐户提取新电子邮件.
这就是我们最初的设置方式:
我们为每个支持电子邮件帐户执行此操作,以避免在管理控制台中为其中任何一个启用域范围委派.然后,我们可以使用官方支持的npm
库对令牌进行身份验证googleapis
,类似于:
var google = require('googleapis');
var jwtClient = new google.auth.JWT(
token.client_email,
null,
token.private_key,
['https://www.googleapis.com/auth/gmail.readonly'],
'supportemail@mycompany.com'
);
jwtClient.authorize(function(err, tokens) {
if (err) {
return cb(err);
}
var gmail = google.gmail('v1');
var requestOptions = {
auth: jwtClient,
userId: 'me',
id: messageId,
format: 'raw'
};
gmail.users.messages.get(requestOptions, function(err, response) {
if (err) {
return cb(err);
}
// do stuff with the response
}); …
Run Code Online (Sandbox Code Playgroud) google-api jwt service-accounts google-api-nodejs-client gmail-api