Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
MistEO committed Oct 25, 2023
1 parent 7ed4784 commit f4ab348
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 9 deletions.
3 changes: 0 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,6 @@ jobs:
cp -r docs install
cp -r sample install
rm -r install/sample/cpp/*.vcxproj install/sample/cpp/CMakeLists.txt
cp -r LICENSE.md install
Expand Down Expand Up @@ -201,7 +200,6 @@ jobs:
cp -r docs install
cp -r sample install
rm -r install/sample/cpp/*.vcxproj install/sample/cpp/CMakeLists.txt
cp -r LICENSE.md install
Expand Down Expand Up @@ -271,7 +269,6 @@ jobs:
cp -r docs install
cp -r sample install
rm -r install/sample/cpp/*.vcxproj install/sample/cpp/CMakeLists.txt
cp -r LICENSE.md install
Expand Down
6 changes: 2 additions & 4 deletions sample/cpp/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,16 @@ int main([[maybe_unused]] int argc, char** argv)
return 0;
}

auto cur_dir = std::filesystem::path(argv[0]).parent_path();

const int kIndex = 0; // for demo, we just use the first device
auto agent_path = cur_dir / "share" / "MaaAgentBinary";
auto agent_path = "share" / "MaaAgentBinary";
auto controller_handle =
MaaAdbControllerCreateV2(MaaToolKitGetDeviceAdbPath(kIndex), MaaToolKitGetDeviceAdbSerial(kIndex),
MaaToolKitGetDeviceAdbControllerType(kIndex), MaaToolKitGetDeviceAdbConfig(kIndex),
agent_path.string().c_str(), nullptr, nullptr);
auto ctrl_id = MaaControllerPostConnection(controller_handle);

auto resource_handle = MaaResourceCreate(nullptr, nullptr);
auto resource_dir = cur_dir / "share" / "resource";
auto resource_dir = "my_resource";
auto res_id = MaaResourcePostPath(resource_handle, resource_dir.string().c_str());

MaaControllerWait(controller_handle, ctrl_id);
Expand Down
4 changes: 2 additions & 2 deletions sample/python/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
Library.open("bin")

resource = Resource()
res_id = resource.post_path("share/resource/")
res_id = resource.post_path("my_resource")
resource.wait(res_id)

controller = AdbController("adb", "127.0.0.1:16416", agent_path = "share/MaaAgentBinary/")
controller = AdbController("adb", "127.0.0.1:16416", agent_path = "share/MaaAgentBinary")
ctrl_id = controller.post_connection()
controller.wait(ctrl_id)

Expand Down

0 comments on commit f4ab348

Please sign in to comment.