Different results for two methods of performing CRAN checks

I am finishing the works on my package and I am preparing it to be uploaded to CRAN. For this to be possible, the package must pass CRAN checks. I know two ways of doing it

  1. using devtools: either from within RStudio after adding --as-cran flag in the options or by running in the terminal the following command:
devtools::check(args = c('--as-cran'))
  1. Directly from terminal bu running the command:
R CMD check --as-cran

those two methods produce different results for me. While using devtools to do checks, I get 0 errors, 0 warnings and 0 notes. Running checks using R CMD check produces test failure very early stating that I don't have the Maintainer field in the DESCRIPTION file.

Why do those two ways of running CRAN checks give me different resulsts? The screenshot attached below implies that devtools run R CMD check under the hood.
image

Do you use R CMD build followed by R CMD check --as-cran <tar.gz-file>?

If you are running R CMD check from the command line you have to build the package first, e.g. something like

R CMD build . && R CMD check --as-cran *tar.gz

Note there still could be differences, as by default devtools sets a couple of environment variables to disable the remote checks, you can use devtools::check(remote = TRUE) to enable these checks as well.