Skip to content

Commit b2f1772

Browse files
authored
feat(cli): use devicetl to connect with iOS 17 devices (#7971)
1 parent 1c9f3db commit b2f1772

File tree

11 files changed

+91
-45
lines changed

11 files changed

+91
-45
lines changed

.changes/devicectl.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"tauri-cli": patch:feat
3+
"@tauri-apps/cli": patch:feat
4+
---
5+
6+
Use `devicectl` to connect to iOS 17+ devices on macOS 14+.

.github/workflows/test-core.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ jobs:
105105
cargo update -p toml@0.7.8 --precise 0.7.6
106106
cargo update -p toml_edit@0.19.15 --precise 0.19.14
107107
cargo update -p cfg-expr@0.15.5 --precise 0.15.4
108+
cargo update -p system-deps --precise 6.1.1
108109
109110
- name: test
110111
uses: actions-rs/cargo@v1

core/tauri-runtime/src/window.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -319,10 +319,9 @@ impl<T: UserEvent, R: Runtime<T>> PendingWindow<T, R> {
319319
protocol: H,
320320
) {
321321
let uri_scheme = uri_scheme.into();
322-
self.uri_scheme_protocols.insert(
323-
uri_scheme,
324-
Box::new(move |data, responder| (protocol)(data, responder)),
325-
);
322+
self
323+
.uri_scheme_protocols
324+
.insert(uri_scheme, Box::new(protocol));
326325
}
327326

328327
#[cfg(target_os = "android")]

core/tauri/src/manager.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ fn replace_csp_nonce(
203203
.into_iter()
204204
.map(|n| format!("'nonce-{n}'"))
205205
.collect::<Vec<String>>();
206-
let sources = csp.entry(directive.into()).or_insert_with(Default::default);
206+
let sources = csp.entry(directive.into()).or_default();
207207
let self_source = "'self'".to_string();
208208
if !sources.contains(&self_source) {
209209
sources.push(self_source);

core/tauri/src/window.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2247,7 +2247,7 @@ impl<R: Runtime> Window<R> {
22472247
window_label,
22482248
event,
22492249
})
2250-
.or_insert_with(Default::default)
2250+
.or_default()
22512251
.insert(event_id);
22522252

22532253
Ok(event_id)

tooling/bundler/src/bundle/common.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -164,9 +164,8 @@ impl CommandExt for Command {
164164
let mut lines = stdout_lines_.lock().unwrap();
165165
loop {
166166
buf.clear();
167-
match tauri_utils::io::read_line(&mut stdout, &mut buf) {
168-
Ok(s) if s == 0 => break,
169-
_ => (),
167+
if let Ok(0) = tauri_utils::io::read_line(&mut stdout, &mut buf) {
168+
break;
170169
}
171170
debug!(action = "stdout"; "{}", String::from_utf8_lossy(&buf));
172171
lines.extend(buf.clone());
@@ -182,9 +181,8 @@ impl CommandExt for Command {
182181
let mut lines = stderr_lines_.lock().unwrap();
183182
loop {
184183
buf.clear();
185-
match tauri_utils::io::read_line(&mut stderr, &mut buf) {
186-
Ok(s) if s == 0 => break,
187-
_ => (),
184+
if let Ok(0) = tauri_utils::io::read_line(&mut stderr, &mut buf) {
185+
break;
188186
}
189187
debug!(action = "stderr"; "{}", String::from_utf8_lossy(&buf));
190188
lines.extend(buf.clone());

tooling/cli/Cargo.lock

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

tooling/cli/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ name = "cargo-tauri"
3939
path = "src/main.rs"
4040

4141
[dependencies]
42-
cargo-mobile2 = { version = "0.6", default-features = false }
42+
cargo-mobile2 = { version = "0.7", default-features = false }
4343
textwrap = { version = "0.11.0", features = [ "term_size" ] }
4444
jsonrpsee = { version = "0.16", features = [ "server" ] }
4545
jsonrpsee-core = "0.16"

tooling/cli/src/interface/rust/desktop.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -247,9 +247,8 @@ fn build_dev_app<F: FnOnce(Option<i32>, ExitReason) + Send + 'static>(
247247
let mut io_stderr = std::io::stderr();
248248
loop {
249249
buf.clear();
250-
match tauri_utils::io::read_line(&mut stderr, &mut buf) {
251-
Ok(s) if s == 0 => break,
252-
_ => (),
250+
if let Ok(0) = tauri_utils::io::read_line(&mut stderr, &mut buf) {
251+
break;
253252
}
254253
let _ = io_stderr.write_all(&buf);
255254
if !buf.ends_with(&[b'\r']) {

tooling/cli/src/lib.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -277,9 +277,8 @@ impl CommandExt for Command {
277277
let mut lines = stdout_lines_.lock().unwrap();
278278
loop {
279279
buf.clear();
280-
match tauri_utils::io::read_line(&mut stdout, &mut buf) {
281-
Ok(s) if s == 0 => break,
282-
_ => (),
280+
if let Ok(0) = tauri_utils::io::read_line(&mut stdout, &mut buf) {
281+
break;
283282
}
284283
debug!(action = "stdout"; "{}", String::from_utf8_lossy(&buf));
285284
lines.extend(buf.clone());
@@ -295,9 +294,8 @@ impl CommandExt for Command {
295294
let mut lines = stderr_lines_.lock().unwrap();
296295
loop {
297296
buf.clear();
298-
match tauri_utils::io::read_line(&mut stderr, &mut buf) {
299-
Ok(s) if s == 0 => break,
300-
_ => (),
297+
if let Ok(0) = tauri_utils::io::read_line(&mut stderr, &mut buf) {
298+
break;
301299
}
302300
debug!(action = "stderr"; "{}", String::from_utf8_lossy(&buf));
303301
lines.extend(buf.clone());

0 commit comments

Comments
 (0)