@@ -1740,7 +1740,6 @@ function launch(simHandleOrUDID, options, callback) {
1740
1740
1741
1741
function findTitaniumAppLogFile ( next ) {
1742
1742
const autoExitToken = options . autoExitToken || 'AUTO_EXIT' ;
1743
- const logRegExp = new RegExp ( ' ' + simHandle . appName + '\\[\\d+:\\d+\\] (.*)' ) ;
1744
1743
const crash1RegExp = / \* \* \* T e r m i n a t i n g a p p / ; // objective-c issue
1745
1744
1746
1745
if ( watchSimHandle && options . launchWatchAppOnly ) {
@@ -1753,41 +1752,24 @@ function launch(simHandleOrUDID, options, callback) {
1753
1752
let found = false ;
1754
1753
let detectedCrash = false ;
1755
1754
( function walk ( dir ) {
1756
- let processingJsonObject = false ;
1757
1755
const logFile = path . join ( dir , 'Documents' , options . logFilename ) ;
1758
1756
if ( fs . existsSync ( logFile ) ) {
1759
1757
emitter . emit ( 'log-debug' , __ ( 'Found application log file: %s' , logFile ) ) ;
1760
1758
logFileTail = new Tail ( logFile , '\n' , { interval : 500 , start : 0 } ) ;
1761
1759
logFileTail . on ( 'line' , function ( msg ) {
1762
- const m = msg . match ( logRegExp ) ;
1763
1760
1764
- if ( ! m && processingJsonObject ) {
1765
- emitter . emit ( 'log-file' , msg ) ;
1766
- }
1767
-
1768
- if ( ! m && processingJsonObject && msg . startsWith ( '}' ) ) {
1769
- processingJsonObject = false ;
1770
- }
1771
-
1772
- if ( m ) {
1773
-
1774
- if ( m [ 1 ] . endsWith ( '{' ) ) {
1775
- processingJsonObject = true ;
1776
- }
1761
+ emitter . emit ( 'log-file' , msg ) ;
1777
1762
1778
- emitter . emit ( 'log-file' , m [ 1 ] ) ;
1779
-
1780
- if ( options . autoExit && msg . indexOf ( autoExitToken ) !== - 1 ) {
1781
- emitter . emit ( 'log-debug' , __ ( 'Found "%s" token, stopping simulator' , autoExitToken ) ) ;
1782
- // stopping the simulator will cause the "close" event to fire
1783
- stop ( simHandle , function ( ) {
1784
- cleanupAndEmit ( 'app-quit' ) ;
1785
- } ) ;
1786
- return ;
1787
- }
1763
+ if ( options . autoExit && msg . indexOf ( autoExitToken ) !== - 1 ) {
1764
+ emitter . emit ( 'log-debug' , __ ( 'Found "%s" token, stopping simulator' , autoExitToken ) ) ;
1765
+ // stopping the simulator will cause the "close" event to fire
1766
+ stop ( simHandle , function ( ) {
1767
+ cleanupAndEmit ( 'app-quit' ) ;
1768
+ } ) ;
1769
+ return ;
1788
1770
}
1789
1771
1790
- if ( ! detectedCrash && simHandle . type === 'ios' && ( ( m && crash1RegExp . test ( m [ 1 ] ) ) ) ) {
1772
+ if ( ! detectedCrash && simHandle . type === 'ios' && ( ( msg && crash1RegExp . test ( msg ) ) ) ) {
1791
1773
detectedCrash = true ;
1792
1774
// wait 1 second for the potential crash log to be written
1793
1775
setTimeout ( function ( ) {
0 commit comments