小编roj*_*and的帖子

如何为在 XCode 中以调试模式运行的 iOS 应用程序创建整个内存的转储

我有一个在 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)的其他方法?我不使用越狱设备。

memory xcode dump ios lldb

5
推荐指数
1
解决办法
1651
查看次数

当针对 Android 12 (targetSdkVersion 32) 时,在 Android 12 之前的设备上使用蓝牙时,我是否应该请求位置权限

我的应用程序从前台服务扫描并连接到 BLE 设备。我想升级 SDK 并面向 Android 12 ( targetSdkVersion 32) 并支持旧版本的 Android。

Android 12 引入了有关蓝牙权限的更改。

Android 文档说

从 Android 12 开始:BLUETOOTH_ADVERTISE、BLUETOOTH_CONNECT 和 BLUETOOTH_SCAN 权限是运行时权限。

  1. 如果您的应用程序不使用蓝牙扫描结果来获取物理位置,则您可以强烈断言您的应用程序从未使用蓝牙权限来获取物理位置。为此,请完成以下步骤:

将该android:usesPermissionFlags属性添加到您的BLUETOOTH_SCAN权限声明中,并将该属性的值设置为neverForLocation

  1. 如果您的应用不需要位置信息,请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)

android location bluetooth android-permissions

4
推荐指数
1
解决办法
2281
查看次数

标签 统计

android ×1

android-permissions ×1

bluetooth ×1

dump ×1

ios ×1

lldb ×1

location ×1

memory ×1

xcode ×1