Skip to content

Commit

Permalink
Added logs sumbcommand to edit PrincessLog config remotely (#10)
Browse files Browse the repository at this point in the history
* Added logs sumbcommand to edit PrincessLog config remotely

* Updated README
  • Loading branch information
nikarh authored Nov 6, 2023
1 parent 30a86cf commit f93792a
Show file tree
Hide file tree
Showing 4 changed files with 298 additions and 27 deletions.
69 changes: 62 additions & 7 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 1 addition & 11 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,4 @@ suppaftp = { version = "5.2.1" }
tee = "0.1.0"
tempfile = "3.8.0"
walkdir = "2.4.0"

[package.metadata.vita]
title_id = "VITASHELL"
title_name = "Test app"
assets = "static"
# You can choose a subset of std or use panic_abort if you don't need unwinding
build_std = "std,panic_unwind"
# You can provide a custom JSON file spec
vita_strip_flags = ["-g"]
vita_make_fself_flags = ["-s"]
vita_mksfoex_flags = ["-d", "ATTRIBUTE2=12"]
local-ip-address = "0.5.6"
68 changes: 66 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

Cargo command to work with Sony PlayStation Vita rust project binaries.

For general guidelines see [vita-rust book](https://vita-rust.github.io/book)
For general guidelines see [vita-rust book](https://vita-rust.github.io/book).

## Requirements

Expand Down Expand Up @@ -84,7 +84,7 @@ vita_mksfoex_flags = ["-d", "ATTRIBUTE2=12"]

## Examples

```
```sh
# Build all current/all workspace projects in release mode as vpk
cargo vita build vpk -- --release

Expand All @@ -101,6 +101,70 @@ cargo vita build eboot --update --run -- --release
cargo vita logs
```

## Additional tools

For a better development experience it is recommended to install additional modules on your Vita.

### vitacompanion

When enabled, this module keeps a FTP server on your Vita running on port `1337`, as well as a TCP command server running on port `1338`.

- The FTP server allows you to easily upload `vpk` and `eboot` files to your Vita. This is FTP server is used by `cargo-vita` for the following commands and flags:

```sh
# Builds a eboot.bin, and uploads it to ux0:/app/TITLEID/eboot.bin
cargo vita build eboot --update

# Builds a vpk, and uploads it to ux0:/download/project_name.vpk
cargo vita build vpk --upload

# Recursively upload ~/test to ux0:/download
cargo vita upload -s ~/test -d ux0:/download/
```

- The command server allows you to kill and launch applications and reboot your Vita:

```sh
# Reboot your Vita
cargo vita reboot

# After uploading the eboot.bin this command will kill the current app,
# and launch your TITLEID
cargo vita build eboot --update --run
```

### PrincessLog

This module allows capturing stdout and stderr from your Vita.
In order to capture the logs you need to start a TCP server on your computer, and configure
PrincessLog to connect to it.

For convenience `cargo-vita` provides two commands to work with logs:

- A command to start a TCP server Vita will connect to:

```sh
# Start a TCP server on 0.0.0.0, and print all bytes received via the socket to stdout
cargo vita logs
```
- A command to reconfigure PrincessLog with the new ip/port. This will use
the FTP server provided by `vitacompanion` to upload a new config.
If an IP address of your machine is not explicitly provided, it will be guessed
using [local-ip-address](https://crates.io/crates/local-ip-address) crate.
When a configuration file is updated, the changes are not applied until Vita is rebooted.

```sh
# Generate and upload a new config for PrincessLog to your Vita.
# Will guess a local IP address of the machine where this command is executed.
# After reconfiguration reboots the Vita.
cargo vita logs configure && cargo vita reboot
# Explicitly sets the IP address Vita will connect to.
# Also enables kernel debug messages in the log.
cargo vita logs configure --host-ip-address 10.10.10.10 --kernel-debug
```

## License

Except where noted (below and/or in individual files), all code in this repository is dual-licensed at your option under either:
Expand Down
Loading

0 comments on commit f93792a

Please sign in to comment.