1

次のコマンドを使用して、コマンド ラインから iOS UIAutomation テストを実行しています。

instruments -t /Developer/Platforms/iPhoneOS.platform/Developer/Library/Instruments/PlugIns/AutomationInstrument.bundle/Contents/Resources/Automation.tracetemplate /Users/ctester/Library/Developer/Xcode/DerivedData/TestView-acwgjlejvnjkqietyevgfnsjngpd/Build/Products/Debug-iphonesimulator/TestView.app -e UIASCRIPT ta.js -e UIARESULTSPATH .

シミュレーターで正常に起動されましたTestView.appが、スクリプトは実行されません。

存在しないスクリプトを指定しようとしましたが、エラーは報告されませんでした。-e UIASCRIPT ta.js ...したがって、引数は無視されると思います。

instruments私のラップトップでのコマンドのバージョンは次のとおりです。

instruments, version 1.0
usage: instruments [-t template] [-D document] [-l timeLimit] [-i #] [-w device] [[-p pid] | [application [-e variable value] [argument ...]]]

それは問題ですか?

TestView.appそしてta.jsinstruments.app(GUI)で問題なく動作します。

ありがとう。

4

1 に答える 1

0

インストゥルメントがパス内のスペースよりも好まないものはほとんどありません。パスにスペースがある場合は、エスケープしてください。引用符の使用は確実には機能しません。計測器は起動するかもしれませんが、起動プロセスの後半でスペースを詰まらせます。

インストゥルメントに ta.js への絶対パスを指定し、エスケープします。例:

find ${PWD} -name ta.js -exec echo {} \; | sed 's/ /\\ /g'

sed ビットは、見つかった ta.js のパスをエスケープします。

あなたが試すことができます: instruments -t /Developer/Platforms/iPhoneOS.platform/Developer/Library/Instruments/PlugIns/AutomationInstrument.bundle/Contents/Resources/Automation.tracetemplate /Users/ctester/Library/Developer/Xcode/DerivedData/TestView-acwgjlejvnjkqietyevgfnsjngpd/Build/Products/Debug-iphonesimulator/TestView.app -e UIASCRIPT ``find ${PWD} -name ta.js -exec echo {} \; | sed 's/ /\\ /g'`` -e UIARESULTSPATH .

ただし、ダブル バック ティックをシングル バック ティックに置き換えます。` は SO フォーマットの予約文字です :(

于 2011-11-22T03:43:51.053 に答える