1

更新:我在下面发布了这个问题的答案/解决方案。

这是我所拥有的,但正则表达式不太正确:

 <macrodef name="set-app-debuggable">
    <sequential>
        <echo>Setting  AndroidManifest.xml with debuggable set to true</echo>           
        <replaceregexp file="./AndroidManifest.xml" byline="true"
                match="name=&quot;debuggable&quot;&gt;(\w+)&lt;"
               replace="name=&quot;debuggable&quot;&gt;true&lt;"/>
    </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”

4

1 回答 1

0

Here is the macro

  <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>
于 2012-05-17T03:58:09.687 回答