Skip to content

Commit 31a6edb

Browse files
committed
mobile wip
1 parent a64e328 commit 31a6edb

File tree

8 files changed

+337
-39
lines changed

8 files changed

+337
-39
lines changed

README.md

Lines changed: 62 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,62 @@ 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+
#### On your Android phone:
237+
238+
1. Connect your phone on the same wifi network as your host machine
239+
2. Make sure your phone is in developer mode
240+
3. Enable wireless debugging
241+
4.
242+
243+
#### On your host machine:
244+
245+
1. Configure lila to run with your host's IP address or hostname instead of localhost
246+
```bash
247+
./lila-docker hostname
248+
```
249+
2. Ensure phone and can access lila using that host
250+
```
251+
http://[your private IP]:8080 # instead of http://localhost:8080
252+
```
253+
3. Run:
254+
```bash
255+
adb kill-server
256+
adb tcpip 5555
257+
```
258+
4. You should see the phone in the devices list:
259+
```bash
260+
adb devices
261+
```
262+
263+
#### On the container:
264+
265+
1. Get a shell on the container:
266+
267+
```bash
268+
docker compose exec -it mobile bash
269+
```
270+
271+
2. Connect to your phone:
272+
273+
```bash
274+
# get the ip address from your phone's wifi settings
275+
adb connect 192.168.1.xxx
276+
# you should see the phone in the devices list
277+
adb devices
278+
```
279+
280+
3. Install the app dependencies:
281+
282+
```bash
283+
flutter pub get
284+
dart run build_runner build
285+
```
286+
287+
4. Run the app:
288+
```bash
289+
flutter run --dart-define=LICHESS_HOST=$LICHESS_URL --dart-define=LICHESS_WS_HOST=$LICHESS_URL
290+
```
291+
- 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)