Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,7 @@ jobs:
coveralls --service=github

build-and-test-mac-gui:
# macos-13 is the latest runner (as of time of writing) that does not cause a
# _tkinter import error during the build.
runs-on: macos-13
runs-on: macos-15
env:
# We need the official Python, because the GA ones only support newer macOS versions
# The deployment target is picked up by the Python build tools automatically
Expand All @@ -139,7 +137,7 @@ jobs:
# See: https://github.com/actions/virtual-environments/issues/1256#issuecomment-770270252
run: |
sudo installer -pkg python.pkg -target /
python3 -m venv env
python3.12 -m venv env
source env/bin/activate
which python
python --version
Expand Down
6 changes: 2 additions & 4 deletions .github/workflows/deploy-gui.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,7 @@ jobs:
asset_content_type: application/gzip

build-and-publish-mac-gui:
# macos-13 is the latest runner (as of time of writing) that does not cause a
# _tkinter import error during the build.
runs-on: macos-13
runs-on: macos-15
env:
# We need the official Python, because the GA ones only support newer macOS versions
# The deployment target is picked up by the Python build tools automatically
Expand All @@ -65,7 +63,7 @@ jobs:
# See: https://github.com/actions/virtual-environments/issues/1256#issuecomment-770270252
run: |
sudo installer -pkg python.pkg -target /
python3 -m venv env
python3.12 -m venv env
source env/bin/activate
which python
python --version
Expand Down
34 changes: 31 additions & 3 deletions mozregression/launchers.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import mozinstall
import mozversion
from mozdevice import ADBDeviceFactory, ADBError, ADBHost
from mozfile import remove
from mozfile import remove, which
from mozlog.structured import get_default_logger, get_proxy_logger
from mozprofile import Profile, ThunderbirdProfile
from mozrunner import Runner
Expand Down Expand Up @@ -427,6 +427,34 @@ def _install(self, dest):
self._codesign_sign(self.appdir)


def adb_tool_path():
"""
If adb is not found on the path, try to locate a version installed by
`mach bootstrap` as part of a Firefox build.
"""
adb_in_path = which("adb")
if adb_in_path:
return adb_in_path

platform_suffix = {"mac": "macosx", "win": "windows", "linux": "linux"}.get(mozinfo.os)
if platform_suffix:
adb_name = "adb.exe" if mozinfo.os == "win" else "adb"
mozbuild_adb = os.path.expanduser(
os.path.join(
"~",
".mozbuild",
f"android-sdk-{platform_suffix}",
"platform-tools",
adb_name,
)
)
if os.path.exists(mozbuild_adb):
return mozbuild_adb

# Let mozdevice raise a helpful error if adb still cannot be found.
return "adb"


class AndroidLauncher(Launcher):
app_info = None
adb = None
Expand All @@ -445,7 +473,7 @@ def _launch(self):
@classmethod
def check_is_runnable(cls):
try:
devices = ADBHost().devices()
devices = ADBHost(adb=adb_tool_path()).devices()
except ADBError as adb_error:
raise LauncherNotRunnable(str(adb_error))
if not devices:
Expand All @@ -457,7 +485,7 @@ def _install(self, dest):
# get info now, as dest may be removed
self.app_info = safe_get_version(binary=dest)
self.package_name = self.app_info.get("package_name", self._get_package_name())
self.adb = ADBDeviceFactory()
self.adb = ADBDeviceFactory(adb=adb_tool_path())
try:
self.adb.uninstall_app(self.package_name)
except ADBError as msg:
Expand Down