eadb
eadb copied to clipboard
windows下用rust编译eadb报error[E0425]
$ cargo build
Compiling eadb v0.1.5 (E:\eadb)
error[E0425]: cannot find function getuid
in crate libc
--> src\build_image.rs:68:30
|
68 | let uid = unsafe { libc::getuid() };
| ^^^^^^ help: a function with a similar name exists: getpid
|
::: C:\Users.cargo\registry\src\mirrors.ustc.edu.cn-12df342d903acd47\libc-0.2.126\src\windows\mod.rs:474:5
|
474 | pub fn getpid() -> ::c_int;
| --------------------------- similarly named function getpid
defined here
For more information about this error, try rustc --explain E0425
.
error: could not compile eadb
due to previous error
https://github.com/tiann/eadb/blob/main/src/build_image.rs#L68
这里直接把 uid = 0 试试
好的,我试试。语法问题怎么弄,前面说找不到,后面又说重定义,懵了
cargo build完成 ,cargo install eadb报错,具体如下: cargo build Compiling eadb v0.1.5 (E:\eadb) Finished dev [unoptimized + debuginfo] target(s) in 35.64s
cargo install eadb
Compiling eadb v0.1.5
error[E0425]: cannot find function getuid
in crate libc
--> C:\Users.cargo\registry\src\mirrors.ustc.edu.cn-12df342d903acd47\eadb-0.1.5\src\build_image.rs:68:30
|
68 | let uid = unsafe { libc::getuid() };
| ^^^^^^ help: a function with a similar name exists: getpid
|
::: C:\Users.cargo\registry\src\mirrors.ustc.edu.cn-12df342d903acd47\libc-0.2.132\src\windows\mod.rs:482:5
|
482 | pub fn getpid() -> ::c_int;
| --------------------------- similarly named function getpid
defined here
For more information about this error, try rustc --explain E0425
.
error: could not compile eadb
due to previous error
error: failed to compile eadb v0.1.5
, intermediate artifacts can be found at C:\Users\AppData\Local\Temp\cargo-install7xBCLI
build 完成你用自己 build 好的 eadb 就行了,不要再 cargo install
cargo buile完成后,在当前目录执行eadb提示 $ eadb bash: eadb: command not found
生成的eadb.exe拷贝到与assets同级的目录 执行./eadb.exe prepare -a debianfs-arm64-full.tar.gz 报下面的问题: Using archive at debianfs-arm64-full.tar.gz for filesystem preparation Pushing filesystem to device.. debianfs-arm64-full.tar.gz: 1 file pushed. 31.6 MB/s (324371126 bytes in 9.790s) Pushing addons to device.. adb: error: cannot stat 'C:\Users\AppData\Local\Temp.tmpT4Ez9t\assets/': No such file or directory chmod: /data/eadb/device-: No such file or directory Unpacking filesystem in device.. /system/bin/sh: /data/eadb/device-unpack: inaccessible or not found All done! Run "eadb shell" to get started.
建议用 ubuntu 虚拟机
编译可能过于麻烦,建议参考这篇文章操作,adb传文件后手动解压即可
- https://blog.seeflower.dev/archives/138/