FastLane could not recognize adb on windows 10

466 views Asked by At

I'm trying to use fastlane for andrid app and I have this problem in this fastlane command for screengrab:

bundle exec fastlane screengrab

and Im getting this error while using screengrab:

[13:42:12]: The adb command could not be found relative to your provided ANDROID_HOME at C:/Users/Ramin/AppData/Local/Android/ Sdk [13:42:12]: Please ensure that the Android SDK is installed and the platform-tools directory is present

[!] adb command not found

I have seen the same question before. But the problem remains open. Is there any update?

2

There are 2 answers

1
Philipp Fahlteich On

You have to add adb to your path, i.e. via the environment variables on Windows. Then restart the command line and try again.

0
ramin On

This problem exists with Windows and Linux (issue), and the solution is to change the library.

I did this with the library and its work!!

dir: fastlane/screengrab/lib/screengrab/android_environment.rb

orginal:

def find_adb(platform_tools_path) 
   return FastlaneCore::CommandExecutor.which('adb') unless platform_tools_path 
  
   adb_path = File.join(platform_tools_path, 'adb') 
   return executable_command?(adb_path) ? adb_path : nil 
 end 

modified:

 def find_adb(platform_tools_path) 
   return 'adb'
 end