@@ -55,11 +55,12 @@ async function getTestConfig() {
5555 const iosDirPath = path . join ( pluginApi . getProjectRoot ( ) , 'ios' ) ;
5656 const androidDirPath = path . join ( pluginApi . getProjectRoot ( ) , 'android' ) ;
5757
58- const [ appJsonContent , iosDirContent , androidDirContent ] = await Promise . all ( [
59- fs . readFile ( appJsonPath , 'utf-8' ) ,
60- fs . readdir ( iosDirPath ) ,
61- fs . readdir ( androidDirPath ) ,
62- ] ) ;
58+ const [ appJsonContent , iosDirContent , androidAppBuildGradleContent ] =
59+ await Promise . all ( [
60+ fs . readFile ( appJsonPath , 'utf-8' ) ,
61+ fs . readdir ( iosDirPath ) ,
62+ fs . readFile ( path . join ( androidDirPath , 'app' , 'build.gradle' ) , 'utf-8' ) ,
63+ ] ) ;
6364
6465 const { expo, ...rest } = JSON . parse ( appJsonContent ) ;
6566 const appJsonConfig = expo || rest ;
@@ -68,19 +69,27 @@ async function getTestConfig() {
6869 iosDirContent . find ( ( dir ) => dir . includes ( '.xcodeproj' ) ) ?. split ( '.' ) [ 0 ] ??
6970 '' ;
7071
71- const androidProjectName = androidDirContent . find ( ( dir ) =>
72- dir . includes ( '.gradle' ) ,
73- )
74- ? 'android'
75- : '' ;
72+ const projectPbxprojContent = await fs . readFile (
73+ path . join ( iosDirPath , `${ iosProjectName } .xcodeproj` , 'project.pbxproj' ) ,
74+ 'utf-8' ,
75+ ) ;
76+
77+ const iosBundleIdentifier =
78+ projectPbxprojContent . match ( / P R O D U C T _ B U N D L E _ I D E N T I F I E R = " ( .* ) " / ) ?. [ 1 ] ??
79+ '' ;
80+
81+ const androidPackageName =
82+ androidAppBuildGradleContent . match ( / a p p l i c a t i o n I d " ( .* ) " / ) ?. [ 1 ] ?? '' ;
7683
7784 const info = {
85+ introspect : false ,
7886 projectRoot : pluginApi . getProjectRoot ( ) ,
7987 platforms : [ 'ios' , 'android' ] as ProjectInfo [ 'platforms' ] ,
8088 packageJsonPath : path . join ( pluginApi . getProjectRoot ( ) , 'package.json' ) ,
8189 appJsonPath,
8290 iosProjectName,
83- androidProjectName,
91+ iosBundleIdentifier,
92+ androidPackageName,
8493 } ;
8594
8695 return { appJsonConfig, info } ;
0 commit comments