>更新:我在下面发布了这个问题的答案/解决方案。
这是我所拥有的,但正则表达式不太正确:
<macrodef name="set-app-debuggable">
<sequential>
<echo>Setting AndroidManifest.xml with debuggable set to true</echo>
<replaceregexp file="./AndroidManifest.xml" byline="true"
match="name="debuggable">(w+)<"
replace="name="debuggable">true<"/>
</sequential>
</macrodef>
这是AndroidManifest
<application android:name="MyApplication" android:theme="@style/MyStyles.NoTitleBar"
android:label="@string/app_name" android:debuggable="true" android:hardwareAccelerated="true" >
我正在尝试在调用此宏时将可调试设置为 false。不确定如何指定元素应用程序和 ="false"
这是宏
<macrodef name="set-app-debuggable">
<sequential>
<echo>Updating AndroidManifest.xml with debuggable set to true</echo>
<replaceregexp file="./AndroidManifest.xml"
match='android:debuggable="(.*)"'
replace='android:debuggable="true"'
byline="false">
</replaceregexp>
</sequential>
</macrodef>