エミュレータのTelephonyManager
によって返されるIMEIを変更する方法はありますか?また、Settings.Secure.ANDROID_ID
によって返されたIDを変更する方法はありますか?AndroidエミュレータのデバイスIDを変更しますか?
サーバー側にデータを保存する際に、これらのIDを使用してユーザーを区別します。 QAチームがこれらのIDを変更して、すべてが同じユーザーデータセットを使用しているわけではない場合は、うれしいことです。
エミュレータのTelephonyManager
によって返されるIMEIを変更する方法はありますか?また、Settings.Secure.ANDROID_ID
によって返されたIDを変更する方法はありますか?AndroidエミュレータのデバイスIDを変更しますか?
サーバー側にデータを保存する際に、これらのIDを使用してユーザーを区別します。 QAチームがこれらのIDを変更して、すべてが同じユーザーデータセットを使用しているわけではない場合は、うれしいことです。
私はそれを試していませんが、this pageはemaultor.exeファイルを手動で変更する方法を概説しています。あなたは各QAチームメンバーのために別々のエミュレータを作成する必要がありますが、かなり簡単です。
限りSettings.Secure.ANDROID_ID
が行くように、これはトリック実行する必要があります。
adb shell sqlite3 /data/data/com.android.providers.settings/databases/settings.db "UPDATE secure SET value='newid' WHERE name='android_id'
「newid
は通常、16進桁のコードである
(すなわち追加されません 『それに対して』 Android_を)
。。私は、私は本当の電話が最初に根ざしする必要があるであろうと想像エミュレータ上でこれを試してみました
と記述してください。この回答は、実際に値を変更する最も簡単な方法を説明していると思います。あなたはまだ、Androidランタイムキャッシュの方法_refresh_が必要です。私の頭の上から、私が考えることができる唯一の方法は、タイミングの観点から少し不都合なエミュレータを再起動することです:-( – dbm
あなたは私たちに例を挙げることができますか? – user358591
Got Error: : 構文エラー – user358591
クエリandroid_id adbのシェルで次のコマンドを使用します。
settings get secure android_id
変更android_id adbのシェルで次のコマンドを使用します。zyc zycの
settings put secure android_id xxxxxxxxxxxxxxxx
答えは、Android 7.1.1(25)までの最良のものです。公式の開発者向けドキュメントに記載されandroid_idのアンドロイド8つのルールから変更されました: https://android-developers.googleblog.com/2017/04/changes-to-device-identifiers-in.html
In O, Android ID (Settings.Secure.ANDROID_ID or SSAID) has a different value for each app and each user on the device. Developers requiring a device-scoped identifier, should instead use a resettable identifier, such as Advertising ID, giving users more control. Advertising ID also provides a user-facing setting to limit ad tracking. Additionally in Android O: The ANDROID_ID value won't change on package uninstall/reinstall, as long as the package name and signing key are the same. Apps can rely on this value to maintain state across reinstalls. If an app was installed on a device running an earlier version of Android, the Android ID remains the same when the device is updated to Android O, unless the app is uninstalled and reinstalled. The Android ID value only changes if the device is factory reset or if the signing key rotates between uninstall and reinstall events. This change is only required for device manufacturers shipping with Google Play services and Advertising ID. Other device manufacturers may provide an alternative resettable ID or continue to provide ANDROID ID.
それは最善の方法ではないのですが、それが唯一の方法です!フォローアップ[post](http://blog.codepainters.com/2010/11/20/android-emulator-patch-for-configurable-imi-imi-im-and-sim-card-serial-number/)では、彼はそれを構成可能にするパッチを提供している(もちろん、エミュレータを再コンパイルする必要がある)。 –
私のブログへのリンクによるアップポート:)注:私はhttp://blog.codepainters.comにブログを移動しました。 –
ソリューションへのリンクを提供する代わりに、答えを – Berik