Files
myice-kmp/Makefile
T
herel 9c9716a352 fix(build): Remove existing app before desktop install
cp -R into an existing /Applications/myicek.app nested the new bundle
inside the old one (myicek.app/myicek.app) and failed on the read-only
legal files of the previous install. Delete the previous bundle first.
2026-08-31 16:41:30 +02:00

36 lines
1.3 KiB
Makefile

.PHONY: android desktop desktop-install android-usb android-emulator
ADB := $(shell command -v adb 2>/dev/null || echo "$(HOME)/Library/Android/sdk/platform-tools/adb")
EMULATOR := $(shell command -v emulator 2>/dev/null || echo "$(HOME)/Library/Android/sdk/emulator/emulator")
AVD := $(firstword $(shell $(EMULATOR) -list-avds 2>/dev/null))
APK := composeApp/build/outputs/apk/debug/composeApp-debug.apk
android:
./gradlew composeApp:assembleDebug
desktop:
./gradlew composeApp:run
desktop-install:
./gradlew composeApp:packageDistributionForCurrentOS
rm -rf /Applications/myicek.app
cp -R composeApp/build/compose/binaries/main/app/myicek.app /Applications/myicek.app
android-usb: android
$(ADB) -d install -r $(APK)
$(ADB) -d shell am start -n ch.parano.myicek/.MainActivity
android-emulator: android
@if ! $(ADB) devices | grep -q '^emulator'; then \
echo "Aucun émulateur en cours — lancement de $(AVD)…"; \
$(EMULATOR) -avd $(AVD) -no-snapshot-load >/dev/null 2>&1 & \
echo "En attente du démarrage…"; \
$(ADB) -e wait-for-device; \
while [ "$$($(ADB) -e shell getprop sys.boot_completed 2>/dev/null | tr -d '\r')" != "1" ]; do \
sleep 2; \
done; \
echo "Émulateur prêt."; \
fi
$(ADB) -e install -r $(APK)
$(ADB) -e shell am start -n ch.parano.myicek/.MainActivity