Skip to content

Commit 5a274ec

Browse files
committed
mobile wip
1 parent a64e328 commit 5a274ec

File tree

8 files changed

+416
-36
lines changed

8 files changed

+416
-36
lines changed

README.md

Lines changed: 48 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -175,16 +175,13 @@ docker compose run --rm -w /scalachess --entrypoint="sbt package" lila
175175

176176
```bash
177177
## run formatter
178-
docker run --rm -v $(pwd)/repos/dartchess:/mnt --workdir /mnt dart:3.1.5-sdk \
179-
dart format .
178+
docker compose run --rm -w /dartchess mobile dart format .
180179
181180
## analyze
182-
docker run --rm -v $(pwd)/repos/dartchess:/mnt --workdir /mnt dart:3.1.5-sdk \
183-
bash -c "dart pub get && dart analyze"
181+
docker compose run --rm -w /dartchess mobile bash -c "dart pub get && dart analyze"
184182
185183
## run tests
186-
docker run --rm -v $(pwd)/repos/dartchess:/mnt --workdir /mnt dart:3.1.5-sdk \
187-
bash -c "dart pub get && dart test -x full_perft"
184+
docker compose run --rm -w /dartchess mobile bash -c "dart pub get && dart test -x full_perft"
188185
```
189186

190187
### bbpPairings:
@@ -233,3 +230,48 @@ docker compose run --rm ui bash -c "cd /pgn-viewer && pnpm run sass-dev && pnpm
233230
```
234231

235232
See the changes on the PGN Viewer demo page: http://localhost:8091/
233+
234+
### Mobile
235+
236+
1. On your host machine:
237+
1. Have the lila-docker services running, with the `Mobile` optional service started
238+
2. Configure lila to run with your host's IP address or hostname instead of localhost
239+
```bash
240+
./lila-docker hostname
241+
```
242+
3. Configure the mobile settings
243+
```bash
244+
./lila-docker mobile
245+
```
246+
4. Enter the IP address, port, and pairing code from the steps below
247+
2. On your Android phone:
248+
1. Connect your phone to the same wifi network as your host machine
249+
2. Ensure your phone and can access lila in your browser app using the host value you set above
250+
```
251+
http://[your-selection]:8080
252+
```
253+
3. Enable Developer Mode
254+
4. In Developer Options
255+
1. enable wireless debugging
256+
2. Tap into the wireless debugging settings
257+
1. Use the "IP address & Port" value in the prompt on your host
258+
2. Tap "Pair device with pairing code"
259+
1. Enter the pairing port and code in the prompt on your host
260+
3. On your host machine:
261+
1. Get a shell on the container:
262+
```bash
263+
docker compose exec -it mobile bash
264+
265+
# see your phone
266+
adb devices
267+
```
268+
2. Install the app dependencies:
269+
```bash
270+
flutter pub get
271+
dart run build_runner build
272+
```
273+
3. Run the app:
274+
```bash
275+
flutter run -v --dart-define=LICHESS_HOST=$LICHESS_URL --dart-define=LICHESS_WS_HOST=$LICHESS_URL
276+
```
277+
- No substitutions necessary. The `$LICHESS_URL` environment variable will already be set on the container.

command/Cargo.lock

Lines changed: 110 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

command/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@ edition = "2021"
88
[dependencies]
99
cliclack = "0.1.6"
1010
colored = "2.0.4"
11+
local-ip-address = "0.5.6"

0 commit comments

Comments
 (0)