更新:我已在下面发布了这个问题的答案/解决方案。
这是我所拥有的,但正则表达式并不完全正确:
<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" >
我试图在调用此宏时将debuggable设置为false。不确定如何指定元素应用程序和=“false”
答案 0 :(得分:0)
这是宏
<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>