question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Use adb in path by default

See original GitHub issue

Describe the bug adb must be passed to bundletool, is it possible that it could use the adb executable in my path.

Bundletool version(s) affected Version: 0.6.0

Stacktrace [BT:0.6.0] Error: Unable to determine the location of ADB. Please set the --adb flag or define ANDROID_HOME environment variable.

To Reproduce Use bundletool without providing an adb

Expected behavior It would default to the adb on my path

Environment: OS: Linux

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
AdamSHurwitzcommented, Oct 7, 2018

Is there a simpler way to resolve this ANDROID_HOME path error?

For instance, I’m attempting to use Android’s bundletool but am receiving the error:

Unable to determine the location of ADB. Please set the --adb flag or define ANDROID_HOME environment variable.

Attempted Command

bundletool-all-0.6.0.jar build-apks --bundle=/path/app.aab --output=/path/app.apks --ks=/path/coinverse-release.jks --ks-pass=file:/path/keyname.pwd --ks-key-alias="appname-release" --key-pass=file:/path/keystores/key.pwd --connected-device

Current Solution By defining the ANDROID_HOME path in my .bash_profile for my Macbook Pro resolved the issue as described in this Stackoverflow post.

  1. cd ~
  2. ls -a (look to make sure .bash_profile is in the folder you are in)
  3. vi .bash_profile
  4. Add the following lines: export ANDROID_HOME={androidSdkPath} (ie: /Users/adamhurwitz/Library/Android/sdk/) export PATH=$PATH:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools

Note: When attempting to use –adb in the path it does not work with the following error.

com.android.tools.build.bundletool.exceptions.CommandExecutionException: Failed to start ADB server.
        at com.android.tools.build.bundletool.device.DdmlibAdbServer.init(DdmlibAdbServer.java:81)
        at com.android.tools.build.bundletool.commands.BuildApksManager.getDeviceSpec(BuildApksManager.java:226)
        at com.android.tools.build.bundletool.commands.BuildApksManager.execute(BuildApksManager.java:91)
        at com.android.tools.build.bundletool.io.TempFiles.withTempDirectoryReturning(TempFiles.java:52)
        at com.android.tools.build.bundletool.commands.BuildApksCommand.execute(BuildApksCommand.java:379)
        at com.android.tools.build.bundletool.BundleToolMain.main(BundleToolMain.java:73)
        at com.android.tools.build.bundletool.BundleToolMain.main(BundleToolMain.java:44)
1reaction
plecesnecommented, Sep 19, 2018

Could you set the environment variable ANDROID_HOME with the path to the SDK? Then, bundletool would be able to find adb in it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Where is adb.exe in windows 10 located? - Stack Overflow
You'll find it in the AppData folder if you choose to install it in the default location. Otherwise, it will be located at...
Read more >
How to Use ADB or Fastboot From Any Directory on your ...
Simply copy your adb.exe, fastboot.exe, AdbWinApi.dll and AdbWinUsbApi.dll to C:\Windows and you're good to go. You should be able to run adb ......
Read more >
The Easiest Way to Install Android's ADB and Fastboot Tools ...
By default, you'll either have to navigate to the folder where you extracted the Platform Tools package and run any ADB or fastboot...
Read more >
Android Debug Bridge (adb) - Android Developers
To use adb with a device connected over USB, you must enable USB debugging in the device system settings, under Developer options. On...
Read more >
Help, adb is not found!. So you've downloaded Android Studio ...
adb stands for the “Android Debug Bridge,” which is a command line utility that is the debug multitool for Android. Typically it's installed...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found