Skip to content

Commit fe5760d

Browse files
dadachiclaude
andcommitted
Clarify Wi-Fi IP wording in setup docs
Rails auto-detects the host's Wi-Fi IP for dev; the Android app must target that same address. Reference `ipconfig getifaddr en0` and spell out what not to use (127.0.0.1, localhost, 0.0.0.0). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 0704fcb commit fe5760d

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,18 +121,19 @@ To run this app successfully, ensure you have:
121121

122122
## Running with the NativeAppTemplate-API on localhost
123123

124-
By default the debug build hits the hosted API (`https://api.nativeapptemplate.com`). To point it at a Rails server running on your LAN, add the following to `~/.gradle/gradle.properties` (here `~` is your user home directory — `/Users/<you>` on macOS, `/home/<you>` on Linux, `C:\Users\<you>` on Windows; create the file if it doesn't exist):
124+
By default the debug build hits the hosted API (`https://api.nativeapptemplate.com`). To point it at a Rails server running on your Wi-Fi, add the following to `~/.gradle/gradle.properties` (here `~` is your user home directory — `/Users/<you>` on macOS, `/home/<you>` on Linux, `C:\Users\<you>` on Windows; create the file if it doesn't exist):
125125

126126
```
127-
# Use your LAN IP, or 10.0.2.2 for emulator → host
127+
# Use your current Wi-Fi IP (macOS: `ipconfig getifaddr en0`), or 10.0.2.2 for emulator → host.
128+
# Never use 127.0.0.1, localhost, or 0.0.0.0 — Rails and this app must agree on one reachable address.
128129
NATEMPLATE_API_DOMAIN=192.168.1.6
129130
NATEMPLATE_API_PORT=3000
130131
NATEMPLATE_API_SCHEME=http
131132
```
132133

133134
Then `./gradlew assembleDebug` — or Build → Rebuild Project from Android Studio. The debug `buildConfigField` entries in `app/build.gradle.kts` read these via `project.findProperty(...)`, so the same config works from both the terminal and the IDE. Remove the three properties to fall back to the hosted default. For a one-off override: `./gradlew -PNATEMPLATE_API_DOMAIN=192.168.1.6 -PNATEMPLATE_API_PORT=3000 -PNATEMPLATE_API_SCHEME=http assembleDebug`.
134135

135-
Cleartext HTTP to LAN IPs is already permitted in debug via `app/src/debug/res/xml/network_security_config.xml`; the release config (in `app/src/main/`) keeps `api.nativeapptemplate.com` HTTPS-only.
136+
Cleartext HTTP to private IPs is already permitted in debug via `app/src/debug/res/xml/network_security_config.xml`; the release config (in `app/src/main/`) keeps `api.nativeapptemplate.com` HTTPS-only.
136137

137138
## Blog
138139

0 commit comments

Comments
 (0)