Skip to content

Commit 64fb344

Browse files
authored
chore: add support for remote devices with re-frisk server (#21805)
This changes adds support for connecting remotely to re-frisk when running the app on a mobile device. This change is essentially aimed towards better support for introspecting on iOS devices, but these changes should also work for Android devices too. Note, that running in the Android simulator may still require port-forwarding with `adb reverse`.
1 parent f27b402 commit 64fb344

File tree

4 files changed

+13
-3
lines changed

4 files changed

+13
-3
lines changed

Diff for: Makefile

+4-2
Original file line numberDiff line numberDiff line change
@@ -267,9 +267,11 @@ run-metro: export TARGET := clojure
267267
run-metro: ##@run Start Metro to build React Native changes
268268
@scripts/run-metro.sh
269269

270+
export RE_FRISK_PORT ?= 4567
271+
270272
run-re-frisk: export TARGET := clojure
271273
run-re-frisk: ##@run Start re-frisk server
272-
yarn shadow-cljs run re-frisk-remote.core/start
274+
yarn shadow-cljs run re-frisk-remote.core/start ${RE_FRISK_PORT}
273275

274276
# TODO: Migrate this to a Nix recipe, much the same way as nix/mobile/android/targets/release-android.nix
275277
run-android: export TARGET := android
@@ -443,7 +445,7 @@ android-ports: export RCT_METRO_PORT ?= 8081
443445
android-ports: ##@other Add proxies to Android Device/Simulator
444446
adb reverse tcp:$(RCT_METRO_PORT) tcp:$(RCT_METRO_PORT) && \
445447
adb reverse tcp:3449 tcp:3449 && \
446-
adb reverse tcp:4567 tcp:4567 && \
448+
adb reverse tcp:$(RE_FRISK_PORT) tcp:$(RE_FRISK_PORT) && \
447449
adb reverse tcp:$(FLOWSTORM_PORT) tcp:$(FLOWSTORM_PORT) && \
448450
adb forward tcp:5561 tcp:5561
449451

Diff for: shadow-cljs.edn

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
:preloads [;; The official recommendation is to
5959
;; load the debugger preload first.
6060
flow-storm.api
61-
re-frisk-remote.preload
61+
dev.re-frisk-preload
6262
status-im.setup.schema-preload
6363
;; In order to use component test helpers in the REPL we need to
6464
;; preload namespaces that are not normally required by

Diff for: src/dev/re_frisk_preload.cljs

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
(ns dev.re-frisk-preload
2+
(:require [re-frisk-remote.core :as re-frisk-remote]
3+
[status-im.config]))
4+
5+
(re-frisk-remote/enable {:host (str status-im.config/re-frisk-host ":" status-im.config/re-frisk-port)})

Diff for: src/status_im/config.cljs

+3
Original file line numberDiff line numberDiff line change
@@ -124,3 +124,6 @@
124124
(goog-define STATUS_BACKEND_SERVER_ROOT_DATA_DIR "")
125125
;; if you're using android simulator, I suggest set the env variable to "http://10.0.2.2:"
126126
(goog-define STATUS_BACKEND_SERVER_IMAGE_SERVER_URI_PREFIX "https://localhost:")
127+
128+
(def re-frisk-host (get-config :RE_FRISK_HOST "http://localhost"))
129+
(def re-frisk-port (get-config :RE_FRISK_PORT "4567"))

0 commit comments

Comments
 (0)