# android_location_mocker **Repository Path**: jimonik/android_location_mocker ## Basic Information - **Project Name**: android_location_mocker - **Description**: No description available - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 1 - **Created**: 2024-06-13 - **Last Updated**: 2025-08-17 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Getting Started 通过android系统的模拟,实现丁丁远程打卡 ```dart final _androidLocationMockerPlugin = AndroidLocationMocker(); // 是否在系统设置界面吧模拟位置应用选上 bool res = await _androidLocationMockerPlugin.isReady(); // 判断是否处于开发者模式 var res = await _androidLocationMockerPlugin.isOpenDevMode(); // 打开开发者模式的系统设置界面 var res = await _androidLocationMockerPlugin.openDevMode(); // 开启模拟,注意:MockLocationBean里面每个参数都必填 var bean = MockLocationBean( common: Common( useGps: isUseGps, useNetwork: isUseNetwork, frequencyMs: int.tryParse(frequencyController.text) ?? 100), mockLocation: MockLocation( lat: currentLatlng?.latitude ?? 0, lng: currentLatlng?.longitude ?? 0)); _androidLocationMockerPlugin.startMock(bean); // 停止模拟 var res = await _androidLocationMockerPlugin.stopMock(); ``` ## MockLocationBean解释 ```yaml MockLocationBean: common: useNetwork: #网络模拟开启 useGps: true #GPS模拟开启 frequencyMs: 200 #200毫秒 mockLocation: #经纬度 #窃用且珍惜 ```