我有一个在 Xcode 中以调试模式运行的应用程序。我想检查应用程序的整个内存(堆栈和堆)。我知道我可以使用 lldb 进行转储。我使用以下命令:
(lldb) memory read --outfile filename address
Run Code Online (Sandbox Code Playgroud)
例如。
(lldb) memory read --outfile /tmp/mem-dump.txt --force --count 10000 0x000000010d051000
Run Code Online (Sandbox Code Playgroud)
,但我需要指定内存的起始地址和大小。我不知道如何找到我的应用程序占用的内存区域进行转储。是否有可能找到内存的地址空间?也许存在进行转储(不使用 lldb)的其他方法?我不使用越狱设备。
我的应用程序从前台服务扫描并连接到 BLE 设备。我想升级 SDK 并面向 Android 12 ( targetSdkVersion 32) 并支持旧版本的 Android。
Android 12 引入了有关蓝牙权限的更改。
从 Android 12 开始:BLUETOOTH_ADVERTISE、BLUETOOTH_CONNECT 和 BLUETOOTH_SCAN 权限是运行时权限。
- 如果您的应用程序不使用蓝牙扫描结果来获取物理位置,则您可以强烈断言您的应用程序从未使用蓝牙权限来获取物理位置。为此,请完成以下步骤:
将该
android:usesPermissionFlags属性添加到您的BLUETOOTH_SCAN权限声明中,并将该属性的值设置为neverForLocation。
- 如果您的应用不需要位置信息,请
ACCESS_FINE_LOCATION从应用清单中删除该权限。
<manifest>
<!-- Include "neverForLocation" only if you can strongly assert that
your app never derives physical location from Bluetooth scan results. -->
<uses-permission android:name="android.permission.BLUETOOTH_SCAN"
android:usesPermissionFlags="neverForLocation" />
<!-- Not needed if you can strongly assert that your app never derives
physical location from Bluetooth …Run Code Online (Sandbox Code Playgroud)