简体   繁体   English

Android-将共享的uid分配给2个应用

[英]android - assigning shared uid to 2 apps

I am trying to run some tests wherein I need two apps written in Android Studio to have same uid when run in genymotion VM. 我正在尝试运行一些测试,其中在genymotion VM中运行时,我需要两个用Android Studio编写的应用程序具有相同的uid。 I want to use the shareduid. 我想使用共享对象。

In both apps, I specify in the manifest : 在这两个应用程序中,我都在清单中指定:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
   package="com.android.my.app"
   android:sharedUserId="com.mytest">

However, this value of shared uid causes error when I try to run the application in genymotion. 但是,当我尝试在genymotion中运行应用程序时,共享uid的此值会导致错误。 I referred other SO answers and see developers using a string value in sharedUserId field. 我引用了其他SO答案,并看到开发人员在sharedUserId字段中使用字符串值。

What am I missing ? 我想念什么?

I had the two apps installed previously on genymotion, when I tested them through Android Studio. 当我通过Android Studio测试它们时,我之前在genymotion上安装了这两个应用程序。 To use shared user id, I uninstalled both apps from Genymotion, and then ran them again from Android Studio. 要使用共享的用户ID,我从Genymotion卸载了两个应用程序,然后从Android Studio重新运行它们。 They worked as expected. 他们按预期工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM