Skip to content

Commit

Permalink
Remove all $(ADB) command in art/Android.mk
Browse files Browse the repository at this point in the history
Since Android builds have become sandboxed and no longer permit the
execution of "adb" commands, all $(ADB) commands are currently
non-functional.
Therefore, any sections of this file that involve "$(ADB)" commands
are essentially dead code and can be safely removed.

Bug: 345380646
Bug: 342327756
Test: N/A
Change-Id: I9987b646d4a952a2ef310b17651a6cb00bbe921d
  • Loading branch information
Nelson Li authored and Treehugger Robot committed Jun 7, 2024
1 parent 91021cd commit 9a79859
Showing 1 changed file with 1 addition and 117 deletions.
118 changes: 1 addition & 117 deletions Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -27,29 +27,14 @@ include $(art_path)/tools/veridex/Android.mk
include $(art_path)/build/Android.common_path.mk

.PHONY: clean-oat
clean-oat: clean-oat-host clean-oat-target
clean-oat: clean-oat-host

.PHONY: clean-oat-host
clean-oat-host:
find $(OUT_DIR) '(' -name '*.oat' -o -name '*.odex' -o -name '*.art' -o -name '*.vdex' ')' -a -type f | xargs rm -f
rm -rf $(TMPDIR)/*/test-*/dalvik-cache/*
rm -rf $(TMPDIR)/android-data/dalvik-cache/*

.PHONY: clean-oat-target
clean-oat-target:
$(ADB) root
$(ADB) wait-for-device remount
$(ADB) shell rm -rf $(ART_TARGET_NATIVETEST_DIR)
$(ADB) shell rm -rf $(ART_TARGET_TEST_DIR)
$(ADB) shell rm -rf $(ART_TARGET_DALVIK_CACHE_DIR)/*/*
$(ADB) shell rm -rf $(ART_DEXPREOPT_BOOT_JAR_DIR)/$(DEX2OAT_TARGET_ARCH)
$(ADB) shell rm -rf system/app/$(DEX2OAT_TARGET_ARCH)
ifdef TARGET_2ND_ARCH
$(ADB) shell rm -rf $(ART_DEXPREOPT_BOOT_JAR_DIR)/$($(TARGET_2ND_ARCH_VAR_PREFIX)DEX2OAT_TARGET_ARCH)
$(ADB) shell rm -rf system/app/$($(TARGET_2ND_ARCH_VAR_PREFIX)DEX2OAT_TARGET_ARCH)
endif
$(ADB) shell rm -rf data/run-test/test-*/dalvik-cache/*

########################################################################
# cpplint rules to style check art source files

Expand Down Expand Up @@ -116,17 +101,6 @@ include $(art_path)/test/Android.run-test.mk

TEST_ART_TARGET_SYNC_DEPS += $(ART_TEST_TARGET_GTEST_DEPENDENCIES) $(ART_TEST_TARGET_RUN_TEST_DEPENDENCIES)

# Make sure /system is writable on the device.
TEST_ART_ADB_ROOT_AND_REMOUNT := \
($(ADB) root && \
$(ADB) wait-for-device remount && \
(($(ADB) shell touch /system/testfile && \
($(ADB) shell rm /system/testfile || true)) || \
($(ADB) disable-verity && \
$(ADB) reboot && \
$(ADB) wait-for-device root && \
$(ADB) wait-for-device remount)))

# "mm test-art" to build and run all tests on host and device
.PHONY: test-art
test-art:
Expand Down Expand Up @@ -636,96 +610,6 @@ build-art-target-run-tests: build-art-target \

build-art-target-tests: build-art-target-gtests build-art-target-run-tests

########################################################################
# targets to switch back and forth from libdvm to libart

.PHONY: use-art
use-art:
$(ADB) root
$(ADB) wait-for-device shell stop
$(ADB) shell setprop persist.sys.dalvik.vm.lib.2 libart.so
$(ADB) shell start

.PHONY: use-artd
use-artd:
$(ADB) root
$(ADB) wait-for-device shell stop
$(ADB) shell setprop persist.sys.dalvik.vm.lib.2 libartd.so
$(ADB) shell start

.PHONY: use-dalvik
use-dalvik:
$(ADB) root
$(ADB) wait-for-device shell stop
$(ADB) shell setprop persist.sys.dalvik.vm.lib.2 libdvm.so
$(ADB) shell start

.PHONY: use-art-full
use-art-full:
$(ADB) root
$(ADB) wait-for-device shell stop
$(ADB) shell rm -rf $(ART_TARGET_DALVIK_CACHE_DIR)/*
$(ADB) shell setprop dalvik.vm.dex2oat-filter \"\"
$(ADB) shell setprop dalvik.vm.image-dex2oat-filter \"\"
$(ADB) shell setprop persist.sys.dalvik.vm.lib.2 libart.so
$(ADB) shell setprop dalvik.vm.usejit false
$(ADB) shell start

.PHONY: use-artd-full
use-artd-full:
$(ADB) root
$(ADB) wait-for-device shell stop
$(ADB) shell rm -rf $(ART_TARGET_DALVIK_CACHE_DIR)/*
$(ADB) shell setprop dalvik.vm.dex2oat-filter \"\"
$(ADB) shell setprop dalvik.vm.image-dex2oat-filter \"\"
$(ADB) shell setprop persist.sys.dalvik.vm.lib.2 libartd.so
$(ADB) shell setprop dalvik.vm.usejit false
$(ADB) shell start

.PHONY: use-art-jit
use-art-jit:
$(ADB) root
$(ADB) wait-for-device shell stop
$(ADB) shell rm -rf $(ART_TARGET_DALVIK_CACHE_DIR)/*
$(ADB) shell setprop dalvik.vm.dex2oat-filter "verify-at-runtime"
$(ADB) shell setprop dalvik.vm.image-dex2oat-filter "verify-at-runtime"
$(ADB) shell setprop persist.sys.dalvik.vm.lib.2 libart.so
$(ADB) shell setprop dalvik.vm.usejit true
$(ADB) shell start

.PHONY: use-art-interpret-only
use-art-interpret-only:
$(ADB) root
$(ADB) wait-for-device shell stop
$(ADB) shell rm -rf $(ART_TARGET_DALVIK_CACHE_DIR)/*
$(ADB) shell setprop dalvik.vm.dex2oat-filter "interpret-only"
$(ADB) shell setprop dalvik.vm.image-dex2oat-filter "interpret-only"
$(ADB) shell setprop persist.sys.dalvik.vm.lib.2 libart.so
$(ADB) shell setprop dalvik.vm.usejit false
$(ADB) shell start

.PHONY: use-artd-interpret-only
use-artd-interpret-only:
$(ADB) root
$(ADB) wait-for-device shell stop
$(ADB) shell rm -rf $(ART_TARGET_DALVIK_CACHE_DIR)/*
$(ADB) shell setprop dalvik.vm.dex2oat-filter "interpret-only"
$(ADB) shell setprop dalvik.vm.image-dex2oat-filter "interpret-only"
$(ADB) shell setprop persist.sys.dalvik.vm.lib.2 libartd.so
$(ADB) shell setprop dalvik.vm.usejit false
$(ADB) shell start

.PHONY: use-art-verify-none
use-art-verify-none:
$(ADB) root
$(ADB) wait-for-device shell stop
$(ADB) shell rm -rf $(ART_TARGET_DALVIK_CACHE_DIR)/*
$(ADB) shell setprop dalvik.vm.dex2oat-filter "verify-none"
$(ADB) shell setprop dalvik.vm.image-dex2oat-filter "verify-none"
$(ADB) shell setprop persist.sys.dalvik.vm.lib.2 libart.so
$(ADB) shell setprop dalvik.vm.usejit false
$(ADB) shell start

########################################################################

# Clear locally used variables.
Expand Down

0 comments on commit 9a79859

Please sign in to comment.