Skip to content

Commit 3f372f8

Browse files
authored
Add documentation for iOS web server (#70)
1 parent 16245f3 commit 3f372f8

File tree

4 files changed

+102
-54
lines changed

4 files changed

+102
-54
lines changed

assets/Misc_iOS_webserver-steps.png

550 KB
Loading

assets/Misc_iOS_webserver-ui1.png

53.3 KB
Loading

assets/Misc_iOS_webserver-ui2.png

142 KB
Loading

misc/ios.md

Lines changed: 102 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,102 @@
1-
---
2-
title: iOS Development Setup
3-
---
4-
5-
# iOS Development Setup
6-
7-
Something something preamble
8-
9-
You will have to edit your `CMakeLists.txt` on your exiting mods. Newer created mods will already have this change
10-
```cmake
11-
# At the beginning of your CMakeLists.txt, change this:
12-
# set(CMAKE_OSX_ARCHITECTURES "arm64;x86_64")
13-
# into:
14-
if ("${CMAKE_SYSTEM_NAME}" STREQUAL "iOS" OR IOS)
15-
set(CMAKE_OSX_ARCHITECTURES "arm64")
16-
else()
17-
set(CMAKE_OSX_ARCHITECTURES "arm64;x86_64")
18-
endif()
19-
```
20-
21-
## Build
22-
23-
To build mods for iOS, you must have Mac OS with the iPhone SDK installed from Xcode.
24-
25-
You must also get the Geode binaries for iOS, you can do this using the CLI:
26-
```bash
27-
geode sdk update nightly
28-
geode sdk install-binaries --platform ios
29-
```
30-
31-
Nightly is required, as iOS is currently not on the stable release for Geode.
32-
33-
Now you can build your mod for iOS via:
34-
```bash
35-
geode build -p ios
36-
```
37-
Or if you want to build manually:
38-
```bash
39-
cmake -B build -DCMAKE_SYSTEM_NAME=iOS -DGEODE_TARGET_PLATFORM=iOS -DCMAKE_BUILD_TYPE=RelWithDebInfo -G Ninja
40-
cmake --build build
41-
```
42-
43-
## Github Actions
44-
To build your mod for iOS using `geode-sdk/build-geode-mod`, you have to add iOS to the build matrix, like so:
45-
```yml
46-
- name: iOS
47-
os: macos-latest
48-
target: iOS
49-
```
50-
51-
As of writing this, iOS support is only available on nightly Geode, so make sure to add this to the options of the `build-geode-mod` step
52-
```yml
53-
sdk: nightly
54-
```
1+
---
2+
title: iOS Development Setup
3+
---
4+
5+
# iOS Development Setup
6+
7+
Something something preamble
8+
9+
You will have to edit your `CMakeLists.txt` on your exiting mods. Newer created mods will already have this change
10+
```cmake
11+
# At the beginning of your CMakeLists.txt, change this:
12+
# set(CMAKE_OSX_ARCHITECTURES "arm64;x86_64")
13+
# into:
14+
if ("${CMAKE_SYSTEM_NAME}" STREQUAL "iOS" OR IOS)
15+
set(CMAKE_OSX_ARCHITECTURES "arm64")
16+
else()
17+
set(CMAKE_OSX_ARCHITECTURES "arm64;x86_64")
18+
endif()
19+
```
20+
21+
## Build
22+
23+
To build mods for iOS, you must have Mac OS with the iPhone SDK installed from Xcode.
24+
25+
You must also get the Geode binaries for iOS, you can do this using the CLI:
26+
```bash
27+
geode sdk update nightly
28+
geode sdk install-binaries --platform ios
29+
```
30+
31+
Nightly is required, as iOS is currently not on the stable release for Geode.
32+
33+
Now you can build your mod for iOS via:
34+
```bash
35+
geode build -p ios
36+
```
37+
Or if you want to build manually:
38+
```bash
39+
cmake -B build -DCMAKE_SYSTEM_NAME=iOS -DGEODE_TARGET_PLATFORM=iOS -DCMAKE_BUILD_TYPE=RelWithDebInfo
40+
cmake --build build
41+
```
42+
43+
## Github Actions
44+
To build your mod for iOS using `geode-sdk/build-geode-mod`, you have to add iOS to the build matrix, like so:
45+
```yml
46+
- name: iOS
47+
os: macos-latest
48+
target: iOS
49+
```
50+
51+
As of writing this, iOS support is only available on nightly Geode, so make sure to add this to the options of the `build-geode-mod` step
52+
```yml
53+
sdk: nightly
54+
```
55+
56+
## Web Server
57+
58+
If your iOS device is not jailbroken, it is generally recommended to follow this section to enable the web server.
59+
60+
> :warning: The web server for the TrollStore version of the launcher will not work properly. It is recommended to use `scp` to upload your mods instead.
61+
62+
The web server is a feature bundled into the **Geode Launcher** that allows you to easily upload mods without needing to use iTunes. This eliminates the need to manually drag your geode mod into the mods directory, making the mod testing process more simpler.
63+
64+
To activate the web server:
65+
1. Open the launcher and navigate to settings
66+
2. Scroll down until you reach the **About** section
67+
3. Hold on the **iOS Launcher** text for at least 3 seconds until a popup appears prompting you to enable **Developer Mode**
68+
4. Tap **Yes**, then scroll all the way down to find **Web Server**
69+
5. Enable the setting and restart the launcher
70+
![Image showing the steps above but a visualization of it](/assets/Misc_iOS_webserver-steps.png)
71+
72+
### Using the Web Server
73+
74+
After restarting the launcher, navigate to `http://[Your Device IP]:8080` in your browser on your computer, replacing `[Your Device IP]` with the local IP address of your iOS device.
75+
76+
Now you should see a web interface for the launcher in your browser!
77+
![Image showcasing the web interface on browser](/assets/Misc_iOS_webserver-ui1.png)
78+
79+
Through this web interface, you can:
80+
- Upload your mods
81+
- Launch the game
82+
- View in-game logs if the game has been launched
83+
84+
As an example, this is what the web interface would look like when the game is launched:
85+
![Image showcasing the web interface on browser but with game logs](/assets/Misc_iOS_webserver-ui2.png)
86+
87+
### Other Upload Method
88+
89+
If you prefer not to upload your mods through your browser, you can use a script to upload your mod to your device, and launch the game immediately after you compile and upload your mod:
90+
```bash
91+
# Build commands here...
92+
93+
# Replace the Example ID with your Mod ID, or the path to your compiled geode file. This is assuming the CWD is the project.
94+
GEODE_MOD="./build-ios/my.example-mod.geode"
95+
96+
# Replace the device URL with your device's local IP address
97+
DEVICE_URL="http://192.168.0.25:8080"
98+
curl -X POST -F "file=@${GEODE_MOD}" "${DEVICE_URL}/upload"
99+
100+
# Including this curl request is optional.
101+
curl -X POST "${DEVICE_URL}/launch"
102+
```

0 commit comments

Comments
 (0)